• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

terrain deforming ability

Status
Not open for further replies.
Level 8
Joined
Jan 8, 2010
Messages
493
you can use a trigger, something like:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flame Strike
    • Actions
      • Set LocFlame = (Target point of ability being cast)
      • Environment - Create a 0.50 second Temporary crater deformation at LocFlame with radius 512.00 and depth 64.00
      • Destructible - Create a Pathing Blocker (Both) (Large) at LocFlame facing (Random angle) with scale 1.00 and variation 0
      • Set DestTemp = (Last created destructible)
      • Custom script: call RemoveLocation(udg_LocFlame)
      • Wait 1.00 seconds
      • Destructible - Remove DestTemp
of course, you can change the wait time, the number of pathing blockers and the terrain deformation. it's just a sample trigger. you can change it. :)
 
Level 8
Joined
Jan 8, 2010
Messages
493
what obstacle do you mean? the pathing blocker? you can't really change its scale. (that's why i used Large as the example). i know of two ways to increase the area covered by the pathing blocker:
1. to create more of those pathing blockers
2. to create a custom pathing, apply it on a object and create that unit instead of the Pathing Blocker at the sample trigger. (i found how to create a custom pathing on a tutorial here: Pathing - Everything About It)

what parameters do you mean? like the size of the crater depending on the level of the ability?
you can add an if-then-else before the actual deformation. something like:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flame Strike
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Flame Strike for (Triggering unit)) Equal to 1
        • Then - Actions
          • -------- Actions here --------
        • Else - Actions
 
Level 8
Joined
Jan 8, 2010
Messages
493
oh, i see. if you create more than 1 blocker you must assign each of the created blocker to a variable (one variable per one blocker). so for example you created 8 blockers with the spell trigger, then you must have 8 variables and assign each blocker to a variable, making sure you don't assign an already assigned variable. you can use arrays to make it easier when dealing with variables that have values are of the same type (commonly :p).

here's a sample action trigger. it creates 8 pathing blockers around a point (TempLoc), assigns each one to a variable array (DestructibleArray), and removes all of them afterwards.

  • Set TempLoc = (Target point of ability being cast)
  • For each (Integer A) from 0 to 7, do (Actions)
    • Loop - Actions
      • Set TempLoc2 = (TempLoc offset by 100.00 towards ((Real((Integer A))) x 45.00) degrees)
      • Destructible - Create a Pathing Blocker (Both) (Large) at TempLoc2 facing (Random angle) with scale 1.00 and variation 0
      • Set DestructibleArray[(Integer A)] = (Last created destructible)
      • Custom script: call RemoveLocation(udg_TempLoc2)
  • Custom script: call RemoveLocation(udg_TempLoc)
  • -------- Removing the destructibles --------
  • For each (Integer A) from 0 to 7, do (Actions)
    • Loop - Actions
      • Destructible - Remove DestructibleArray[(Integer A)]
 
Level 7
Joined
Oct 14, 2008
Messages
340
tnks dude, one more thing, is any way to make teleport to not go over unpasable terrain, for example 2 parts of the map separated by a cliff

Yes, a complicated code that evaluates the Z levels between the unit and the targeted position. Too tired to explain how to do such a thing, maybe somebody else would care to?
 
Level 8
Joined
Jan 8, 2010
Messages
493
hehe. i didn't understood what Maximilianx said about Z levels. X)

but you can create regions, one on the each side of the unpassable terrain, and make a trigger that checks if the Casting Unit is on one region and the Target Point of Ability Being Cast is in the opposite region, before it is cast (Event - Begins Casting An Ability), then order that Casting Unit to stop.
 
Level 7
Joined
Oct 14, 2008
Messages
340
That might work, if there's only a limited amount of these areas, but you wouldn't want to order it to stop, you should actually change the units position to where he's standing, this effectively cancels orders, triggered stops can be overridden easily.
 
Level 7
Joined
Oct 14, 2008
Messages
340
Well then, without some basic JASS knowledge it would be really hard to do what I recommended, I think. Not sure if GUI can examine Z levels actually.

Basically you would want to make a trigger for your blink spell, and whenever it is cast, create a loop that checks every say 25 units of distance between the caster and the target point, if any of these points have a Z level that is too much higher/lower than the caster's Z level, then the spell gets cancelled (move the unit to his current position).
 
Status
Not open for further replies.
Top