Two mods im struggling to make.

NTclaymore

Chieftain
Joined
Aug 9, 2016
Messages
2
Location
Denmark
Im very new to modding but I been trying to learn from this sites many great tutorials
but i still failed to create my desired mods properly. =(

I wanted to create two mods. The first is very simple. I just wanted to remove the cannon and the musketman ( all the unique units included) I did this without too much problem but I cant seem to prevent the longswordsman and the trebuchet to go obsolete when the techs that should have unlocked the upgraded version + i allso cant make it so the longswordsman can be upgrades to rifleman later on..

I tried XML and SQL but as im new to this i have surely made errors. Help plz?
P.s. I know my code is messy but to start with I just want it to work.

XML attemp
Spoiler :
Code:
<GameData>
	<Units>
		<Update>
			<Set GoodyHutUpgradeUnitClass="UNITCLASS_RIFLEMAN" />
			<Where UnitType="UNIT_LONGSWORDSMAN" />
		</Update>
		<Update>
			<Set ObsoleteTech="TECH_RIFLING" />
			<Where UnitType="UNIT_LONGSWORDSMAN" />
		</Update>
		<Update>
			<Set GoodyHutUpgradeUnitClass="UNITCLASS_ARTILLERY" />
			<Where UnitType="UNIT_TREBUCHET" />
		</Update>
		<Update>
			<Set ObsoleteTechs="TECH_DYNAMITE" />
			<Where UnitType="UNIT_TREBUCHET" />
		</Update>
	</Units>
</GameData>

SQL attempt
Spoiler :
Code:
UPDATE Units
  SET ObsoleteTech = 'TECH_RIFLING'
  WHERE Type IN (
    SELECT UnitType
    FROM Civilization_UnitClassOverrides
    WHERE UnitType 'UNIT_LONGSWORDSMAN'
  );
  UPDATE Units
  SET GoodyHutUpgradeUnitClass = 'UNITCLASS_RIFLEMAN'
  WHERE Type IN (
    SELECT UnitType
    FROM Civilization_UnitClassOverrides
    WHERE UnitType 'UNIT_LONGSWORDSMAN'
  );
  UPDATE Units
  SET ObsoleteTech = 'TECH_DYNAMITE'
  WHERE Type IN (
    SELECT UnitType
    FROM Civilization_UnitClassOverrides
    WHERE UnitType 'UNIT_TREBUCHET'
  );
  UPDATE Units
  SET GoodyHutUpgradeUnitClass = 'UNITCLASS_ARTILLERY'
  WHERE Type IN (
    SELECT UnitType
    FROM Civilization_UnitClassOverrides
    WHERE UnitType 'UNIT_TREBUCHET'
  );

I know its probally a complete mess but as I said im very new to this and we all have to start somewhere. Please help. im willing to learn!

The second mod i had no idea how to make so ill just explain my idea. Im basicly planning on playing with the mod that locks all eras past the Renascene but as my mod above was supposed to i want to exclude guns but i still want the ideologies.
So my second mod idea was to add a new building that functions as the factory triggering Ideologi when 3 is build. Since my art-skills are bad i changed my idea to triggering Ideologi with 5 Arsenals but alas. I failed at creating that aswell..

Thanks again for hearing me out and I hope you can/will help me with this! =D
 
Upgrades are controlled through the table Unit_ClassUpgrades. It would look like

Code:
<Unit_ClassUpgrades>
    <Update>
        <Where UnitType="UNIT_LONGSWORDSMAN" />
        <Set UnitClassType="UNITCLASS_RIFLEMAN" />
    </Update>
</Unit_ClassUpgrades>

How will you handle civs whose unique units are Musketmen or later?
 
I was thinking just making an entry for each of them if that works? and thats for the ClassUpgrade thing! didnt know that!
 
If you remove the Musketman and all unique replacements, you'll want to have a different unique for affected civs (like America). If you don't, the civ will be unbalanced, and the game setup screen won't work. Uniques are driven by Civilization_BuildingClassOverrides and Civilization_UnitClassOverrides.
 
Top Bottom