Some quick questions

fallador

Chieftain
Joined
Jan 4, 2006
Messages
19
I've been working on a mod lately and theres a few things i've been trying to work out.

1. Can you make units that give a resource when you have them (preferably one per unit)
2. How do you have units appear when you build an improvement.
3. How do you allow animals to go past borders.
4. Is it possible in any way to have buildings that affect the output of the city square there in
 
fallador said:
I've been working on a mod lately and theres a few things i've been trying to work out.

1. Can you make units that give a resource when you have them (preferably one per unit)

ok I dont quite understand what you mean here...
can you be a little more specific?
or give an example on what your are trying to accomplish with a unit?


fallador said:
2. How do you have units appear when you build an improvement.

again can you be a little more specific...?

fallador said:
3. How do you allow animals to go past borders.

well the
CIV4UnitInfos.XML

defines what animals (and other units could do)

I am not sure but...

you might want to switch the AI_TAGs
of the animals from
<DefaultUnitAI>UNITAI_ANIMAL</DefaultUnitAI>

to
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>

but be careful.... animals may be able to capture and raze cities! :mischief:
(Humans (not ships or gunships) have the UNITAI_ATTACK)

there is a tag that states:

<bNoCapture>1</bNoCapture>

which means Unit can not capture Cities

("1" = Yes "0" = No)

For Example Gunships cannot capture cities so they have a value of "1"

to see a better explanation of this file go here:

http://civ4wiki.com/wiki/index.php/CIV4UnitInfos

but like I said before... I never tried any of this before... so be warned!
;)


fallador said:
4. Is it possible in any way to have buildings that affect the output of the city square there in

do you mean like how factories give you hammer (production) bonuses?

just check out the factory stats in the

CIV4BuildingInfos.xml file

to see how to add it...

you can also have buildings give bonus gold/science(research)/culture/commerce/food/health (and of course production)

and they can give negative bonuses (penalties) like -1 health (just use negative numbers)


if that's not what you mean.. please specify!


for many (if not all :mischief: ) your XML tag explanations... go here

http://civ4wiki.com/wiki/index.php/Xml_files


or here (its not as complete but sometimes has info that other link (above) doesnt have...so cross-reference! :lol: )

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


What I usually do is find a building/unit that has the bonuses/penalties that I want to incorporate and copy and paste the format :goodjob:


REMEMBER to backup all your FILES before you start editing them! ;)
 
Thanks for that. With 1 and 2 i was trying to make it so that if you build an improvement on a resource that a new unit appears while the improvement and the building unit disappear (like how summoning was done in early versions of FFH). Then the bit I'm not sure is possible is if that new unit could then give the resource to you.
What I'm trying to do is have a system where you can get resources without building roads to them since I'm trying to make a mod based on ancient times
 
fallador said:
Thanks for that. With 1 and 2 i was trying to make it so that if you build an improvement on a resource that a new unit appears while the improvement and the building unit disappear (like how summoning was done in early versions of FFH). Then the bit I'm not sure is possible is if that new unit could then give the resource to you.
What I'm trying to do is have a system where you can get resources without building roads to them since I'm trying to make a mod based on ancient times

well im not sure about that one then...

Roads maybe in some XML files (determines if resources need roads...which by default they do)

but that may be python/SDK stuff...

which I dont mess with because it messes up my MP games... :(


I would check out the improvements XML file first (no sure of the exact name but you using those links I posted previously... you can probably find it on your own :D )

and see if there is a tag line that defines whether a resource needs a road to be used.... (again dont know if there is a tag line but that's where I'd start)

if not... it may be a python/SDK thing and I have no knowledge of that type of coding :sad:


there are other people here who are better at that then I am... (almost everyone is better at it than me :lol: ) so maybe they can help you...

anyway... good luck :goodjob:
 
*EDIT*

repost! (DAMN LAG)
 
*EDIT*

repost! (DAMN LAG)
 
I've worked out that its the bAnimal tag that stops animals from going past borders. Could someone tell if I'm right in thinking that I would need to use the SDK to change this.

Also I've worked out the python needed to have improvements spawn units but I have no idea on getting the resources. Im thinking that it might be possible to check at the begining of each turn for the units and then giving the corresponding bonuses but I'm probably completely misunderstanding how it works. Is there a function that can be used to give bonuses and also could some one please tell me if theres an easier way to do this.
 
fallador said:
I've worked out that its the bAnimal tag that stops animals from going past borders. Could someone tell if I'm right in thinking that I would need to use the SDK to change this....


according to CIV4 Wiki:

http://civ4wiki.com/wiki/index.php/CIV4UnitInfos

bAnimal = Unit is an Animal. This is used in combat to determine whether opposing units' iAnimalCombat modifier applies.


b = boolean (1 Yes / 0 No)

CIV4Wiki explains alot! :mischief:
 
Yeah, I saw that but if you actually test it you can see that it also controls a few other things. I set it to 0 and animals attacked across borders if they were next to it and a unit was on the other side but they wouldn't go out of their way to attack. I think thats controlled by the DefaultUnitAI although I'm only guessing. I also think that changing the animal tag stops the unit spawning as barbarians as well as determining whether the modifier applies.
 
fallador said:
Yeah, I saw that but if you actually test it you can see that it also controls a few other things. I set it to 0 and animals attacked across borders if they were next to it and a unit was on the other side but they wouldn't go out of their way to attack. I think thats controlled by the DefaultUnitAI although I'm only guessing. I also think that changing the animal tag stops the unit spawning as barbarians as well as determining whether the modifier applies.


what about the AI tags? did you try to switch em around?

I noticed animals have one tag but the other units have another....
 
I've messed around with the animal tag a little when I was working with buildable animals, I was dismayed to find that an animal can not move into the same tile as another unit and, if I remember right, couldn't enter cities. As is several places in Civ4, this is an area where they got lazy and tied a bunch of extra stuff to this one tag.

Maybe someone with sdk skills could make a full fledged Animal mod that fixes these issues.
 
Top Bottom