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

Earthquakes

Status
Not open for further replies.
Level 9
Joined
Aug 11, 2007
Messages
429
how can i make it so say every 5 minutes, an earthquake will appear on the map.

it will say EArthquake! then the camra will shake and whatever is in the area of the earthquake will suffer damage. It will also ping on the map. It has to be in a random spot each time.

if you could help thanks.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
With triggers, of course.

To make the trigger run each 5 seconds, you simply add a periodic event and set its value to 5 seconds.

For random point, there is a pretty thing called "random point in rect", you can create a point variable named Loc for example, and set it to "random point in map".

For earthquake, there are ripples, for example (temporary terrain deformation). You can choose the style for the ripple and set its values the way you want to.

For camera shaking, there is the "shake/sway camera" action, you can set the point and the magnitude there.

For damaging, you can just use "set unit life" action to reduce their life (if you don't want a damager).

For map pinging, there is a "ping minimap" action (if that was what you meant).

Putting all these in a trigger would look something like this:

  • Earthquake
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Loc = (Random point in (Playable map area))
      • Set Radius = 1000.00
      • Set LifeLoss = 50.00
      • Camera - Shake the camera for Player 1 (Red) with magnitude 5.00
      • Environment - Create a 4.00 second Normal ripple deformation at Loc with starting radius 1024.00, ending radius Radius, and depth 100.00, using 0.50 second ripples spaced 100.00 apart
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within Radius of Loc) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - LifeLoss)
      • Cinematic - Ping minimap for (All players) at Loc for 3.00 seconds
      • Custom script: call RemoveLocation(udg_Loc)
      • Wait 4.00 seconds
      • Camera - Stop swaying/shaking the camera for Player 1 (Red)
      • Environment - Stop (Last created terrain deformation) over 2.00 seconds

I just set the constants at the beginning so it's easier to modify. That set bj_wantDestroyGroup = true part is just for preventing leaks. Same as that call RemoveLocation(udg_Loc), just remember to add udg_ prefix.

This erthquake will last 4 seconds and the units within the range will lose 50 hp. So this is just an example, you would probably want to create a more complicated one.
 
Level 9
Joined
Aug 11, 2007
Messages
429
With triggers, of course.

To make the trigger run each 5 seconds, you simply add a periodic event and set its value to 5 seconds.

For random point, there is a pretty thing called "random point in rect", you can create a point variable named Loc for example, and set it to "random point in map".

For earthquake, there are ripples, for example (temporary terrain deformation). You can choose the style for the ripple and set its values the way you want to.

For camera shaking, there is the "shake/sway camera" action, you can set the point and the magnitude there.

For damaging, you can just use "set unit life" action to reduce their life (if you don't want a damager).

For map pinging, there is a "ping minimap" action (if that was what you meant).

Putting all these in a trigger would look something like this:

  • Earthquake
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Loc = (Random point in (Playable map area))
      • Set Radius = 1000.00
      • Set LifeLoss = 50.00
      • Camera - Shake the camera for Player 1 (Red) with magnitude 5.00
      • Environment - Create a 4.00 second Normal ripple deformation at Loc with starting radius 1024.00, ending radius Radius, and depth 100.00, using 0.50 second ripples spaced 100.00 apart
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within Radius of Loc) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - LifeLoss)
      • Cinematic - Ping minimap for (All players) at Loc for 3.00 seconds
      • Custom script: call RemoveLocation(udg_Loc)
      • Wait 4.00 seconds
      • Camera - Stop swaying/shaking the camera for Player 1 (Red)
      • Environment - Stop (Last created terrain deformation) over 2.00 seconds

I just set the constants at the beginning so it's easier to modify. That set bj_wantDestroyGroup = true part is just for preventing leaks. Same as that call RemoveLocation(udg_Loc), just remember to add udg_ prefix.

This erthquake will last 4 seconds and the units within the range will lose 50 hp. So this is just an example, you would probably want to create a more complicated one.



just one more thing, im not good with variables, so tell me how to set those up, and under wat action they are. Thanks so much.
 
Level 9
Joined
Aug 11, 2007
Messages
429
Nevermind, im pretty sure i got it, thanks!

one more thing, how can i do the same, but for a lightning bolt?

i got it to where the screen flashes white and stuff, just what do it go to so a lightning bolt spawns and instantly kills anything it touches.

EDIT: Hey, i dont like that unit in group losing health, i want to make it so they will lose health the longer they stay in the eartchquake, how do i do that?
 
Last edited by a moderator:
Level 13
Joined
Nov 22, 2006
Messages
1,260
just one more thing, im not good with variables, so tell me how to set those up, and under wat action they are.

There is a variable editor in the trigger editor, find it, I'm not giving you its coordinates :)

You should really learn how to trigger dude, there are some good tuts here

i got it to where the screen flashes white and stuff, just what do it go to so a lightning bolt spawns and instantly kills anything it touches.

For screen flashing, you can use Cinematic - Fade filter action.

For lightning effect, monsoon effect would fit quite nicely.

For killing every unit it touches (whatever you meant by that) Unit - Kill unit action is the simplest way.

Putting those in triggers would look something like this:

  • Lightning
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Loc = (Random point in (Playable map area))
      • Set Radius = 100.00
      • Special Effect - Create a special effect at Loc using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within Radius of Loc) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call RemoveLocation(udg_Loc)

Also, it would be good if you name the variables differently, or else two triggers will use the same variables, and because of the waits, they'll interfere.

Hey, i dont like that unit in group losing health, i want to make it so they will lose health the longer they stay in the eartchquake, how do i do that?

You simply put it in a loop that runs 8 times with a 0.5 second wait (so the total time would be 4 seconds) and you damage the units little by little:

  • Earthquake
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Loc = (Random point in (Playable map area))
      • Set Radius = 1000.00
      • Set LifeLoss = 50.00
      • Camera - Shake the camera for Player 1 (Red) with magnitude 5.00
      • Environment - Create a 4.00 second Normal ripple deformation at Loc with starting radius 0.00, ending radius Radius, and depth 100.00, using 0.50 second ripples spaced 100.00 apart
      • Cinematic - Ping minimap for (All players) at Loc for 3.00 seconds
      • Custom script: set bj_wantDestroyGroup = true
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units within Radius of Loc) and do (Actions)
            • Loop - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - LifeLoss)
          • Wait 0.50 seconds
      • Custom script: call RemoveLocation(udg_Loc)
      • Camera - Stop swaying/shaking the camera for Player 1 (Red)
      • Environment - Stop (Last created terrain deformation) over 2.00 seconds

Btw, I did a tiny mistake in the ripple action, I fixed it here, so you can change it (starting and ending radius).
 
Status
Not open for further replies.
Top