<GameData>
<Units>
<Update>
<Set Cost=".1" Moves="6" Combat="5000" prereqtech="TECH_AGRICULTURE" obsoletetech="NULL"/>
<Where Type="UNIT_JAPANESE_SAMURAI"
</Update>
</Units>
</GameData>
My suggestion would be to try the Creation and Customisation Forum.
You forgot to close:
<Where Type="UNIT_JAPANESE_SAMURAI" />
Also, you'd get more help with this question in Modding and Customization subforum.
<GameData>
<Units>
<Update>
<Set Cost="1" Moves="6" Combat="5000" prereqtech="TECH_AGRICULTURE" obsoletetech="NULL"/>
<Where [B][COLOR="Red"]Type[/COLOR][/B]="UNIT_JAPANESE_SAMURAI"/>
</Update>
</Units>
</GameData>
No, Type is correct. The class would be UNITCLASS_something, whatever unit the Samurai replaces.
But first of all, it's all case-sensitive, so prereqtech needs to be PrereqTech. Same for ObsoleteTech.
Second: OnModActivated/UpdateDatabase. If you don't know what I mean by that, then that's your problem.
Third, if it still doesn't work, try trimming the Set down to something smaller, see if that works, and then add things back in. For instance, the ObsoleteTech="NULL" might not work right; NULL elements generally don't replace well.
m202 said:Also how do I make it so iron isn't required to build them?
<GameData>
<Unit_ResourceQuantityRequirements>
<Delete UnitType="UNIT_JAPANESE_SAMURAI"/>
</Unit_ResourceQuantityRequirements>
</GameData>
You can do a mass update, it's just that if any one part of it doesn't work (like the case-sensitive thing I mentioned before) then the whole thing will break. This makes it hard to debug, until you're experienced enough that you spot these things beforehand.
There's a separate table, Unit_ResourceQuantityRequirements. That's the one you want to modify. So you'll just do something like
which'll delete any blocks in that table that have UnitType set to that value. If, hypothetically, the Samurai required two different resources and you only wanted to remove the one for Iron, you'd writeCode:<GameData> <Unit_ResourceQuantityRequirements> <Delete UnitType="UNIT_JAPANESE_SAMURAI"/> </Unit_ResourceQuantityRequirements> </GameData>
<Delete UnitType="UNIT_JAPANESE_SAMURAI" ResourceType="RESOURCE_IRON"/>
instead.
<GameData>
<Units>
<Update>
<Set Cost="1" Moves="6" Combat="5000" PrereqTech="TECH_AGRICULTURE" ObsoleteTech="NULL"/>
<Where Type="UNIT_JAPANESE_SAMURAI"/>
</Update>
</Units>
<Unit_ResourceQuantityRequirements>
<Delete UnitType="UNIT_JAPANESE_SAMURAI"/>
</Unit_ResourceQuantityRequirements>
</GameData>
<GameData>
<Units>
<Update>
<Where Type="UNIT_JAPANESE_SAMURAI"/>
<Set>
<Cost>1</Cost>
<Moves>6</Moves>
<Combat>1000</Combat>
<PrereqTech>TECH_AGRICULTURE</PrereqTech>
<ObsoleteTech></ObsoleteTech>
</Set>
</Update>
</Units>
</GameData>