How would one create a unit invisible to others?

LoneGamer

Warlord
Joined
Sep 27, 2010
Messages
138
Pretty much what the topic says. Say I want to update the samurai to be invisible until it attacks. Is this even possible? Fairly new to this so any tip/advice would be great.

Edit: I'm going through the XMLs and I found InvisibleInfos, the only thing I see though is Invisible submarine.

I go to unitclasses and only find submarine and nuclear submarine, no invisible sub. same for units. I'd like to figure this out so I could add spies as well. Also there is no invisible sub in the game..
 
I found something in specialists, Visible. they all point to 1. I'll try something out with the value of 0.
 
Pretty much what the topic says. Say I want to update the samurai to be invisible until it attacks. Is this even possible? Fairly new to this so any tip/advice would be great.

Edit: I'm going through the XMLs and I found InvisibleInfos, the only thing I see though is Invisible submarine.

I go to unitclasses and only find submarine and nuclear submarine, no invisible sub. same for units. I'd like to figure this out so I could add spies as well. Also there is no invisible sub in the game..

First step is to use the InvisibleInfos.xml file to create another invisible type (INVISIBLE_SPY) or whatever you want to call it.

Second, You have to create the ability.
In Civ5, most of the abilities are run through the promotions system.
You have to go into the Civ5PromotionsInfos.xml.
Find the PROMOTION_INVISIBLE_SUBMARINE promotion., Below is the code for the Promotion, you can see where the promotion references the INVISIBLE_SUBMARINE, just use this code as a template, and create a new promotion, using your new INVISIBLE_SPY tag, (changing other names where appropriate). Now you have your Spy Invisiblity ability.

Spoiler :

<Row>
<Type>PROMOTION_INVISIBLE_SUBMARINE</Type>
<Description>TXT_KEY_PROMOTION_INVISIBLE_SUBMARINE</Description>
<Help>TXT_KEY_PROMOTION_INVISIBLE_SUBMARINE</Help>
<Sound>AS2D_IF_LEVELUP</Sound>
<Invisible>INVISIBLE_SUBMARINE</Invisible>
<PortraitIndex>59</PortraitIndex>
<IconAtlas>ABILITY_ATLAS</IconAtlas>
<PediaType>PEDIA_ATTRIBUTES</PediaType>
<PediaEntry>TXT_KEY_PEDIA_PROMOTION_INVISIBLE_SUBMARINE</PediaEntry>
</Row>


Lastly you have to give this promotion to a unit.
Create your new unit, and just give the unit the promotion.
Now when the unit is built, it is given this promotion as a "free promotion", which is just the ability to be invisible.

Note that this doesn't give anyone the ability to see the spy, that is a seperate Promotion and entry.
 
Thanks for pointing me in the right direction. Really, it's much appreciated. :D

Edit: It is CIV5UnitPromotions.xml not Civ5PromotionsInfos.xml if anyone is looking to do the same thing.
 
Also should I create a new class for this? I looked at the subs class type and its pretty much the same as the warriors just diff names. I'll try using the warriors but if it causes a prob ill try to create a new class.
 
Top Bottom