View Full Version : Problems Creating a New Module
razzach Nov 08, 2009, 07:39 AM 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?
Valkrionn Nov 08, 2009, 04:31 PM 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. ;)
Swinkscalibur Nov 09, 2009, 09:58 AM 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.
razzach Nov 09, 2009, 11:28 PM 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...
Valkrionn Nov 10, 2009, 12:10 AM 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).
razzach Nov 10, 2009, 12:42 AM 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.
Valkrionn Nov 10, 2009, 12:48 AM 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. ;)
razzach Nov 10, 2009, 12:56 AM 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
Valkrionn Nov 10, 2009, 12:58 AM Hmm... Would simplify the Scion code as well. I'll put it on my list. ;)
First comes the alignment work though, so I'd go ahead and work on the python. :lol:
razzach Nov 10, 2009, 01:10 AM Is it possible to add the opposite side - cannotTrain/cannotBuild?
A codeblock like this:
<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:
Valkrionn Nov 10, 2009, 01:24 AM Easily. Would just make it an Int, rather than a Bool.... Default value of 0, anything positive allows you to build it (should always be 1 just for readability, doesn't have to be though), anything negative blocks it (again, should be kept to -1, but that's purely cosmetic.)
|
|