HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Limiting sight of a building?

12-07-2004, 06:20 PM#1
czarspuppet
How do I make a building invisible so that allies cannot see it?

I have the building stored as a variable (unit) and am willing to edit it with triggers or directly w/ abilities. It needs to keep its shop sharing ability.

12-07-2004, 06:25 PM#2
Guest
I'm sorry, but i do not believe there is a way.
If the ally property is enabled, then they can see everything that you can, and i don't think you want to make the building invisable to the owning player as well.

Correct me if i'm wrong guys.
12-07-2004, 06:34 PM#3
iNfraNe
Quote:
Originally Posted by Ta_Potski
Correct me if i'm wrong guys.
well, there is actually a way. Using localplayer.

Checking if the localplayer is the owner of the building and then making it 100% invisble for others and 0% invisible for local player.

I tested this with 2 ppl on bnet, it didnt desync. I dont know about more ppl tho.
12-07-2004, 06:42 PM#4
Guest
Heh, i never thought of using LocalPlayer for that. Thanks Toots.
12-07-2004, 06:51 PM#5
iNfraNe
its toot, not toots :P

anyway, here is the code:
Code:
local real tReal
set tReal = 100.00
if GetOwningPlayer("your unit here") == GetLocalPlayer()) then
    set tReal = 0.00
endif
call SetUnitVertexColorBJ("your unit here", 100, 100, 100, tReal )

Your unit here should, ofcourse, hold a unit value.
12-07-2004, 08:06 PM#6
czarspuppet
Quote:
Originally Posted by toot
its toot, not toots :P

anyway, here is the code:
Code:
local real tReal
set tReal = 100.00
if GetOwningPlayer("your unit here") == GetLocalPlayer()) then
    set tReal = 0.00
endif
call SetUnitVertexColorBJ("your unit here", 100, 100, 100, tReal )

Your unit here should, ofcourse, hold a unit value.


Okay, but besides being visually invisible, will it be unselectable to those other players too? I mean, its fine if it isn't (because I can trigger-deselect)..

Edit:
What about the 'remove shared vision of unit from player' trigger? Wouldn't that work? I've tried it but have had even a larger problem.. Buildings don't work with the normal invisibility spell. Suppose I wanted an invisible "building", what values are keeping the abilities ghost or permanent invisibility from working?
12-07-2004, 08:41 PM#7
iNfraNe
no this will not make players unable 2 select. I dont know what is keeping the abilities from working.
12-07-2004, 09:12 PM#8
czarspuppet
Quote:
Originally Posted by toot
no this will not make players unable 2 select. I dont know what is keeping the abilities from working.
I've almost found a working answer to everything by sampling many abilities and properties..
12-07-2004, 09:59 PM#9
czarspuppet
Quote:
Originally Posted by czarspuppet
I've almost found a working answer to everything by sampling many abilities and properties..
Okay, I've found a 99.9% working solution using normal abilities/units/triggers. Here it is:

To make a 'building' invisible, simply remove the "is a building" under stats. Give it the ability Ghost and/or Permanent invisibility.

Now normally THAT alone would create an invisible "building" that lacks the "makes item, units trained, & upgrades offered" feilds, but still has the "items sold" and "units sold" feilds. Past that, I had to remove the comp from my Force1 so that I could set the force to "shared vision: off" (with an evasive startup "set comp and Force1 to ally eachother w/shared vision"). THEN I had to create a unitgroup of units that I wanted the allies in Force1 to have shared vision of and.. well I'm still working on that part but its not essential.

Granted, If I had explained 100% of the scenario to you guys I'm sure you could have told me all of this..

:)