1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

terrain deforming ability

Discussion in 'World Editor Help Zone' started by Aslit, Feb 9, 2010.

  1. Aslit

    Aslit

    Joined:
    Jan 20, 2010
    Messages:
    332
    Resources:
    0
    Resources:
    0
    how can i make, for example, flamestrike to sink the terrain for a few secs, and make it unpasable for that period of time?
     
  2. ronojales

    ronojales

    Joined:
    Jan 8, 2010
    Messages:
    462
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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. :)
     
  3. Aslit

    Aslit

    Joined:
    Jan 20, 2010
    Messages:
    332
    Resources:
    0
    Resources:
    0
    tnks, but im having problems with vars, and custom script launch error D:
     
  4. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Press CTRL+B (or the variable icon) to open the variable editor. Be sure to create the variables like this:
    View attachment 75193

    And be sure that you copied the custom script just as it is. Without any mistakes in capitalization since JASS is case sensitive. =D
     
    Last edited: Mar 6, 2010
  5. Aslit

    Aslit

    Joined:
    Jan 20, 2010
    Messages:
    332
    Resources:
    0
    Resources:
    0
    the obstacle is too smal, i try to scale it but no changes D:
    and how can i change the parameters when i train the ability
    tnks
     
  6. ronojales

    ronojales

    Joined:
    Jan 8, 2010
    Messages:
    462
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
     
  7. Aslit

    Aslit

    Joined:
    Jan 20, 2010
    Messages:
    332
    Resources:
    0
    Resources:
    0
    the thing is that when i create more than 1 bloquet only one is eliminated, think that is cuz (last created destructible) stuff
     
  8. ronojales

    ronojales

    Joined:
    Jan 8, 2010
    Messages:
    462
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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)]
     
  9. Aslit

    Aslit

    Joined:
    Jan 20, 2010
    Messages:
    332
    Resources:
    0
    Resources:
    0
    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
     
  10. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    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?
     
  11. ronojales

    ronojales

    Joined:
    Jan 8, 2010
    Messages:
    462
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  12. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    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.
     
  13. Aslit

    Aslit

    Joined:
    Jan 20, 2010
    Messages:
    332
    Resources:
    0
    Resources:
    0
    the thing is that the map is kinda a maze, too many areas :razz:
     
  14. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    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).