• 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.

[Trigger] Footswitch - Spike of Death trigger?

Status
Not open for further replies.
Level 2
Joined
Dec 18, 2011
Messages
8
I'm KINDA new to World Editor but I do understand the basic's of it.

Anyway, back to the point. How do you make a foot switch with the spike of death coming RIGHT after the unit steps on it? (Or probably after the unit walks away there will be like spikes coming out of the footswitch to kill anyone who still is standing on the button) :ogre_haosis:
 
Level 3
Joined
Nov 16, 2011
Messages
54
Simply create Region at the switch and when a unit enter the region create dummy unit and order it to cast a spell on the entered unit. You can set the spell model to w/e you like it and do as much damage as you like. Or you can wait X seconds and pick every unit in this region and create again dummy unit and cast this spell to every unit that is still staying inside the region.
 
Level 11
Joined
Nov 15, 2007
Messages
800
Set the switch to a variable.


  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Switch = Foot Switch 0000 <gen>
Create a region over the switch. Create a trigger to kill the switch when a unit steps on it if there are no units on it already - this is accomplished by adding entering units to a group. We'll use this group again later, so use a permanent group for every switch on the map, rather than a temporary group. You might want to do a conditional check that the triggering unit is a ground unit, if your map has flying units. Killing the switch is purely cosmetic so that it will lower itself when it's stepped on.

  • Killswitch
    • Events
      • Unit - A unit enters Switch <gen>
    • Conditions
      • ((Triggering unit) is A ground unit) Equal to True
      • (Number of units in switchgroup) Equal to 0
    • Actions
      • Destructible - Kill Switch
      • Unit Group - Add (Triggering unit) to switchgroup
Now create a final trigger that does what you want it to do when the switch is deactivated (there are no longer any units standing on it). You do this by first removing a unit from the trigger group whenever they leave the area, and then checking if the group is empty. Afterwards the switch is resurrected, which is again purely cosmetic.


  • Triggerswitch
    • Events
      • Unit - A unit leaves Switch <gen>
    • Conditions
      • ((Triggering unit) is A ground unit) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from switchgroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in switchgroup) Equal to 0
        • Then - Actions
          • Set loc = (Center of Switch <gen>)
          • Set killgroup = (Units within 300.00 of loc matching (((Triggering unit) is A ground unit) Equal to True))
          • Special Effect - Create a special effect at loc using Abilities\Spells\Undead\Impale\ImpaleMissTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in killgroup and do (Unit - Kill (Picked unit))
          • Custom script: call RemoveLocation(udg_loc)
          • Custom script: call DestroyGroup(udg_killgroup)
          • Destructible - Resurrect Switch with (Max life of Switch) life and Show birth animation
        • Else - Actions
Change the range to whatever you want and you may want to use multiple instances of the special effect to cover a larger area. Remember to clean up leaks every time by storing the location to a variable and then destroying it afterwards, as well as immediately destroying the special effect (it will still play its death animation - most special effects only have one animation so they'll still play that).
 
Level 3
Joined
Nov 16, 2011
Messages
54
For the same effect use the same triggers. Note periodic triggers may cause slow downs in your game and even in game lag if used improperly!
  • Map initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set varSwitches[1] = Foot Switch 0002 <gen>
      • Set varSwitches[2] = Foot Switch 0000 <gen>
      • Set varSwitches[3] = Foot Switch 0001 <gen>
      • Set varSwitchRegions[1] = Switch 1 <gen>
      • Set varSwitchRegions[2] = Switch 2 <gen>
      • Set varSwitchRegions[3] = Switch 3 <gen>
  • Periodic switch check
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set varUnitGroup = (Units in varSwitchRegions[(Integer A)] matching (((Matching unit) is alive) Equal to (==) True))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Number of units in varUnitGroup) Greater than (>) 0
              • Then - Actions
                • Destructible - Kill varSwitches[(Integer A)]
                • Set varDamageTimer[(Integer A)] = (varDamageTimer[(Integer A)] + 1)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • varDamageTimer[(Integer A)] Equal to (==) 10
                    • Then - Actions
                      • Set varDamageTimer[(Integer A)] = 0
                      • Unit Group - Pick every unit in varUnitGroup and do (Actions)
                        • Loop - Actions
                          • Special Effect - Create a special effect attached to the origin of (Picked unit) using >YourSpecialEffectGoesHere<.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Unit - Cause (Picked unit) to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
                    • Else - Actions
              • Else - Actions
                • Set varDamageTimer[(Integer A)] = 0
                • Destructible - Resurrect varSwitches[(Integer A)] with (Max life of varSwitches[(Integer A)]) life and Show birth animation
          • Unit Group - Remove all units from varUnitGroup
 

