• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Specialeffect only show for one Team

Status
Not open for further replies.
Level 14
Joined
Jan 24, 2017
Messages
280
I have spells on which I want to put a special effect on for each team. It should be green to show that the spell is from your team and red to show that it is from your opponent team. How can I display it for only one team? Do I need localplayer for that?

Thanks Zia
 
Yes, you'll need localplayer. The key to making this work is that Warcraft will desync if a special effect exists for only some of the players... but that special effect is actually rendered based on its filepath, and that can be different for different players without causing a desync.

So, first step: get the string for the green effect's filepath, and the string for the red effect's filepath. Save them as separate variables, then make a third variable for the effect's filepath.

Next step: When the trigger that goes with the spell is fired, use localplayer to figure out if an ally or an enemy is casting. If it's an ally, set that third variable equal to the first one (for the green effect,) otherwise set the third variable to the second one (for the red effect.)

Last step: When you get to the part of the trigger where you actually create the special effect, use that third variable for the effect's filepath.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,011
  • Something
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Awesome Spell
    • Actions
      • Set SFX_Model = <Empty String>
      • Custom script: if IsPlayerAlly(GetLocalPlayer(), Player(0)) then
      • Set SFX_Model = Abilities\Spells\Undead\AntiMagicShell\AntiMagicShell.mdl
      • Custom script: else
      • Set SFX_Model = Abilities\Spells\Undead\Curse\CurseTarget.mdl
      • Custom script: endif
      • Set Point = (Center of (Playable map area))
      • Special Effect - Create a special effect at Point using SFX_Model
      • Custom script: call RemoveLocation(udg_Point)
Should look something like this
 
Status
Not open for further replies.
Top