• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Just am very simple region trigger ^^

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

  • 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: 55
Status
Not open for further replies.
Top