• 🏆 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!

Can you stop blink on upper level?

Status
Not open for further replies.
Level 21
Joined
Mar 27, 2012
Messages
3,232
It is true that you can't detect the height of terrain in GUI, but you can through JASS(custom text).
I'll make a short example.
EDIT: Try this attached map. Keep in mind that this works by checking height directly, so it can make mistakes on curved ground(raise/lower tools).
  • Blink Down
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (==) (Order(blink))
    • Actions
      • Set TempRealA = 0.00
      • Set TempRealB = 0.00
      • Set TempPointA = (Position of (Triggering unit))
      • Custom script: set udg_TempRealA = GetLocationZ(udg_TempPointA)
      • Custom script: call RemoveLocation(udg_TempPointA)
      • Set TempPointA = (Target point of issued order)
      • Custom script: set udg_TempRealB = GetLocationZ(udg_TempPointA)
      • Custom script: call RemoveLocation(udg_TempPointA)
      • Game - Display to (All players) the text: (String(TempRealA))
      • Game - Display to (All players) the text: (String(TempRealB))
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (TempRealB - TempRealA) Greater than or equal to (>=) 90.00
          • Then - Actions
            • Set TempPointA = (Position of (Triggering unit))
            • Unit - Order (Triggering unit) to Move To TempPointA
            • Custom script: call RemoveLocation(udg_TempPointA)
            • Game - Display to (All players) the text: Noooooooo
          • Else - Actions
 

Attachments

  • BlinkDown.w3x
    17.2 KB · Views: 48
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can actually check the level of the cliff.
This means that you can make the difference between a cliff and increased terrain height.

When a unit starts the effect of blink and the terrain cliff level of target is higher than the cliff level of location of caster, issue the caster to stop.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
JASS is the code in which triggers are made.
You can recognize it from everywhere.
JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

GUI is the Graphical User Interface, which we use as the GUI version of JASS... aka triggers:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Use melee time of day (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Remove creeps and critters from used start locations (for all players)
      • Melee Game - Create starting units (for all players)
      • Melee Game - Run melee AI scripts (for computer players)
      • Melee Game - Enforce victory/defeat conditions (for all players)
 
Last edited:
Level 11
Joined
Jan 23, 2015
Messages
788
i've found out something :D
actually you can detect if the casting point is on an upper cliff terrain, see this
BWoVvhx.png


ty wietlol, i've finally figured it out xD
 
So

Unit begins casting an ability

Ability being casted equal to blink

set Casterpoint = terrain cliff level of position of caster
set CastingPoint = terrain cliff level of target point of ability being cast
If casterpoint not equal to castingpoint then
order unit to stop


thank you guys!
 
Status
Not open for further replies.
Top