How do I make a unit require a civic?

Head Serf

Emperor
Joined
Aug 6, 2005
Messages
1,564
Location
Michigan, USA
In my mod/scenario I want to include Slaves that are only buildable with the civic slavery. Does anyone have any ideas on how I could do this? I have looked through the UnitInfos.xml and Civics.xml and can't figure it out. Will I need to do something in python? I would be very thankful if someone could help. :)
 
Head Serf said:
In my mod/scenario I want to include Slaves that are only buildable with the civic slavery. Does anyone have any ideas on how I could do this? I have looked through the UnitInfos.xml and Civics.xml and can't figure it out. Will I need to do something in python? I would be very thankful if someone could help. :)


no exactly sure but....



modiki states:


<SpecialBuildingNotRequireds>: Any Special Buildings added here will, for purposes of being required by other objects, be considered built in all cities.


unsure if this is correct (or what it means:D ) but I think this has something to do with building being be allowed with this civic...

I am not sure if it refers to only AI decisions or all decisions...

the link is here:

http://modiki.apolyton.net/index.php?title=CivicInfos



EDIT: I check further (while I was posting originally :p ) and this tagline make it not required to build building to make units (Organized Religion doesnt need a monastery to make missionaries)

so my "work around solution" (which I used for some other units/building)



1) make a building that produces slaves only

2) make the pretech for the building same as the civic slavery available

3) make the <iLevelPrereq> (level of existing unit required to build building) level a ridiculious amount (100) so that make the building impossible to build - who has level 100 units? :D

4) place that building info in the slave civic xml file tagline <SpecialBuildingNotRequireds> so that this civic bypasses the requirements in #3 and be able to make slave units (but only using this civic :cool: )


this should do it! :crazyeye:

there is probably an easier way.. but I dont know sorry :sad:




let me know if you have any questions....(post here) and Ill try to work on this further....


hope that helps ;)
 
Well, I tried what you said and it is working almost perfectly except the <NoSpecialBuildingRequired> specifically allows me to make missionaries under slavery, without the use of my slave-requiring building. I guess I'll try some more in the morning.
 
Head Serf said:
Well, I tried what you said and it is working almost perfectly except the <NoSpecialBuildingRequired> specifically allows me to make missionaries under slavery, without the use of my slave-requiring building. I guess I'll try some more in the morning.


I forgot to add that you need to make it a special building (the slave building)

CIV4SpecialBuildings.XML

(follow the monastery example)

and add the special building info to the <SpecialBuildingType> in the CIV4BuildingsInfos.xml




Follow the monastery building example it both! :goodjob:

sorry I forgot to add this originally :blush:

and remember to make your slave unit have prereqtech of the slavery(bronze Tech I think) tech

and have the prereqbuilding of the slavery building

in the CIV4UnitInfos.xml


hope that helps! ;)
 
Officer Reene said:
3) make the <iLevelPrereq> (level of existing unit required to build building) level a ridiculious amount (100) so that make the building impossible to build - who has level 100 units? :D

A better way to do this is to set the production cost to -1. Anything (building, unit, wonder, whatever) with a cost of -1 cannot be built, but is still a valid object for requirements (and upgrades, in the case of units).
 
Zurai said:
A better way to do this is to set the production cost to -1. Anything (building, unit, wonder, whatever) with a cost of -1 cannot be built, but is still a valid object for requirements (and upgrades, in the case of units).

that's true...

and it can be made by Great People if you put the appropriate taglines...

but I said there are other ways :mischief:

and both ways accomplish the goal :goodjob:
 
Head Serf said:
I got it to work! Thank you guys so much!


No problem!

Have fun modding :D

@ Zurai

I'lll try that hammer thingy in my mod... when I revise the beta testing :goodjob:
 
Back
Top Bottom