| 08-24-2006, 03:24 PM | #1 |
I know this can be done using dummy units, move triggers, and shade's ghost, but is there any other way to make an ability only seeable by one player? This may sound stupid, but im asking becuase I thought about PSI, and wanted enemies to be like "wtf?". If you can't, no big deal i was just wondering while i had the thought in mind. |
| 08-24-2006, 03:27 PM | #2 |
You might consider... JASS:if GetLocalPlayer() == YourPlayer then call DestroyEffect(AddSpecialEffect("Some\\Effect\\Here.mdx", x, y)) endif Someone else is bound to know more. |
| 08-24-2006, 03:27 PM | #3 |
I assume you mean 'effect' instead of ability. And if so, yes. JASS:local string s = "your//effect//path.here" if GetLocalPlayer() != PlayerToSeeEffect then set s = "" endif call AddSpecialEffect(s,x,y) //or whichever one you are using, pass s as the model string parameter Edit: whee crossposting. Creating an effect (or any handle) for only one player may cause a desync, creating and immediately destroying for only one player may possibly be ok, but there is no real need since the method I posted above is safe. |
| 08-24-2006, 03:29 PM | #4 |
Hrm... That's pretty cool. I'd have to test it to see how it worked, but it looks perfectly fine. That could lead to some really cool spell ideas. :D |
| 08-24-2006, 04:40 PM | #5 |
Last posted code is safe but JASS:local string s = "your//effect//path.here" if GetLocalPlayer() != PlayerToSeeEffect then set s = "" endif call AddSpecialEffect(s,x,y) set s = "" If you will not sync strings save/load will become unsafe. |
| 08-24-2006, 07:55 PM | #6 | |
Quote:
|
| 08-24-2006, 08:01 PM | #7 |
He's saying that there are issues with saving and loading the game if the string has different values for different players. |
| 08-24-2006, 08:03 PM | #8 |
saving and loading might bug if the string would remain being different to some players EDIT: bah to slow |
| 08-25-2006, 05:39 AM | #9 |
Of course this only matters when you're sleeping later, but this is one of those places to be pedantic and safe. BTW, I expect that it doesn't matter whether you do it != (set to "") or == (set to "path") because the string numbers are assigned at compile time for literals. |
