• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Invisible special effect on ground?

Status
Not open for further replies.
Level 2
Joined
Apr 6, 2009
Messages
14
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?
 
Level 11
Joined
Feb 22, 2006
Messages
752
Using GetLocalPlayer() will cause a desync.

Attach the special effect to a dummy unit. The dummy unit should obviously not be selectable (i.e. give it the locust ability) and also should not have a visible model, but NEEDS to have attachment points for the effect. Give the unit a permanent invisibility ability or something and set the unit's owner to the player that is able to see the effect. Of course, any players toward which the owning player has shared vision turned on will also be able to see the effect.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Using GetLocalPlayer() will cause a desync.

Nope. The act of creating unsynchronised objects causes desyncs, but simply using GetLocalPlayer() does not desync.

so my question, how did dota created such as effects that are visible for only a certain player?

You answered your own question, didn't you? The jass script you provided does exactly what you want. So I don't really know what else to say than to use that script. Or did I misunderstood your question?

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
Actually, the effect is always created. It's also the reason why this works and doesn't cause disconnects, because the effect is always created for ALL players, even hostile ones. The big difference is that for hostile players, an "invisible" effect is created (an effect with no model), while for friendly players, the correct effect is created.
 
Status
Not open for further replies.
Top