| 05-14-2009, 01:26 PM | #1 |
ive seen some special effects in dota that only a certain player, or a team can see the effect, and will be invisible at the rest, which im sure its not a dummy unit that is invisible, because if it is, then you can see it if you have any gem of true sight or sentry wards 1. the scroll of teleportation ability will create a special effect on where you targeted the item near the tower, enemy units cant see it, while if you are on the enemy's side, the effect is attached to the tower 2. sniper's assassinate ability creates something like a target on the head of the targeted unit, but the targeted unit and its allies cant see the effect 3. admiral's torrent creates bubbles at the target point, but enemy units cant see the bubbles, making it impossible to detect where the torrent is casted for enemy units ive searched the forums and found 2 threads about it, which has similar answers...here their answer JASS:local string s = "MDX\\effect.mdl" if not IsPlayerInForce(GetLocalPlayer(), udg_Team1) then set s = "" endif call DestroyEffect(AddSpecialEffect(s,x,y)) JASS:local string s = "MDX\\effect.mdl" if GetLocalPlayer != Player(0) then set s = "" endif call DestroyEffect(AddSpecialEffect(s,x,y)) the answers works like this, if a player is picked and the picked player is inside a force, a special effect is created at that point, if the picked player is not inside the force, then it will create no effects at all so if the picked player is inside a force, then it will create a special effect to that point, but what if an enemy is near that point, that means, the player who owns that enemy unit, can see the effect to simplify, try picking units near a point, if is unit ally, then create effect, else dont create effect, this is simply like adding buffs to allied units, which is really not invisible the answer is not that accurate, the answers aren't the best solution for creating invisible effects so my question, how did dota created such as effects that are visible for only a certain player? |
| 05-14-2009, 02:59 PM | #2 |
Your question is pretty unclear and unorganized, thus I can't get it very well. So I'll tell you to the extent of what I know. Those answers you got are the key of how to accomplish the task. It both creates an effect on the site for all players, but without a model for players that shouldn't see it. Not creating an effect for certain players will cause desync. What you should know is that each Warcraft III that is running on players' computers is independent. Their information is synchronized in some way, but they are basically independent. This means minor graphics details won't matter. GetLocalPlayer() returns the player currently running on that computer, so you have to perform checks with it whether player of this computer is eligible to see what you want to display. Additionally, invisible dummies with ability 'Aloc' will work fine; they will not show up as they cannot be targeted by detectors. However, effects are recommened whenever possible. |
| 05-14-2009, 08:55 PM | #3 | |
Quote:
Exactly how you posted above (using one of those scripts). |
| 05-18-2009, 10:58 AM | #4 |
It's okay to use timers to destroy effects created by GetLocalPlayer() 'cause you're not really interfering with game data. Now, making timers in GetLocalPlayer() is a questionable thing to do... |
| 05-18-2009, 11:48 AM | #5 |
solved! thanks |
