In this tutorial I will show you how to make lava/water raise and lower using triggers. This will also include a trigger to kill the units in the lava/water when it is raised.
I have attempted to emulate the lava effects from the single player mission "The Devils Playground"
Step 1: Creation
Create your map and terrain. In this tutorial I will be using the Redstone texture set with a base height of 10.
Step 2: Adding Water
Add Lava/Water to ever part of your map you want to be covered when it raises. I just covered the entire map with lava because its a small map.
Step 3: Modifying Water Height
Select your water set you have been using and click on 'edit water'.
In the new window right-click in the white window area and select Add Water State.
Now you should have two water states, Default and Alternative Setting. The default is going to be the normal height and the Alternative Setting is going to be the higher one.
Edit the Heights of both water states to what works best for your map. Since my base height of the map is 10, I used a height of 8.5 for the default and 10.5 for the alternative.
Step 4: Lighting
When the lava rises we want the lighting to change also because it seems more realistic.
Open the Lighting window by selecting Window -> Lighting or pressing Ctrl+Shift+F10.
Next, create a new light set by right-clicking on the right side and selecting 'New Light Set'. Name the new light set Lava or something easy, click on 'suggest' to help the editor understand your new name, and also under field values, Copy From: select the texture set you are using. I copied Redstone because my texture set is Redstone.
Click OK.
Now edit the light to your liking. I changed the color to a shade of red (R:154, G:17, B:59), increased the Specular Multiplier to 6.0 and the Emissive Multiplier to 2.85.
When you satisfied with your light close the lighting window.
Step 5: Triggers
Variables
Delete the Melee Initiation trigger. Create a Timer variable called 'Raise Lava', another Timer variable called 'Lower Lave', a Timer Window variable called 'Lava Timer Window', and a Boolean variable called 'Lava Death?'.
Initialization Trigger
Create a new trigger with the event Map Initialization. Now we to set up the timer and show the timer window.
Events
Game - Map initialization
Local Variables
Conditions
Actions
Timer - Start Raise Lava Timer as a One Shot timer that will expire in 20.0 Game Time seconds
Variable - Set Raise Lava Timer = (Last started timer)
Timer - Create a timer window for (Last started timer), with the title "Lava will raise in: ", using Remaining time (initially Visible)
Variable - Set Lava Timer Window = (Last created timer window)
Timer - Show (Last created timer window) for (All players)
Variable - Set Lava Death? = false
I also added a point to the map so the player's camera would start in the middle and also revealed the entire map for all players.
Camera - Pan the camera for player 1 to (Point 001 offset by (0.0, 0.0)) over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Visibility - Create a visibility revealer for player 1 within (Playable map area)
Raise Lava Trigger
This trigger will raise the lava level, play a sound, display a msg, change the lighting, and start the timer to lower the lava level.
Create a Trigger named 'Raise Lava' with a Timer expires Event; .
Events
Timer - Raise Lava Timer expires
Local Variables
Conditions
Actions
Timer - Destroy Lava Timer Window
Sound - Play Alert_BaseUnderAttackKlaxon for (All players) (at 100.0% volume, skip the first 0.0 seconds)
UI - Display "!!!WARNING!!! The lava is rising! ..." for (All players) to Subtitle area
Environment - Change water to Redstone, Alternate Setting over 8.0 seconds, using a Linear blend curve.
Environment - Set lighting to Lava, blending over 8.0 seconds
General - Wait 8.0 Game Time seconds
Timer - Start Lower Lava Timer as a One Shot timer that will expire in 20.0 Game Time seconds
Variable - Set Lower Lava Timer = (Last started timer)
Timer - Create a timer window for (Last started timer), with the title "Lava will lower in: ", using Remaining time (initially Visible)
Variable - Set Lava Timer Window = (Last created timer window)
Variable - Set Lava Death? = true
Lower Lava Trigger
This trigger will lower the lava back to the original height, change the lighting back to normal, play a sound, display a msg, and start the timer to raise the lava.
Create a Trigger named 'Lower Lava' with the event Timer Expires. Timer - Lower Lava Timer expires.
Events
Timer - Lower Lava Timer expires
Local Variables
Conditions
Actions
Timer - Destroy Lava Timer Window
Sound - Play Alert_BaseUnderAttackKlaxon for (All players) (at 100.0% volume, skip the first 0.0 seconds)
UI - Display "!!!WARNING!!! The lava is lowering..." for (All players) to Subtitle area
Environment - Change water to Redstone, [Default] over 8.0 seconds, using a Linear blend curve.
Environment - Set lighting to Redstone, blending over 8.0 seconds
Timer - Start Raise Lava Timer as a One Shot timer that will expire in 20.0 Game Time seconds
Variable - Set Raise Lava Timer = (Last started timer)
Timer - Create a timer window for (Last started timer), with the title "Lava will raise in: ", using Remaining time (initially Visible)
Variable - Set Lava Timer Window = (Last created timer window)
Variable - Set Lava Death? = false
Kill Units in Lava Trigger
This trigger will kill any unit that stays in the lava when it is risen.
Create a Trigger named 'Kill units in Lava' with a Periodic Event for the event.
Events
Timer - Every 0.5 seconds of Game Time
Local Variables
Conditions
Lava Death? == true
Actions
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any
Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Ground height at (Position of (Picked unit))) <= 10.5
Then
Unit - Add 1 Lava Damage to (Picked unit) from player 15 Add behavior to unit.
Else
Else
Play Warning Sound Trigger
This trigger is not needed but is really cool. When the raise lava timer is at 15 seconds, the Terran Adjutant will warn you of the incoming lava surge.
First you will need to load the single player dependencies. Just like in the single player mission.
Goto File -> Dependencies... Click on 'Add Standard' and select both Liberty Story [Champaign] and Liberty [Champaign]. Click OK and then Click OK to close the window.
Now create this trigger
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
(Remaining time of Raise Lava Timer) == 15.0
Actions
Sound - Play TTosh01Adjutant00013 for (All players) (at 100.0% volume, skip the first 0.0 seconds)
That is it! You can test it out and see the lava raise and fall! Add a few units to your map and test out the Kill Units in Lava Trigger.
You can instead make the lava rise and fall with a dialog button, when an unit enters a region/point, ect.
Hope this helps!
Will be adding screen caps and example map for reference.
dang..I was JUST about to post a tutorial about this, and I thougt I'd check too see if it had already been done. >,< you beat me too it. =] Nice detail, though, you even explained how to do the lighting.
Can I ask where some of the actions etc are though? I can find where the lava damage is? Ive found Add Behavior (Player) but cant see the lava damage :S
I also cant find the "picked unit uses flylow unnames mover" or the "ground height for picked unit".
Is there a list of these options as to where they are and what the text looks like in the triggers area so theyre easier to find?
Awesome tutorial, only one or two areas are a little vague like were you find the ((Picked unit) uses fly mover) etc thing, also at the start of the tutorial you don't state that you need to load the campaign stuff into the editor first. (Well I did anyway)
I'm sure you know how to do this but I managed to get it so that it would cycle between 3 different water states, not just the two if certain conditions are met. The way I did it was a little messy but I managed to get it to work. If you want I could get a tutorial for that up.
you could also replace the rather static damage system with a somewhat more dynamic one, which checks the current height of the lava as it rises (instead of waiting for the lava being fully risen, or not affecting units that stand on higher ground) and then damages the ground units according to how deep they are in the lava itself. Like shallow (feet in lava) dealing 2 damage, middle (waist-height) dealing 5 and deep (small units drowning) doing 10 damage, every 0.1 second. In doing so, units don't magically explode when they step with a foot into lava or barely move along it.
You could then also make the damage effects for the units (burning, in case of lava, or getting dissolved when it's acid, etc), to add nifty tidbits.
I had made a example map for the Beta Phase 1, which is hosted here.
It still loads, but the objectives and timer don't have proper texts, appearing as data links instead, but you can still look how it works and try to make something with it, i dunno :o
I'm having the same problem as KarlRhodes, some of the values mentioned in the OP's tutorial don't seem to exist in the drop down lists. The two culprits for me are "FlyLow" and "LavaDamage", and when my lava is raised it doesn't damage anything. I've tried copying these entries from the sample map into mine but I get "(Unknown)" next to them. Any ideas? I'll look at ScorpDK's method but I'm stuck otherwise.
ps. TTosh01Adjutant00013 must have been renamed too. Anyone know what it's called now?
UPDATE: (28 hours later)
I can't seem to make ScorpDK's method work either, I'm using v1.0.2 of the editor and it says "(Unknown)" next to "FireDamageHeavy" and "FireDamageMedium". When I click on these and try to find them in the list they're not there.
@DragonTM: Go
I see.
about those "FireDamages"... those are damage-effects i quickly made in the Data editor myself. Open the Effects tab, right click on the list, add a new effect and set it to Damage, then edit it's properties to the damage values you need (essentially, just change how much it hurts, and set a proper death-type if it's lava/acid/etc). Once done, they'll be in the list now.
But one thing, on the "Raise Lava Trigger", the boolean "LavaDeath?" is misplaced and should be here :
Timer - Destroy Lava Timer Window
Sound - Play Alert_BaseUnderAttackKlaxon for (All players) (at 100.0% volume, skip the first 0.0 seconds)
UI - Display "!!!WARNING!!! The lava is rising! ..." for (All players) to Subtitle area
Environment - Change water to Redstone, Alternate Setting over 8.0 seconds, using a Linear blend curve.
Environment - Set lighting to Lava, blending over 8.0 seconds
Variable - Set Lava Death? = true
General - Wait 8.0 Game Time seconds
Timer - Start Lower Lava Timer as a One Shot timer that will expire in 20.0 Game Time seconds
Variable - Set Lower Lava Timer = (Last started timer)
Timer - Create a timer window for (Last started timer), with the title "Lava will lower in: ", using Remaining time (initially Visible)
Variable - Set Lava Timer Window = (Last created timer window)
First off, this is an excellent tutorial. I have very little experience with the SC2 editor. Yet I was able to complete nearly every aspect of this tutorial. The only area where I experienced difficult was the lava damage trigger. I referred to the comments section for instructions on creating a damage effect. Where I'm experiencing problems is the height check on the selected units.
The only height check I found reads as:
(Height at (Position of (Picked unit))) <= 10.5
This height check appears to fail, as the lava damage isn't applied to the selected units. But if I remove the height check, the damage is applied to everything. So It appears the height check is where my trigger is failing.
However, I notice the tutorial condition reads:
(Ground height at (Position of (Picked unit))) <= 10.5
Are there different types of height checks (ground and non-ground)? If so, could someone please explain where to find the ground height check condition in the Trigger editor?
to find out the exact height where you want damage to be dealt, check the water/lava state window. There, you see the exact height the lava has both at the normal aswell as the lowered/heightened state. Replace the value in the trigger / variable with said number.
In case of using my version of the lava damage, you essentially just change the variables for lowered height, raised height, and time it takes to rise. The script deals with the rest to assure you that units get fried as the lava rises slowly. =D
Sorry bit of a nube at creating these kinds of effects, can you explain in more detail how you set up the Lava Damage in the effects editor? And how you got the "flylow unnames mover" to show up in the list.
to find out the exact height where you want damage to be dealt, check the water/lava state window. There, you see the exact height the lava has both at the normal aswell as the lowered/heightened state. Replace the value in the trigger / variable with said number.
In case of using my version of the lava damage, you essentially just change the variables for lowered height, raised height, and time it takes to rise. The script deals with the rest to assure you that units get fried as the lava rises slowly. =D
Is there any way to link the damage height to the current height of the water/lava?
Is there any way to link the damage height to the current height of the water/lava?
If you refer to a direct function doing that, as far as i know, sadly no, unless someone makes a custom galaxy script that can access a specific water's current height.
Instead, my own approach was to take the start and end height and save them in variables, same for the transition time, and then start calculating the current height constantly using these values in a trigger. It's not perfect, but it's working pretty okay.
In this tutorial I will show you how to make lava/water raise and lower using triggers. This will also include a trigger to kill the units in the lava/water when it is raised.
I have attempted to emulate the lava effects from the single player mission "The Devils Playground"
Step 1: Creation
Create your map and terrain. In this tutorial I will be using the Redstone texture set with a base height of 10.
Step 2: Adding Water
Add Lava/Water to ever part of your map you want to be covered when it raises. I just covered the entire map with lava because its a small map.
Step 3: Modifying Water Height
The default is going to be the normal height and the Alternative Setting is going to be the higher one.
Since my base height of the map is 10, I used a height of 8.5 for the default and 10.5 for the alternative.
Step 4: Lighting
When the lava rises we want the lighting to change also because it seems more realistic.
I copied Redstone because my texture set is Redstone.
I changed the color to a shade of red (R:154, G:17, B:59), increased the Specular Multiplier to 6.0 and the Emissive Multiplier to 2.85.
Step 5: Triggers
Variables
Delete the Melee Initiation trigger. Create a Timer variable called 'Raise Lava', another Timer variable called 'Lower Lave', a Timer Window variable called 'Lava Timer Window', and a Boolean variable called 'Lava Death?'.
Initialization Trigger
Create a new trigger with the event Map Initialization. Now we to set up the timer and show the timer window.
I also added a point to the map so the player's camera would start in the middle and also revealed the entire map for all players.
Camera - Pan the camera for player 1 to (Point 001 offset by (0.0, 0.0)) over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Visibility - Create a visibility revealer for player 1 within (Playable map area)
Raise Lava Trigger
This trigger will raise the lava level, play a sound, display a msg, change the lighting, and start the timer to lower the lava level.
Create a Trigger named 'Raise Lava' with a Timer expires Event; .
Lower Lava Trigger
This trigger will lower the lava back to the original height, change the lighting back to normal, play a sound, display a msg, and start the timer to raise the lava.
Create a Trigger named 'Lower Lava' with the event Timer Expires. Timer - Lower Lava Timer expires.
Kill Units in Lava Trigger
This trigger will kill any unit that stays in the lava when it is risen.
Create a Trigger named 'Kill units in Lava' with a Periodic Event for the event.
Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Play Warning Sound Trigger
This trigger is not needed but is really cool. When the raise lava timer is at 15 seconds, the Terran Adjutant will warn you of the incoming lava surge.
First you will need to load the single player dependencies. Just like in the single player mission.
Goto File -> Dependencies... Click on 'Add Standard' and select both Liberty Story [Champaign] and Liberty [Champaign]. Click OK and then Click OK to close the window.
Now create this trigger
That is it! You can test it out and see the lava raise and fall! Add a few units to your map and test out the Kill Units in Lava Trigger.
You can instead make the lava rise and fall with a dialog button, when an unit enters a region/point, ect.
Hope this helps!
Will be adding screen caps and example map for reference.
Lava Test Map link
dang..I was JUST about to post a tutorial about this, and I thougt I'd check too see if it had already been done. >,< you beat me too it. =] Nice detail, though, you even explained how to do the lighting.
Awesome Tutorial!
Can I ask where some of the actions etc are though? I can find where the lava damage is? Ive found Add Behavior (Player) but cant see the lava damage :S
I also cant find the "picked unit uses flylow unnames mover" or the "ground height for picked unit".
Is there a list of these options as to where they are and what the text looks like in the triggers area so theyre easier to find?
Awesome tutorial, only one or two areas are a little vague like were you find the ((Picked unit) uses fly mover) etc thing, also at the start of the tutorial you don't state that you need to load the campaign stuff into the editor first. (Well I did anyway)
I'm sure you know how to do this but I managed to get it so that it would cycle between 3 different water states, not just the two if certain conditions are met. The way I did it was a little messy but I managed to get it to work. If you want I could get a tutorial for that up.
you can have as many water/lava states as you want.
you could also replace the rather static damage system with a somewhat more dynamic one, which checks the current height of the lava as it rises (instead of waiting for the lava being fully risen, or not affecting units that stand on higher ground) and then damages the ground units according to how deep they are in the lava itself. Like shallow (feet in lava) dealing 2 damage, middle (waist-height) dealing 5 and deep (small units drowning) doing 10 damage, every 0.1 second. In doing so, units don't magically explode when they step with a foot into lava or barely move along it. You could then also make the damage effects for the units (burning, in case of lava, or getting dissolved when it's acid, etc), to add nifty tidbits.
I had made a example map for the Beta Phase 1, which is hosted here. It still loads, but the objectives and timer don't have proper texts, appearing as data links instead, but you can still look how it works and try to make something with it, i dunno :o
I'm having the same problem as KarlRhodes, some of the values mentioned in the OP's tutorial don't seem to exist in the drop down lists. The two culprits for me are "FlyLow" and "LavaDamage", and when my lava is raised it doesn't damage anything. I've tried copying these entries from the sample map into mine but I get "(Unknown)" next to them. Any ideas? I'll look at ScorpDK's method but I'm stuck otherwise.
ps. TTosh01Adjutant00013 must have been renamed too. Anyone know what it's called now?
UPDATE: (28 hours later)
I can't seem to make ScorpDK's method work either, I'm using v1.0.2 of the editor and it says "(Unknown)" next to "FireDamageHeavy" and "FireDamageMedium". When I click on these and try to find them in the list they're not there.
@DragonTM: Go I see. about those "FireDamages"... those are damage-effects i quickly made in the Data editor myself. Open the Effects tab, right click on the list, add a new effect and set it to Damage, then edit it's properties to the damage values you need (essentially, just change how much it hurts, and set a proper death-type if it's lava/acid/etc). Once done, they'll be in the list now.
Thanks! All working now. I'll be sure to give you guys credit when publishing my map, if it's ever finished. :)
Good tutorial, thanks for it !
But one thing, on the "Raise Lava Trigger", the boolean "LavaDeath?" is misplaced and should be here :
Timer - Destroy Lava Timer Window
Sound - Play Alert_BaseUnderAttackKlaxon for (All players) (at 100.0% volume, skip the first 0.0 seconds)
UI - Display "!!!WARNING!!! The lava is rising! ..." for (All players) to Subtitle area
Environment - Change water to Redstone, Alternate Setting over 8.0 seconds, using a Linear blend curve.
Environment - Set lighting to Lava, blending over 8.0 seconds
Variable - Set Lava Death? = true
General - Wait 8.0 Game Time seconds
Timer - Start Lower Lava Timer as a One Shot timer that will expire in 20.0 Game Time seconds
Variable - Set Lower Lava Timer = (Last started timer)
Timer - Create a timer window for (Last started timer), with the title "Lava will lower in: ", using Remaining time (initially Visible)
Variable - Set Lava Timer Window = (Last created timer window)
Because lava should deals damage while rising ;)
First off, this is an excellent tutorial. I have very little experience with the SC2 editor. Yet I was able to complete nearly every aspect of this tutorial. The only area where I experienced difficult was the lava damage trigger. I referred to the comments section for instructions on creating a damage effect. Where I'm experiencing problems is the height check on the selected units.
The only height check I found reads as: (Height at (Position of (Picked unit))) <= 10.5
This height check appears to fail, as the lava damage isn't applied to the selected units. But if I remove the height check, the damage is applied to everything. So It appears the height check is where my trigger is failing.
However, I notice the tutorial condition reads: (Ground height at (Position of (Picked unit))) <= 10.5
Are there different types of height checks (ground and non-ground)? If so, could someone please explain where to find the ground height check condition in the Trigger editor?
Thanks in advance for your help.
to find out the exact height where you want damage to be dealt, check the water/lava state window. There, you see the exact height the lava has both at the normal aswell as the lowered/heightened state. Replace the value in the trigger / variable with said number.
In case of using my version of the lava damage, you essentially just change the variables for lowered height, raised height, and time it takes to rise. The script deals with the rest to assure you that units get fried as the lava rises slowly. =D
Sorry bit of a nube at creating these kinds of effects, can you explain in more detail how you set up the Lava Damage in the effects editor? And how you got the "flylow unnames mover" to show up in the list.
Would be a HUGE help
Is there any way to link the damage height to the current height of the water/lava?
If you refer to a direct function doing that, as far as i know, sadly no, unless someone makes a custom galaxy script that can access a specific water's current height.
Instead, my own approach was to take the start and end height and save them in variables, same for the transition time, and then start calculating the current height constantly using these values in a trigger. It's not perfect, but it's working pretty okay.
I looked all through and I simply cannot find this line
((Picked unit) uses FlyLow (Unnamed) mover) == false
I only have Fly. but no FlyLow unnamed. am i missing something? was it removed or what?
HA! duh. >.> problem solved.