An alternative to hiding units locally?

jrhetf4xb

Member
Reaction score
12
OK, my idea is to hide some units that will do absolutely nothing except wander around with some attached effects. The purpose in my map is that when a Hero dies, he becomes a spirit and will be able to see other dead "effect" spirits that will move around - just plain eyecandy. Once he revives, he's back to normal with all his normal vision and such.
My question is, since hiding those "spirits" with GetLocalPlayer() would most probably cause a desync, does anyone have a solution that can achieve the same thing?
 

DioD

New Member
Reaction score
57
this is not possible.

hiding unit locally automatically desync, ever if unit cant affect game at all.
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
Add invisibility to spirits and give true sight to dead heroes? =)
 

jrhetf4xb

Member
Reaction score
12
That doesn't really work for me because I want the spirits to be in, like, another world - a "spiritual" one.
I don't want True Sight to reveal them because I'll possibly need it for enemies with Wind Walk and such.
I'll just go with another idea I guess...
 

saw792

Is known to say things. That is all.
Reaction score
280
Better idea: make spirits units using vex's dummy model, attach special effects to all wandering spirits when a hero dies, locally. You'd need a separate effect for each player if you don't want to waste resources destroying them periodically. Example:
JASS:
function onHeroDeath takes nothing returns nothing
   set TEMP_EFFECT = EFFECT_PATH //Global string var, global constant
    if GetLocalPlayer() != GetOwningPlayer(deadhero) then
        set TEMP_EFFECT = ""
    endif
    //call ForGroup(...)
    set deadEffects[GetPlayerId(GetOwningPlayer(deadhero))] = AddSpecialEffectTarget(TEMP_EFFECT, ...)
endfunction

function onHeroRevive takes nothing returns nothing
    call DestroyEffect(deadEffects[GetPlayerId(GetOwningPlayer(revivedhero))]
endfunction


The [ljass]ForGroup[/ljass] is commented as you would have more than one spirit.You would need a separate effect for each player, for each wandering spirit. A struct is the natural solution.
 

jrhetf4xb

Member
Reaction score
12
I was thinking that as well - attach a unit model to Vex's dummy (or I misunderstood your idea?)... But would the unit play properly it's animations when moving and such?
 

saw792

Is known to say things. That is all.
Reaction score
280
Oh so your effect would be an actual unit model. Right. The animations wouldn't work properly, unfortunately, but they should be able to drift around alright... Otherwise just locally changing the transparency of the (locusted) unit should be ten times simpler.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top