| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
Revealing Invisible Units
Does anyone know how to programatically reveal an invisible unit?
Here is some pseudo code: Code:
randNum = <get the random num> if(<skill amount> >= randNum): <reveal player1Spy to player0> |
|
|
|
|
|
#2 |
|
Emperor
Join Date: Nov 2005
Posts: 1,455
|
Only functions that might affect it would be the PyPlot.changeInvisibleVisibilityCount() and PyPlot.changeVisibilityCount() functions. Although I'll admit to not being entirely sure how they function. All the other invisibility functions look like they only read.
Bh |
|
|
|
|
|
#3 |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
Yeah, that's what I thought, but I can't get those to work. I was hoping someone **cough** TGA **cough** 12monkeys **cough** would have an idea.
Thanks anyways Bhruic |
|
|
|
|
|
#4 |
|
Emperor
Join Date: Nov 2005
Posts: 1,455
|
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.
Bh |
|
|
|
|
|
#5 |
|
Deity
Join Date: Oct 2005
Location: England
Posts: 4,985
|
What invisibility are you talking about? the submarine type or the spy type?
__________________
Most zealously I seek for erudition. Much do I know, but to know all is my ambition.
-Faust |
|
|
|
|
|
#6 | |
|
iModify
Join Date: Dec 2003
Location: Sweden
Posts: 1,344
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
@Bhruic - I don't think you can grant invisibility in promotions. You can change how far a unit can see.
@Lord Olleus - Any type of invisibility spy, submarine, etc. @snarko - yeah, that's what I was planning to do but I want to keep the solution generic. |
|
|
|
|
|
#8 |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
TGA? 12monkeys?
any ideas? |
|
|
|
|
|
#9 | |
|
Big Cheese
Join Date: Mar 2002
Location: Oxford, England
Posts: 3,361
|
Quote:
Nope - never played with invisibility. The only way that might work without XML bodges is Bhruic's method... which you've tried. EDIT: Ok... a pretty far fetched idea here. Subs become visible when they pillage right? Maybe this could be exploited?
__________________
Blobble Wars - use your lovely green blobbles to defeat the evil other colours! |
|
|
|
|
|
|
#10 | |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
Quote:
EDIT: It looks like the pillage code is in the core game engine... maybe the SDK will open the invisibility or pillage functionality up. Also, Bhruics idea would work but it would break my "any unit with UNITCOMBAT_SNIPER as their unit combat can be a sniper" hopes.
__________________
Currently working on: Civ4 City Resource Stockpiling thread here On Deck: Unit Crews "With time and money anything is possible." Mod Component Library Threads: Civ 4 | Civ 5 1st Modder in training: Then | Now || 2nd Modder in training: Now Last edited by TheLopez; Apr 01, 2006 at 09:14 AM. |
|
|
|
|
|
|
#11 |
|
Prince
Join Date: Nov 2003
Location: Germany, Europe
Posts: 395
|
There is a difference between the invisibility of a sub and the invisiblity of a spy. When looking into the UnitInfos.XML you can see, that the spy is not invisible, but has the bCounterSpy flag set.
To make the spy visible you have to change that attribute. I don't now, if this is possible with API, so Bhruic's method may be the only solution. I wouldn't wait for help of the SDK.
__________________
:wq |
|
|
|
|
|
#12 | ||
|
Big Cheese
Join Date: Mar 2002
Location: Oxford, England
Posts: 3,361
|
Quote:
Quote:
The unit would have to be able to do the mission in the first place though (have moves, and something to pillage). EDIT: This doesn't work. Don't even think about it.
__________________
Blobble Wars - use your lovely green blobbles to defeat the evil other colours! Last edited by The Great Apple; Apr 01, 2006 at 10:43 AM. |
||
|
|
|
|
|
#13 |
|
Mod lister!
Join Date: Nov 2005
Location: Sweden
Posts: 1,117
|
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.
__________________
|
|
|
|
|
|
#14 | |
|
Big Cheese
Join Date: Mar 2002
Location: Oxford, England
Posts: 3,361
|
Quote:
__________________
Blobble Wars - use your lovely green blobbles to defeat the evil other colours! |
|
|
|
|
|
|
#15 |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
But the question now is how to make them temporarly visible.
|
|
|
|
|
|
#16 |
|
Prince
Join Date: Nov 2003
Location: Germany, Europe
Posts: 395
|
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.
__________________
:wq |
|
|
|
|
|
#17 | |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
Quote:
|
|
|
|
|
|
|
#18 | |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
Quote:
As promised, I am reporting back my results. It worked!!! Code:
# 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)
|
|
|
|
|
|
|
#19 |
|
Deity
Join Date: Jan 2006
Location: Oregon
Posts: 2,525
|
Hmmmm.... here's an interesting problem. using those methods reveals all units with the invisibility type on the plot.
|
|
|
|
|
|
#20 |
|
Prince
Join Date: Nov 2003
Location: Germany, Europe
Posts: 395
|
Doesn't suprise me, tbh. The method definition doesn't restrict something to a single unit. Only team and invisibility type as parameters.
I have an idea, which MAY work : - lets say you have 3 units of the same ivisibility type and you want to reveal only one of them. - first you have to determine the unit you want to reveal. - then move away (with CyUnit.setXY()) the other two to any plot (eg: x+1, y+1). - next apply the CyPlot.changeInvisibleVisibilityCount() methods - move back the two other units. I used that solution on a similar problem in my plot list enhancements. But it could be, that it will not work here, it the changeInvisibleVisibilityCount() sets a plot attribute.
__________________
:wq |
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Invisible units | karso | Civ4Col - Technical Support | 7 | May 02, 2010 11:52 PM |
| invisible units | Darkshadow1st | Civ4Col - Technical Support | 3 | Jul 22, 2009 08:15 PM |
| invisible units...? (help me!) | mipe | Civ4 - Fall from Heaven | 2 | Dec 16, 2007 04:39 AM |
| All Units are invisible | CIM | Civ4 - Technical Support | 3 | Nov 13, 2007 02:17 PM |
| Invisible Units | eric_A | Civ - Ideas & Suggestions | 10 | Mar 10, 2007 03:26 PM |