How would you do that? I remember trying to do it a long time ago, not finding any way. Only way I can think of to do it now is recreating the unit as another type which is exactly the same except invisible/not invisible... but having almost exact duplicates of one or several units in the XML file isn't a nice solution.Bhruic said:Hmm. I did think of a way to reveal/hide them globally, but not by player. Just make a new promotion that grants (or removes, depending how you want to do it) invisibility. Then you just toggle that under the appropriate conditions. However, I'm pretty sure that as I said, that would be globally.
Sorry, missed this one.TheLopez said:TGA? 12monkeys?
any ideas?
The Great Apple said:EDIT: Ok... a pretty far fetched idea here. Subs become visible when they pillage right? Maybe this could be exploited?
No idea.TheLopez said:Huh, I did know that about subs. I see what I can do there. Do you know if they are visible only during the pillage action or until the end of the turn?
CyUnit.NotifyEntity(MissionTypes.MISSION_PILLAGE)TheLopez said:EDIT: It looks like the pillage code is in the core game engine... maybe the SDK will open the invisibility or pillage functionality up.
You can make things invisibly grapically without too much difficulty. The AI doesn't care about the graphics though. He also wants it to be seamless so you only have to add one item to the XML.Zuul said:Was thinking about this the other day. A poor solution is to have the unit in the city it's built in, and move around a decoy others dont see (too small or something), and when the invisible unit is seen it will move from the city to the decoy.
12monkeys said:Here's an idea :
CIV4BasicInfo.XML
- add a new Invisible Type INVISBLE_SPY, similar to the already existing INVISIBLE_SUBMARINE (look for it in there)
UnitInfos.XML
- set the <bInvisible> flag of the spy to 0 -> this makes the spy visible.
- set the <Invisible> of the spy to the new Invisiblity type INVISBLE_SPY -> this makes the spy invisible again and now the above mentioned PyPlot functions should work for spies, as long as you call them with INVISIBLE_SPY
- Optional : set the <SeeInvisible> of the spy to the new Invisiblity type INVISBLE_SPY -> now spies should always be able to see other spies.
Have no time to try that, but it could work.
12monkeys said:Here's an idea :
CIV4BasicInfo.XML
- add a new Invisible Type INVISBLE_SPY, similar to the already existing INVISIBLE_SUBMARINE (look for it in there)
UnitInfos.XML
- set the <bInvisible> flag of the spy to 0 -> this makes the spy visible.
- set the <Invisible> of the spy to the new Invisiblity type INVISBLE_SPY -> this makes the spy invisible again and now the above mentioned PyPlot functions should work for spies, as long as you call them with INVISIBLE_SPY
- Optional : set the <SeeInvisible> of the spy to the new Invisiblity type INVISBLE_SPY -> now spies should always be able to see other spies.
Have no time to try that, but it could work.
# Show the hidden unit
objTargetPlot.changeInvisibleVisibilityCount(gc.getPlayer(0).getTeam(), gc.getInfoTypeForString("INVISIBLE_SNIPER"), 1)
# Hide the hidden unit
objTargetPlot.changeInvisibleVisibilityCount(gc.getPlayer(0).getTeam(), gc.getInfoTypeForString("INVISIBLE_SNIPER"), -1)