Terrian Check

xmkiller

New Member
Reaction score
6
On my map I found a problem with people being able to blink onto cliffs. I am trying to resolve this by doing terrain checks with all blink abilities. This is what I have but does not work.

Code:
Terrian
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Shadow Step 
    Actions
        Set terrianPoint[0] = (Target point of ability being cast)
        Set terrianPoint[1] = (Position of (Casting unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Terrain type at terrainCheck[0]) Equal to Icecrown Glacier - Snow Cliff
            Then - Actions
                Unit - Move (Casting unit) instantly to terrainCheck[1]
            Else - Actions
        Custom script:   call RemoveLocation (udg_terrianPoint[0])
        Custom script:   call RemoveLocation (udg_terrianPoint[1])

Any help is appreciated. Thanks.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
You can try and create regions at those places where you don't want them to blink, and then event: unit enter region Actions : Move triggering unit somewhere.
 

emilemil1

New Member
Reaction score
20
:D there is a pretty simple solution to that, (sry no we)

Event: a unit begins casting a ability

Condition: ability beeing cast equal to blink

Action: Set Temp_Point = position of casting unit
Set Temp_Point2 = position of target point of ability beeing cast

then u make a If Then Else check for the cliff levels :) if they are different the targeted position is on higher or lower ground, this is however not a good solution if u want to use ramps
 

xmkiller

New Member
Reaction score
6
You can try and create regions at those places where you don't want them to blink, and then event: unit enter region Actions : Move triggering unit somewhere.

That would take 1000s of regions, it just isn't worth it to be honest. I would rather take out all the blink abilities.


:D there is a pretty simple solution to that, (sry no we)

Event: a unit begins casting a ability

Condition: ability beeing cast equal to blink

Action: Set Temp_Point = position of casting unit
Set Temp_Point2 = position of target point of ability beeing cast

then u make a If Then Else check for the cliff levels :) if they are different the targeted position is on higher or lower ground, this is however not a good solution if u want to use ramps

Isn't this exactly what my code is? How come it doesn't work?
 

emilemil1

New Member
Reaction score
20
you are checking for terrain type, its a difference

and for your trigger,

you are setting the variable terrianPoint[0] and [1]

but when you are making the check you are using terrainCheck [0] and [1]

that will make it very hard for the spell to check xD

also i recommend to change the event to Unit begins casting an ability and changing the cast time to like 0.05
 

xmkiller

New Member
Reaction score
6
Hmm, alright, I will try using height check or whatever it is, if I can find it. I don't understand how it will make it very hard for the spell to check it. I just use this method so I don't have a large clutter of variables.

I would be using local variables but I do not trust my self with JASS yet haha, I make to many errors so it is not worth my time.

Edit: Would a cliff value 0 be normal plains and 1 would be 1 level higher up?
 

emilemil1

New Member
Reaction score
20
the default level of a map is 2, i usually compare the 2 temp points heights to see if there is a difference

and there were nothing bad with your trigger, but u are using the wrong variables, i will make it as clear as a i can:

Set terrianPoint[0] = (Target point of ability being cast) <---correct
Set terrianPoint[1] = (Position of (Casting unit)) <---correct
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at terrainCheck[0]) Equal to Icecrown Glacier - Snow Cliff <---WRONGWRONGWRONG
Then - Actions
Unit - Move (Casting unit) instantly to terrainCheck[1] <---WRONGWRONGWRONG
Else - Actions
Custom script: call RemoveLocation (udg_terrianPoint[0]) <---correct
Custom script: call RemoveLocation (udg_terrianPoint[1]) <---correct

u are using a undefined variable (terrainCheck) instead of the one you set (terrianPoint)

do you get the problem now or do i have to draw a picture?
 

xmkiller

New Member
Reaction score
6
OHHHHHHHHHHHHHHHHHHHHHHH wow, I cant believe I didn't see that. Sorry man haha. Thanks

+rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top