Problems Creating a New Module

razzach

Warlord
Joined
Mar 14, 2009
Messages
125
Why can't I change the specialist's yields when creating a module. I included the schema but when I try to change only the fields I wanted, there is an error (something about schema). When I tried to include every tag the new values/yields were not used (it reverted to the original values/yields). Is the CIV4SpecialistInfos.xml not modular yet?
 
I'm not sure, actually. Would you mind uploading the files you changed?

Also, thanks to Xienwolf after the next patch modders will have an easier time... The schemas have been changed to allow a modder to not only list only the tags an item needs (as it is now), but you can also list them IN ANY ORDER. Makes life MUCH easier when editing an existing item, or trying to make a new one. ;)
 
Did you include the schema file for CIV4SpecialistInfos in your module? If you don't include the proper schema file the module fails. I learned that the hard way.
 
Sorry for late reply, been gone for a while. I've actually found the error. It was actually simple - I was trying to change the values of Specialists and setting some of their values to default - zero. But in the current Modular Loading, a zero value is skipped. I tried using bForceOverwrite, but it seems not yet implemented for Specialist schema...

At least I learned something :)

Another question, how can I limit buildings/units to be buildable only by a certain leader or leaders with select traits? Is there a prereqLeader or prereqTrait tags in Buildings/Units that I don't understand about :) Thanks again...
 
Sorry for late reply, been gone for a while. I've actually found the error. It was actually simple - I was trying to change the values of Specialists and setting some of their values to default - zero. But in the current Modular Loading, a zero value is skipped. I tried using bForceOverwrite, but it seems not yet implemented for Specialist schema...

At least I learned something :)

Another question, how can I limit buildings/units to be buildable only by a certain leader or leaders with select traits? Is there a prereqLeader or prereqTrait tags in Buildings/Units that I don't understand about :) Thanks again...

Ah, okay. Yeah, it's been implemented in the DLL, Xienwolf just didn't add it to the Schema for specialists. Try swapping the attached file for what you have... Haven't tested it, but it should work. I'd back up the original just in case.

As an added benefit, using this schema you can now list specialist tags in ANY order you wise... As with any other 'GameInfos' files.

As for a prereqTrait/Leader tag... Nonexistent atm. If you're comfortable with python, in CvGameUtils.py look for either 'def canConstruct' or 'cannotConstruct' for buildings (People have used the second, so I'd go with that and just say 'if NOT this trait, then this') and 'def canTrain' or 'cannotTrain' for units. (People have used both here).
 

Attachments

It works! Thanks Valk! So if there is a missing <bForceOverwrite> tag in the part of the schema I'm using, I can just add it in, as long as there is already a <bForceOverwrite> tag in the other parts of the schema? Curious...but useful :)

As for def canConstruct/canTrain, I think I'll resort to that. I hate using python as I want things to be completely Modular (in addition, I have a slooowww computer :) ) but I guess there's no choice. Thanks again.
 
It works! Thanks Valk! So if there is a missing <bForceOverwrite> tag in the part of the schema I'm using, I can just add it in, as long as there is already a <bForceOverwrite> tag in the other parts of the schema? Curious...but useful :)

As for def canConstruct/canTrain, I think I'll resort to that. I hate using python as I want things to be completely Modular (in addition, I have a slooowww computer :) ) but I guess there's no choice. Thanks again.

Yeah. So long as the tags themselves are already defined in the file (Hard not to be in this one... Used for Religions, Civics, Votes, so on), you can just stick them in the list for the specific file you want. I'd be careful the first time you have to do it (Screwing up in the schema means crashes. :lol: I did it with the new Alignment... Thought I was going to have to do the DLL over, until I checked the schemas again. :crazyeye:). Use Xienwolf's guide here... Has a good tutorial on the schema.

In this case, a little python won't affect speed. It's already being called for the unit/building... Which is why I'd advise sticking to ones that are used. ;)
 
In this case, a little python won't affect speed. It's already being called for the unit/building... Which is why I'd advise sticking to ones that are used. ;)

Yup, But everytime you release an update. I will have to release one too...besides being more error prone :)

I will write this in Ideas and requests thread then :)
Requesting a tag for prereqLeader, prereqTrait (in addition to what you will add... prereqMoralAlign and prereqEthicAlign :lol:) in the Buildings, Units, and Civics

This way we can have 2 leaders of the same civilization having different buildings, or 2 leaders that can have a very different scout...fun! :D
 
Is it possible to add the opposite side - cannotTrain/cannotBuild?
A codeblock like this:

Code:
<prereqLeaders>
     <prereqLeader>
                 <LeaderName>LEADER_OPHELIA</LeaderName>
                 <canBuild>1</canBuild>
     </prereqLeader>
     <prereqLeader>
                 <LeaderName>LEADER_FALAMAR</LeaderName>
                 <canBuild>-1</canBuild>
     </prereqLeader>
</prereqLeaders>

where 1 - can Build/Train and -1 cannot Build/Train. I've been thinking of this and looking at XML :D

If only I can edit the DLL... :cry:
 
Back
Top Bottom