Destructable terrain - a few questions

Status
Not open for further replies.
Level 4
Joined
Jun 3, 2010
Messages
116
I just got an idea: Destructable enviroment in WC3.
I want to start with the terrain. I know how i gotta do it. I gotta use a "create crater deformation" trigger. Three problems:
I need a event that fires when a, for example, rocket hits the ground. How?
I also need something to know WHERE the rocket hit the ground. How?
And how do i make the crater "Walkable"? I mean so that i wont be running 3 feet over the visible ground.

//Zelzahim
 
1) You will need a custom rocket to fall off the sky. The rocket will be a dummy unit. A trigger tha runs periodically to set the rocket's flying height will check if the current height of the rocket is 0 (Real comparison). If it is, then kill the rocket dummy and perform the Environmental change of deformation.

2) Don't get what you mean by "Walkable". Craters don't change the ground's pathing, they are normally "walkable", as the default ground is.
 
Level 4
Joined
Jun 3, 2010
Messages
116
Cant you change the pathing with deformation? You just walks over the crater like it wasnt there.
Do you know a tutorial on how to do 1)?

//Zelzahim
 
Level 5
Joined
Jan 4, 2007
Messages
103
Well, for bomb hits a target you can use, either the trigger you're making the spell, when you change it's height to 0 wait 1 sec and start or to use a trigger which will follow the height of the bomb, when it reaches 0 it will start. Here:
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Current flying height of (Your Bomb)) Less than or equal to 0.00
      • Then - Actions
      • Your Actions
      • Trigger - Turn off Your Trigger
      • Else - Actions
For the point of the bomb if it's a spell then use Target Area of Ability Being Cast, or if it's a point then set a Variable to that point and use it. As for the Walkable craters, well if they don't walk down to it, use animation change unit's Flying Height to -how much the crater is deep.:) Hope it helps:)
 
Level 4
Joined
Jun 3, 2010
Messages
116
Well, for bomb hits a target you can use, either the trigger you're making the spell, when you change it's height to 0 wait 1 sec and start or to use a trigger which will follow the height of the bomb, when it reaches 0 it will start. Here:
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Current flying height of (Your Bomb)) Less than or equal to 0.00
      • Then - Actions
      • Your Actions
      • Trigger - Turn off Your Trigger
      • Else - Actions
For the point of the bomb if it's a spell then use Target Area of Ability Being Cast, or if it's a point then set a Variable to that point and use it. As for the Walkable craters, well if they don't walk down to it, use animation change unit's Flying Height to -how much the crater is deep.:) Hope it helps:)

Didnt really get that. Also, i would need this on a tank, that fires directly on the target.
Isnt there a way to get coordinates of where the attack hit the ground?
Please make a map with this in to show me.

//Zelzahim
 
Level 5
Joined
Jan 4, 2007
Messages
103
Didnt really get that. Also, i would need this on a tank, that fires directly on the target.
Isnt there a way to get coordinates of where the attack hit the ground?
Please make a map with this in to show me.

//Zelzahim

If it is a spell then the point would be Targeted Point of Ability Being Cast or Position of Targeted Unit of Ability Being Cast, or if it's a normal attack, then Position of Attacked Unit. For the cooldown of the hit well, either put a random wait but it will not be correct if your target is close or calcuate the distance and add a wait depending on the distance between the Attacking Unit and the Attacked. As for what I wrote, if you're using a Custom spell that, well lets say a bomb that falls somewhere on the map, and if that bomb is a dummy, you can use it's height to calculate when it's going to hit the ground. Could make a map or paste a trigger but say for what do you need it, for a normal attack or for a spell or for a dummy? Hope it helps:)
 
Level 4
Joined
Jun 3, 2010
Messages
116
Thanks The_DooM!
That helped. And yeah, please make a map for the dummy thing. I have never used them, so ill probably learn some from it!
Gonna try the "Targeted Point of Ability Being Cast or Position of Targeted Unit of Ability Being Cast" thing tomorrow.

//Zelzahim
 
Level 4
Joined
Jun 3, 2010
Messages
116
Hmm, thats bad. I cant find a way to make it explode upon hit. It triggers once the order is given. How do i manage this?

//falafelkorv
 
Level 5
Joined
Jan 4, 2007
Messages
103
Add a wait depending on distance between the unists. It depends on how fast the missile speed is. Lets say, 600 missile speed and if the target is 800 from the caster, it will be 1.2 sec. Here:

  • Wait ((Distance between (Position of (Casting Unit)) and (Position of (Targeted Unit of Ability being cast))) / 600(missile speed)) seconds
Hope it helps:)
 
Level 4
Joined
Jun 3, 2010
Messages
116
Thanks!
Ill try it tomorrow, hope it works!
You have any idea on how to the units walk down into creater deformations?

//Zelzahim
 
Level 5
Joined
Jan 4, 2007
Messages
103
Put Athimetric then in the first put distance between Target ect and Targeted, in the second put your missile speed of your ability, let's say 600. Look at your ability in the Object Editor and see it's missile speed, then put it in instead of the 600. Here:
 

Attachments

  • wait.w3x
    16.1 KB · Views: 87
If you really want to do this you have to recode everything, meaning every ability, every missile, every attack, everything that could hit the ground.

It already wont work as the ground doesn't change in Z even if you add the terrain deformation, so unless you save the adjusted Z value of every point on the map it's impossible. Also since units can't have negative flying heights, you could only raise the ground up.
 
Status
Not open for further replies.
Top