 |   |  |  |
| World Editor Help Zone Need help with Blizzard's World Editor? Ask general questions about its features and use in this forum. README! |
 |
|
04-29-2008, 11:26 PM
|
#1 (permalink)
|
User
Join Date: Aug 2006
Posts: 117
|
Objects only a certain player can see
Hi, is there any way to make a unit only visible to a certain player?
I figured one way would be to make the unit invisible, so only the player that owns it could see it, but that also makes it so the player can see through it. (I need it to be 100% opaque to a certain player, and 0% opaque to all others.)
|
|
|
04-29-2008, 11:46 PM
|
#2 (permalink)
|
¹²³ ¹²³ ¹²³ ¹²³
Join Date: Mar 2006
Posts: 666
|
Quote:
Originally Posted by LazyCoder
Hi, is there any way to make a unit only visible to a certain player?
I figured one way would be to make the unit invisible, so only the player that owns it could see it, but that also makes it so the player can see through it. (I need it to be 100% opaque to a certain player, and 0% opaque to all others.)
|
I'd like to know if this were possible. And then if this was crash free.
|
|
|
04-30-2008, 12:10 AM
|
#3 (permalink)
|
Twilight's Emissary
Join Date: Apr 2008
Posts: 51
|
It isn't possible. Now, I say this without trying it with variables, but nothing in the triggers menu says Hide Unit from Player. 
|
|
|
04-30-2008, 12:28 AM
|
#4 (permalink)
|
Half-Dragon
Join Date: Mar 2008
Posts: 678
|
Would be awesome if this was possible.
__________________
Map: Anime Brawl
Terrain: IIIIIIIIII
Triggers: IIIIIIIIII
Heroes: IIIIIIIIII
Spells/Items: IIIIIIIIII
Until Beta: IIIIIIIIII
|
|
|
04-30-2008, 01:17 AM
|
#5 (permalink)
|
¹²³ ¹²³ ¹²³ ¹²³
Join Date: Mar 2006
Posts: 666
|
The only way I can think would require disabling shared vision.
|
|
|
04-30-2008, 03:47 AM
|
#6 (permalink)
|
User
Join Date: Aug 2006
Posts: 117
|
Quote:
Originally Posted by Vegavak
The only way I can think would require disabling shared vision.
|
Ah, well unfortunately, the unit has to be in view of all the players.
I was trying to create a background that would be relative to the player's camera.
|
|
|
04-30-2008, 11:51 AM
|
#7 (permalink)
|
"A Variable"
Join Date: Dec 2007
Posts: 132
|
Quote:
Originally Posted by LazyCoder
Hi, is there any way to make a unit only visible to a certain player?
I figured one way would be to make the unit invisible, so only the player that owns it could see it, but that also makes it so the player can see through it. (I need it to be 100% opaque to a certain player, and 0% opaque to all others.)
|
Try making the unit invisible and then create a hidden tower or very very small tower that no one can see and then place Magic Sentry then set the range of Magic sentry into 9999999999999999999999...
[noinipOyMgniviGtsuJ]
|
|
|
04-30-2008, 02:01 PM
|
#8 (permalink)
|
¹²³ ¹²³ ¹²³ ¹²³
Join Date: Mar 2006
Posts: 666
|
Quote:
Originally Posted by h3k241
Try making the unit invisible and then create a hidden tower or very very small tower that no one can see and then place Magic Sentry then set the range of Magic sentry into 9999999999999999999999...
[noinipOyMgniviGtsuJ]
|
Depending on how many computers you're using, this is possible. But it would be limited by the amount of players using the invisible thing, and the truesight thing.
Basically, you'd temporarily share vision with neutral victim or extra, and have a truesight unit in the map for that neutral, with infinite sight range. Then remove shared vision when done.
The only downside of this would be that, if you have any other detection, or invisible things, it will not work as well.
|
|
|
04-30-2008, 02:23 PM
|
#9 (permalink)
|
Starcraft2 Fan
Join Date: Aug 2006
Posts: 960
|
As far as I know this is easily possible.
function HideUnitForPlayers takes force r, unit g returns nothinglocal integer s = 0 if IsPlayerInForce (GetLocalPlayer (),r ) then set s = 0 else set s = 255 endif call SetUnitVertexColor (g,255,255,255,s )endfunction
This uses the minimal (and shortest) local operations. I might have reversed the 255 and zero though. (Meaning unit will be visible when supposed to hidden and hidden when supposed to be visible.)
Try it out, it should work.
__________________
I can help you.......... Maybe......
Give Rep to those that help you!
I'm back! My computers been finished.
Last edited by wd40bomber7; 05-01-2008 at 01:06 AM..
|
|
|
04-30-2008, 03:02 PM
|
#10 (permalink)
|
Vault Dweller
Join Date: Apr 2008
Posts: 1,315
|
I'm 98% sure that this will desync the game, wd40bomber7.
__________________
"War, war never changes.."
|
|
|
04-30-2008, 10:52 PM
|
#11 (permalink)
|
¹²³ ¹²³ ¹²³ ¹²³
Join Date: Mar 2006
Posts: 666
|
Quote:
Originally Posted by wd40bomber7
As far as I know this is easily possible.
function HideUnitForPlayers takes force r, unit g, returns nothinglocal integer s = 0 if IsPlayerInForce (GetLocalPlayer (),r ) then set s = 0 else set s = 255 endif call SetUnitVertexColor (g,255,255,255,s )endfunction
This uses the minimal (and shortest) local operations. I might have reversed the 255 and zero though. (Meaning unit will be visible when supposed to hidden and hidden when supposed to be visible.)
Try it out, it should work.
|
You did reverse the 255 and zero. 0 = no color. 255 = full color.
Quote:
Originally Posted by emperor_d3st
I'm 98% sure that this will desync the game, wd40bomber7.
|
And it will desync the game and ruin multiplay. =(
|
|
|
04-30-2008, 10:57 PM
|
#12 (permalink)
|
User
Join Date: Aug 2006
Posts: 117
|
When a unit is invisible, they are compeltely invisible to all other players, but visible to the owner, but it's transparent. Is there any way to change the semi transparency value?
I'm trying to make a side scroller map (kind of like that soldiers map) but I'm trying to get a sky background into the map, and I plan on having a plane with a sky texture on it, and I'll set the position to something to do with the player's camera, but it would look a bit odd to see another players sky floating around.
|
|
|
04-30-2008, 11:09 PM
|
#13 (permalink)
|
¹²³ ¹²³ ¹²³ ¹²³
Join Date: Mar 2006
Posts: 666
|
Quote:
Originally Posted by LazyCoder
When a unit is invisible, they are compeltely invisible to all other players, but visible to the owner, but it's transparent. Is there any way to change the semi transparency value?
I'm trying to make a side scroller map (kind of like that soldiers map) but I'm trying to get a sky background into the map, and I plan on having a plane with a sky texture on it, and I'll set the position to something to do with the player's camera, but it would look a bit odd to see another players sky floating around.
|
God. You just made me want to make a Metal Slug map. Hahaha
|
|
|
04-30-2008, 11:19 PM
|
#14 (permalink)
|
Starcraft2 Fan
Join Date: Aug 2006
Posts: 960
|
This won't desynch. Why? Because it has no effect on game-play. Enemies can still see & shoot at the unit. It only effects alpha of a unit. (Meaning it still reacts the same both ways) Because I perform the same amount of operations for all players, theres no chance that will desychn either.
I'll test it within 2 hours.
__________________
I can help you.......... Maybe......
Give Rep to those that help you!
I'm back! My computers been finished.
|
|
|
04-30-2008, 11:52 PM
|
#15 (permalink)
|
¹²³ ¹²³ ¹²³ ¹²³
Join Date: Mar 2006
Posts: 666
|
Quote:
Originally Posted by wd40bomber7
This won't desynch. Why? Because it has no effect on game-play. Enemies can still see & shoot at the unit. It only effects alpha of a unit. (Meaning it still reacts the same both ways) Because I perform the same amount of operations for all players, theres no chance that will desychn either.
I'll test it within 2 hours.
|
If it doesn't desync, the only thing I'd say is it's still selectable, has a HP bar, and can be attacked.
So how are you gonna test it with multiplay?
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|  |  |  |  |   |  |
|