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

Portal System 1.0

This is simply a teleportation system, in which a unit enters a region and is then transported to an another point via coordinates.

  • Teleport Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local region r
      • Hashtable - Create a hashtable
      • Set TELE_HT = (Last created hashtable)
      • -------- ++++++ --------
      • -------- This is the region for entering to be transported --------
      • Set TeleportSys_EnterRect[1] = TeleRe1 <gen>
      • -------- X coordinate for the point which units are transported to --------
      • Set x[1] = -961.40
      • -------- Y coordinate for the point which units are transported to --------
      • Set y[1] = 1997.50
      • -------- ++++++ --------
      • Set TeleportSys_EnterRect[2] = TeleRe2 <gen>
      • Set x[2] = -960.80
      • Set y[2] = 1484.90
      • -------- ++++++ --------
      • Set TeleportSys_EnterRect[3] = TeleRe3 <gen>
      • Set x[3] = -965.00
      • Set y[3] = 906.70
      • -------- ++++++ --------
      • Set TELE_TRG = Teleport Go <gen>
      • -------- Looping to register the defined regions --------
      • For each (Integer TeleportSys_Int) from 1 to 10000, do (Actions)
        • Loop - Actions
          • Custom script: exitwhen udg_x[udg_TeleportSys_Int] == null
          • Custom script: set r = CreateRegion()
          • Custom script: call RegionAddRect(r, udg_TeleportSys_EnterRect[udg_TeleportSys_Int])
          • Custom script: call TriggerRegisterEnterRegion(udg_TELE_TRG, r, null)
          • Custom script: set udg_ID = GetHandleId(r)
          • Hashtable - Save TeleportSys_Int as 0 of ID in TELE_HT
          • Set TELE_LOCS[TeleportSys_Int] = (Point(x[TeleportSys_Int], y[TeleportSys_Int]))
      • Custom script: set r = null

  • Teleport Go
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_ID = LoadInteger(udg_TELE_HT, GetHandleId(GetTriggeringRegion()), 0)
      • Set TeleportSys_Unit = (Triggering unit)
      • -------- Sets the position of the unit via coordinates --------
      • Custom script: call SetUnitX(udg_TeleportSys_Unit, udg_x[udg_ID])
      • Custom script: call SetUnitY(udg_TeleportSys_Unit, udg_y[udg_ID])
      • -------- Pan the camera for Owner of Triggering Unit --------
      • -------- To the Position of Triggering Unit --------
      • Camera - Pan camera for (Owner of TeleportSys_Unit) to TELE_LOCS[ID] over 0.00 seconds
      • -------- Since the function SetUnitX or SetUnitY does not interrupt order --------
      • -------- Call Triggering unit to stop --------
      • Unit - Order TeleportSys_Unit to Stop
      • Custom script: set udg_TeleportSys_Unit = null
Thanks to rulerofiron99
Updated - Thanks to Maker


Keywords:
System, Teleport, Region, Coordinates
Contents

Teleport System (Map)

Reviews
21:12, 18th Feb 2013 Magtheridon96: This could be useful.

Moderator

M

Moderator

21:12, 18th Feb 2013
Magtheridon96: This could be useful.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Personally I would do it like this:

  • Teleport Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local region r
      • Hashtable - Create a hashtable
      • Set TELE_HT = (Last created hashtable)
      • -------- ++++++ --------
      • -------- This is the region for entering to be transported --------
      • Set TeleportSys_EnterRect[1] = TeleRe1 <gen>
      • -------- X coordinate for the point which units are transported to --------
      • Set x[1] = -961.40
      • -------- Y coordinate for the point which units are transported to --------
      • Set y[1] = 1997.50
      • -------- ++++++ --------
      • Set TeleportSys_EnterRect[2] = TeleRe2 <gen>
      • Set x[2] = -960.80
      • Set y[2] = 1484.90
      • -------- ++++++ --------
      • Set TeleportSys_EnterRect[3] = TeleRe3 <gen>
      • Set x[3] = -965.00
      • Set y[3] = 906.70
      • -------- ++++++ --------
      • Set TELE_TRG = Teleport Go <gen>
      • -------- Looping to register the defined regions --------
      • For each (Integer TeleportSys_Int) from 1 to 10000, do (Actions)
        • Loop - Actions
          • Custom script: exitwhen udg_x[udg_TeleportSys_Int] == null
          • Custom script: set r = CreateRegion()
          • Custom script: call RegionAddRect(r, udg_TeleportSys_EnterRect[udg_TeleportSys_Int])
          • Custom script: call TriggerRegisterEnterRegion(udg_TELE_TRG, r, null)
          • Custom script: set udg_ID = GetHandleId(r)
          • Hashtable - Save TeleportSys_Int as 0 of ID in TELE_HT
          • Set TELE_LOCS[TeleportSys_Int] = (Point(x[TeleportSys_Int], y[TeleportSys_Int]))
      • Custom script: set r = null
  • Teleport Go
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_ID = LoadInteger(udg_TELE_HT, GetHandleId(GetTriggeringRegion()), 0)
      • Set TeleportSys_Unit = (Triggering unit)
      • -------- Sets the position of the unit via coordinates --------
      • Custom script: call SetUnitX(udg_TeleportSys_Unit, udg_x[udg_ID])
      • Custom script: call SetUnitY(udg_TeleportSys_Unit, udg_y[udg_ID])
      • -------- Pan the camera for Owner of Triggering Unit --------
      • -------- To the Position of Triggering Unit --------
      • Camera - Pan camera for (Owner of TeleportSys_Unit) to TELE_LOCS[ID] over 0.00 seconds
      • -------- Since the function SetUnitX or SetUnitY does not interrupt order --------
      • -------- Call Triggering unit to stop --------
      • Unit - Order TeleportSys_Unit to Stop
      • Custom script: set udg_TeleportSys_Unit = null
 

Attachments

  • Teleport System.w3x
    20.3 KB · Views: 90
Top