• 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] Enviromental damage(aka:lava)

Status
Not open for further replies.
Level 1
Joined
Jul 14, 2009
Messages
4
Ello, I'm trying to make a lava damage effect along with a fiery special effect. Like you step in said region and you take damage and once you step out it will stop the damage. So far with the two ways I've tried I've managed to either make it where the special won't get off the unit. The 2nd way I tried and the damage won't stop until the unit is dead. :sad: help me plz
 
There are two ways of doing so.

a) Either add a unit, owned by Neutral Hostile in the center of the region and add a permanent immolation with area of effect equal to the dimensions of your region
b) or make these triggers:
  • Trigger1
  • Events
    • Unit - A unit enters (Your region)
  • Conditions
    • ((Triggering unit) is in LavaGroup) Equal to False
  • Actions
    • Unit Group - Add (Triggering unit) in LavaGroup
  • Trigger2
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • ((LavaGroup) is empty) Equal to True
      • Then - Actions
        • Trigger - Turn off (This Trigger)
      • Else - Actions
        • Unit Group - Pick every unit in (LavaGroup) and do (Actions)
          • Loop - Actions
            • Trigger - Turn off (This trigger)
            • Unit - Cause (Picked unit) to damage (Picked unit) dealing X damage of Attack type Spells and Damage Type Normal
            • Trigger - Turn on (This trigger)
  • Trigger3
  • Events
    • Unit - A unit leaves (Your Region)
  • Conditions
    • ((Triggering unit) is in LavaGroup) Equal to True
  • Actions
    • Unit Group - Remove (Triggering unit) from (LavaGroup)
 
Level 8
Joined
Mar 12, 2008
Messages
437
  • Events
    • Time - Every A seconds
  • Actions
    • Custom script: set_bjWantDestroyGroup = true
    • Unit Group - Pick every unit in (Playable map area) and do (Actions)
      • Set P = (Position of (Picked unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at P) Equal to Dungeon - Lava
        • Then - Actions
          • Unit - Cause U to damage (Picked unit) dealing B damage of attack type Spells and damage type Normal
        • Else - Actions
A and B are constants.
For X damage per second, B is equal to AX. (Example, if you want X = 10 damage per second, and the trigger runs A = every 0.5 second, then B should be A*X = 0.5*10 damage = 5 damage.
U is the unit that should get the kill if the unit gets killed by the lava. If you don't want anyone to have it, make a dummy unit for neutral passive.
CHange the attack and damage type spells to whatever you want. Currently, spell-immune won't be damaged. If you want them to, change damage type Normal to Universal.
Change 'Dungeon - Lava' to whatever terrain type you're using as lava.

Edit: Crap, Dr Boom was faster than I :(
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

LOL I delete it because I thought ( because I can't fully understand it out of the text ) that he use Terrain ^^

But anyway I need to fix your trigger ;)


  • Lava damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Terrain type at (Position of (Matching unit))) Equal to Dungeon - Lava)) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Picked unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • ...
  • Else - Actions
    • Unit Group - Pick every unit in (LavaGroup) and do (Actions)
      • Loop - Actions
        • Trigger - Turn off (This trigger)
        • Unit - Cause (Picked unit) to damage (Picked unit) dealing X damage of Attack type Spells and Damage Type Normal
        • Trigger - Turn on (This trigger)

I'm just asking out of interest, why do you turn on/off this trigger here?

  • Lava damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Terrain type at (Position of (Matching unit))) Equal to Dungeon - Lava)) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Picked unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)

Pharaoh's way is more efficient, since it only picks units that are added to the group :)
 
Level 8
Joined
Mar 12, 2008
Messages
437
Seas =)

LOL I delete it because I thought ( because I can't fully understand it out of the text ) that he use Terrain ^^

But anyway I need to fix your trigger ;)


  • Lava damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Terrain type at (Position of (Matching unit))) Equal to Dungeon - Lava)) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Picked unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)

No, that leaks a location for every unit every second, which will slow the game down. Other than that, you just added an effect and replaced the constants/variables.

Maker: I'm unsure whether I can agree with that Pharaoh's version would be more effective since you have to create regions for the lava.

Edit: Just noticed that my own trigger had a leak, here's a corrected version.
  • Events
    • Time - Every A seconds
  • Actions
    • Custom script: set_bjWantDestroyGroup = true
    • Unit Group - Pick every unit in (Playable map area) and do (Actions)
      • Set P = (Position of (Picked unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at P) Equal to Dungeon - Lava
        • Then - Actions
          • Unit - Cause U to damage (Picked unit) dealing B damage of attack type Spells and damage type Normal
        • Else - Actions
      • Custom script: call RemoveLocation(udg_P)
A and B are constants.
For X damage per second, B is equal to AX. (Example, if you want X = 10 damage per second, and the trigger runs A = every 0.5 second, then B should be A*X = 0.5*10 damage = 5 damage.
U is the unit that should get the kill if the unit gets killed by the lava. If you don't want anyone to have it, make a dummy unit for neutral passive.
CHange the attack and damage type spells to whatever you want. Currently, spell-immune won't be damaged. If you want them to, change damage type Normal to Universal.
Change 'Dungeon - Lava' to whatever terrain type you're using as lava.
 
Level 8
Joined
Mar 12, 2008
Messages
437
^You pick every unit in the map every second, you don't even turn your trigger on/off so it picks them every second no matter what. PhArao's trigger is more efficient :)

Depends. In Escape-like maps it can be very frustrating to make one region for every place you want to damage the unit, it all depends on the kind of map. How would you suggest that I turn the map on or off, by the way?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
It seems we're talking about different things.

I'm talking about how much the triggers strain your computer's resources. Your talking about how much time/effort it takes for the map maker to create the map :)

Your way may be simpler and efficient enough if there are not that many units in the map. Pharaoh's way is still more efficient for the computer to execute :)
 
Status
Not open for further replies.
Top