Local Players, Null?

MrApples

Ultra Cool Member
Reaction score
78
Code:
Tower Respawn Copy
    Events
    Conditions
    Actions
        Set TempPlayer = Player 1 (Red)
        Custom script:   if GetLocalPlayer() == udg_TempPlayer then 
        Custom script:   call PlaySoundBJ( gg_snd_ClanInvitation )
        Custom script:   endif
Since there is no Play Sound for Player action I had to do this, should I null the variable and what would I do to null it exactly if so?

Also if theres anything wrong with it that could cause lag that I should fix please tell me cause this could run often?
 

Jazradel

Helping people do more by doing less.
Reaction score
102
It plays a sound for one player and this desyncs him/her somehow. I'm not actually sure it does as I tend to stay on the safe side and listen to people who have experiance in these matters.
 

xPheRe

New Member
Reaction score
43
Try using call StartSound( gg_snd_ClanInvitation ) instead of PlaySoundBJ
I think StartSound uses no net traffic... not sure.
But PlaySoundBJ sure it uses traffic and it will cause desyncs.

Also, you don't need to nullify globals. But you must nullify local variables.
Most common types that need to be nullified are:
player, unit, destructable, force, group, trigger, timer, location, rect, sound, effect, gamecache...
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
The trigger itself will not desync however if you use it togheter with
'last played sound' it may do that. Especialy if you destroy last played sound.

It is safer to use StartSound() insteed of PlaySoundBJ(). The only difference is that PlaySoundBJ sets a varaible, and after that the varaible will be different for each player.
 

MrApples

Ultra Cool Member
Reaction score
78
Alright, ill change it to StartSound.
xPheRe said:
Also, you don't need to nullify globals. But you must nullify local variables.
Well since im using it in local I assumed it would be like the same thing.
 
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