Attachments

  • Da Switches.w3x
    14.4 KB · Views: 45
Level 2
Joined
Dec 18, 2011
Messages
8
Set the switch to a variable.


  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Switch = Foot Switch 0000 <gen>
Create a region over the switch. Create a trigger to kill the switch when a unit steps on it if there are no units on it already - this is accomplished by adding entering units to a group. We'll use this group again later, so use a permanent group for every switch on the map, rather than a temporary group. You might want to do a conditional check that the triggering unit is a ground unit, if your map has flying units. Killing the switch is purely cosmetic so that it will lower itself when it's stepped on.

  • Killswitch
    • Events
      • Unit - A unit enters Switch <gen>
    • Conditions
      • ((Triggering unit) is A ground unit) Equal to True
      • (Number of units in switchgroup) Equal to 0
    • Actions
      • Destructible - Kill Switch
      • Unit Group - Add (Triggering unit) to switchgroup
Now create a final trigger that does what you want it to do when the switch is deactivated (there are no longer any units standing on it). You do this by first removing a unit from the trigger group whenever they leave the area, and then checking if the group is empty. Afterwards the switch is resurrected, which is again purely cosmetic.


  • Triggerswitch
    • Events
      • Unit - A unit leaves Switch <gen>
    • Conditions
      • ((Triggering unit) is A ground unit) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from switchgroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in switchgroup) Equal to 0
        • Then - Actions
          • Set loc = (Center of Switch <gen>)
          • Set killgroup = (Units within 300.00 of loc matching (((Triggering unit) is A ground unit) Equal to True))
          • Special Effect - Create a special effect at loc using Abilities\Spells\Undead\Impale\ImpaleMissTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in killgroup and do (Unit - Kill (Picked unit))
          • Custom script: call RemoveLocation(udg_loc)
          • Custom script: call DestroyGroup(udg_killgroup)
          • Destructible - Resurrect Switch with (Max life of Switch) life and Show birth animation
        • Else - Actions
Change the range to whatever you want and you may want to use multiple instances of the special effect to cover a larger area. Remember to clean up leaks every time by storing the location to a variable and then destroying it afterwards, as well as immediately destroying the special effect (it will still play its death animation - most special effects only have one animation so they'll still play that).

Could you explain how you get multiple actions and conditions? Like this part over here :
(If - Conditions

Then - Actions)
 
Level 2
Joined
Dec 18, 2011
Messages
8
EDIT: Still having some issues! Need help D;

What variable type should switchgroup, loc , killgroup be???[/QUOTE]

I'm seriously lost here, help?

  • Then - Actions
  • Set loc = (Center of Switch <gen>)
  • Set killgroup = (Units within 300.00 of loc matching (((Triggering unit) is A ground unit) Equal to True))
  • Special Effect - Create a special effect at loc using Abilities\Spells\Undead\Impale\ImpaleMissTarget.mdl
  • Special Effect - Destroy (Last created special effect)
  • Unit Group - Pick every unit in killgroup and do (Unit - Kill (Picked unit))
  • Custom script: call RemoveLocation(udg_loc)
  • Custom script: call DestroyGroup(udg_killgroup)
  • Destructible - Resurrect Switch with (Max life of Switch) life and Show birth animation
  • Else - Actions
 
Last edited:
Level 11
Joined
Nov 15, 2007
Messages
800
Pick the sound you want in the Sound Editor, select "Use as sound", and then play it with a trigger. Right click the sound and make sure it's set as a 3D sound in properties so you can play it at the foot switch location.
 
Level 2
Joined
Dec 18, 2011
Messages
8
Pick the sound you want in the Sound Editor, select "Use as sound", and then play it with a trigger. Right click the sound and make sure it's set as a 3D sound in properties so you can play it at the foot switch location.

Where do i put it at? Which trigger? Init, Killswitch , Triggerswitch? Under which category? Actions? Events? Conditions?
 
Status
Not open for further replies.
Top