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

[Solved] Just am very simple region trigger ^^

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,240

  • Init Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local region r
      • -------- ---------------------------------------------- --------
      • Hashtable - Create a hashtable
      • Set RectHash = (Last created hashtable)
      • -------- ---------------------------------------------- --------
      • Set Trig = Enter Copy <gen>
      • -------- ---------------------------------------------- --------
      • Set RectEnter[0] = Region 003 <gen>
      • Set RectEnter[1] = Region 003 Copy <gen>
      • Set RectEnter[2] = Region 003 Copy 2 <gen>
      • -------- ---------------------------------------------- --------
      • For each (Integer A) from 0 to 2, do (Actions)
        • Loop - Actions
          • Custom script: set r = CreateRegion()
          • Custom script: call RegionAddRect(r, udg_RectEnter[bj_forLoopAIndex])
          • Custom script: call TriggerRegisterEnterRegion(udg_Trig, r, null)
          • Custom script: call SaveRectHandle(udg_RectHash , GetHandleId(r), 0, udg_RectEnter[bj_forLoopAIndex] )
      • -------- ---------------------------------------------- --------
      • Custom script: set r = null
  • Enter Copy
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_Rect = LoadRectHandle(udg_RectHash , GetHandleId(GetTriggeringRegion()) , 0)
      • -------- ---- These do not give stop order ---- --------
      • Custom script: call SetUnitX(GetTriggerUnit(), GetRectCenterX(udg_Rect))
      • Custom script: call SetUnitY(GetTriggerUnit(), GetRectCenterY(udg_Rect))
      • -------- ---- This gives stop order ---- --------
      • Custom script: call SetUnitPosition(GetTriggerUnit(), GetRectCenterX(udg_Rect), GetRectCenterY(udg_Rect))
 

Attachments

  • Enter_Region.w3x
    17.3 KB · Views: 53
Status
Not open for further replies.
Top