Help me make a special effect

keychup

Active Member
Reaction score
34
How do I make a special effect visible only to the allies of the caster and not to the enemies?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Using the GetLocalPlayer() function. Search around the forum, there's a bunch of tutorials on how to use it.
 

keychup

Active Member
Reaction score
34
bah. darn search tool wont let me search. so anyway where does the "show special effect for specific players" kick in?
 

keychup

Active Member
Reaction score
34
Correct me if im wrong:

Trigger:
  • Actions
    • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit() then
    • Custom script: call AddSpecialEffectTargetUnitBJ( "origin", GetEnumUnit(), "Abilities\\Spells\\Orc\\HealingWave\\HealingWaveTarget.mdl" )
    • Custom script: else
    • Custom script: endif


Edit: I see the special effect but how can i be sure others dont see it?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
There are several flaws:
Code:
set Temp_String = "Abilities\\Spells\\Orc\\HealingWave\\HealingWaveTarget.mdl"
Custom script:   if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()[COLOR="#FF0000"])[/COLOR] then
Custom script:   call AddSpecialEffectTargetUnitBJ( "origin", GetEnumUnit(), [COLOR="#FF0000"]udg_Temp_String[/COLOR] )
Custom script:   endif
You dont need the "else" if there are no actions after it (if i remember correclty...)

You forgot one ")" in the first line. Syntax errors are a bad thing.

You should set the path of the special effect outside of the if otherwise it might lead to desyncs in your game since a string has gotten a handle as well and creating something new (a handle in this case) for only one player locally will end the game abruptly.

You can also put GUI actions within the "if" and the "endif" without problems, no need to use custom script for the special effect.
 

Wratox1

Member
Reaction score
22
just test it with someone..

but it should work, i am helping a guy with his map and there im working with localplayer to show multiboards, one multiboard for each team, and it works;)
 

keychup

Active Member
Reaction score
34
Like this?
Trigger:
  • holylight Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to W - Holy Light
    • Actions
      • Set zz_pointa = (Position of (Triggering unit))
      • Set zz_unitga = (Units within 250.00 of zz_pointa)
      • Unit Group - Pick every unit in zz_unitga and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True
            • Then - Actions
              • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Custom script: endif
            • Else - Actions
      • Custom script: call DestroyGroup (udg_zz_unitga)
      • Custom script: call RemoveLocation (udg_zz_pointa)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top