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

Waypoint System v1.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This map shows you a simple way to create your own waypoint system for your ORPG map.
This system can be used for up to 8 players at the same time!

There are different waypoints on this map. If you enter such a waypoint a dialog appears
showing you the waypoints you've already explored. Thus, only the waypoints you've
already discovered will be displayed as buttons in the dialog. In order to add a button
to the dialog you have to walk with your hero close enough to a waypoint. If you click a
button in the dialog your hero will be teleported to the desired waypoint!

I hope this system is easy to understand:D


[trigger=]
Initialization
Ereignisse
Map initialization
Bedingungen
Aktionen
-------- assigns the areas to the respective variables --------
-------- here you need to adjust for your map! --------
Set WaypointExplore[0] = WaypointExplore0 <gen>
Set WaypointExplore[1] = WaypointExplore1 <gen>
Set WaypointExplore[2] = WaypointExplore2 <gen>
Set WaypointExplore[3] = WaypointExplore3 <gen>
Set WaypointDestination[0] = WaypointDestination0 <gen>
Set WaypointDestination[1] = WaypointDestination1 <gen>
Set WaypointDestination[2] = WaypointDestination2 <gen>
Set WaypointDestination[3] = WaypointDestination3 <gen>
-------- assigns a hero to a player --------
-------- here you need to adjust for your map! --------
Set Heroes[(Player number of Spieler 1 (Rot))] = Waypoint System Tester 0004 <gen>
Set Heroes[(Player number of Spieler 2 (Blau))] = Keine Einheit
Set Heroes[(Player number of Spieler 3 (Blaugrau))] = Keine Einheit
Set Heroes[(Player number of Spieler 4 (Lila))] = Keine Einheit
Set Heroes[(Player number of Spieler 5 (Gelb))] = Keine Einheit
Set Heroes[(Player number of Spieler 6 (Orange))] = Keine Einheit
Set Heroes[(Player number of Spieler 7 (Grün))] = Keine Einheit
Set Heroes[(Player number of Spieler 8 (Rosa))] = Keine Einheit
-------- selects the hero for player 1 --------
Auswahl - Select Heroes[(Player number of Spieler 1 (Rot))] for Spieler 1 (Rot)
-------- general information --------
Spiel - Display to (All players) for 30.00 seconds the text: ### First, you need...

[/trigger]



[trigger=]
WaypointExplore
Ereignisse
Einheit - A unit enters WaypointExplore0 <gen>
Einheit - A unit enters WaypointExplore1 <gen>
Einheit - A unit enters WaypointExplore2 <gen>
Einheit - A unit enters WaypointExplore3 <gen>
Bedingungen
((Entering unit) is Ein Held) Gleich True
Aktionen
-------- you have to adjust the WaypointExplore areas above! --------
Wait 0.50 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(WaypointExplore[0] contains (Entering unit)) Gleich True
'THEN'-Aktionen
-------- activates the option to teleport to this waypoint --------
Set WaypointExploreBool0[(Player number of (Owner of (Entering unit)))] = True
-------- makes the waypoint permanently visible --------
Sichtbarkeit - Create an initially Aktiviert visibility modifier for (Owner of (Entering unit)) emitting Sichtbarkeit across WaypointExplore[0]
-------- creates a floating text above the waypoint --------
Schwebender Text - Create floating text that reads Waypoint 0 at (Center of WaypointExplore[0]) with Z offset 150.00, using font size 8.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
'ELSE'-Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(WaypointExplore[1] contains (Entering unit)) Gleich True
'THEN'-Aktionen
-------- activates the option to teleport to this waypoint --------
Set WaypointExploreBool1[(Player number of (Owner of (Entering unit)))] = True
-------- makes the waypoint permanently visible --------
Sichtbarkeit - Create an initially Aktiviert visibility modifier for (Owner of (Entering unit)) emitting Sichtbarkeit across WaypointExplore[1]
-------- creates a floating text above the waypoint --------
Schwebender Text - Create floating text that reads Waypoint 1 at (Center of WaypointExplore[1]) with Z offset 150.00, using font size 8.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
'ELSE'-Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(WaypointExplore[2] contains (Entering unit)) Gleich True
'THEN'-Aktionen
-------- activates the option to teleport to this waypoint --------
Set WaypointExploreBool2[(Player number of (Owner of (Entering unit)))] = True
-------- makes the waypoint permanently visible --------
Sichtbarkeit - Create an initially Aktiviert visibility modifier for (Owner of (Entering unit)) emitting Sichtbarkeit across WaypointExplore[2]
-------- creates a floating text above the waypoint --------
Schwebender Text - Create floating text that reads Waypoint 2 at (Center of WaypointExplore[2]) with Z offset 150.00, using font size 8.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
'ELSE'-Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(WaypointExplore[3] contains (Entering unit)) Gleich True
'THEN'-Aktionen
-------- activates the option to teleport to this waypoint --------
Set WaypointExploreBool3[(Player number of (Owner of (Entering unit)))] = True
-------- makes the waypoint permanently visible --------
Sichtbarkeit - Create an initially Aktiviert visibility modifier for (Owner of (Entering unit)) emitting Sichtbarkeit across WaypointExplore[3]
-------- creates a floating text above the waypoint --------
Schwebender Text - Create floating text that reads Waypoint 3 at (Center of WaypointExplore[3]) with Z offset 150.00, using font size 8.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
'ELSE'-Aktionen

[/trigger]



[trigger=]
WaypointTriggers
Ereignisse
Einheit - A unit enters WaypointTrigger0 <gen>
Einheit - A unit enters WaypointTrigger1 <gen>
Einheit - A unit enters WaypointTrigger2 <gen>
Einheit - A unit enters WaypointTrigger3 <gen>
Bedingungen
((Entering unit) is Ein Held) Gleich True
Aktionen
-------- you have to adjust the WaypointExplore areas above! --------
-------- clears the dialog --------
Dialog - Clear WaypointDialog[(Player number of (Owner of (Entering unit)))]
-------- changes the title of the dialog --------
Dialog - Change the title of WaypointDialog[(Player number of (Owner of (Entering unit)))] to |cffffcc00Waypoints...
-------- dialog button for Waypoint 0 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
WaypointExploreBool0[(Player number of (Owner of (Entering unit)))] Gleich True
'THEN'-Aktionen
-------- dialog button for Waypoint 0 will only be displayed if WaypointExploreBool0 is TRUE --------
Dialog - Create a dialog button for WaypointDialog[(Player number of (Owner of (Entering unit)))] labelled |cffffcc00Waypoint ...
Set WaypointButton0[(Player number of (Owner of (Entering unit)))] = (Last created dialog Button)
'ELSE'-Aktionen
-------- dialog button for Waypoint 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
WaypointExploreBool1[(Player number of (Owner of (Entering unit)))] Gleich True
'THEN'-Aktionen
-------- dialog button for Waypoint 1 will only be displayed if WaypointExploreBool1 is TRUE --------
Dialog - Create a dialog button for WaypointDialog[(Player number of (Owner of (Entering unit)))] labelled |cffffcc00Waypoint ...
Set WaypointButton1[(Player number of (Owner of (Entering unit)))] = (Last created dialog Button)
'ELSE'-Aktionen
-------- dialog button for Waypoint 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
WaypointExploreBool2[(Player number of (Owner of (Entering unit)))] Gleich True
'THEN'-Aktionen
-------- dialog button for Waypoint 2 will only be displayed if WaypointExploreBool2 is TRUE --------
Dialog - Create a dialog button for WaypointDialog[(Player number of (Owner of (Entering unit)))] labelled |cffffcc00Waypoint ...
Set WaypointButton2[(Player number of (Owner of (Entering unit)))] = (Last created dialog Button)
'ELSE'-Aktionen
-------- dialog button for Waypoint 3 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
WaypointExploreBool3[(Player number of (Owner of (Entering unit)))] Gleich True
'THEN'-Aktionen
-------- dialog button for Waypoint 3 will only be displayed if WaypointExploreBool3 is TRUE --------
Dialog - Create a dialog button for WaypointDialog[(Player number of (Owner of (Entering unit)))] labelled |cffffcc00Waypoint ...
Set WaypointButton3[(Player number of (Owner of (Entering unit)))] = (Last created dialog Button)
'ELSE'-Aktionen
-------- cancel button --------
Dialog - Create a dialog button for WaypointDialog[(Player number of (Owner of (Entering unit)))] labelled |cffffcc00Cancel|r
-------- shows the dialog for the owner of entering unit --------
Dialog - Zeigen WaypointDialog[(Player number of (Owner of (Entering unit)))] for (Owner of (Entering unit))

[/trigger]



[trigger=]
WaypointButtonClick
Ereignisse
Dialog - A dialog button is clicked for WaypointDialog[1]
Dialog - A dialog button is clicked for WaypointDialog[2]
Dialog - A dialog button is clicked for WaypointDialog[3]
Dialog - A dialog button is clicked for WaypointDialog[4]
Dialog - A dialog button is clicked for WaypointDialog[5]
Dialog - A dialog button is clicked for WaypointDialog[6]
Dialog - A dialog button is clicked for WaypointDialog[7]
Dialog - A dialog button is clicked for WaypointDialog[8]
Bedingungen
Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Clicked dialog button) Gleich WaypointButton0[(Player number of (Triggering player))]
'THEN'-Aktionen
-------- teleports the hero to WaypointDestination0 --------
Einheit - Move Heroes[(Player number of (Triggering player))] instantly to (Center of WaypointDestination[0])
Kamera - Pan camera for (Triggering player) to (Center of WaypointDestination[0]) over 0.00 seconds
-------- creates teleport special effect on the hero --------
Spezialeffekt - Create a special effect attached to the origin of Heroes[(Player number of (Triggering player))] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
Spezialeffekt - Destroy (Last created special effect)
'ELSE'-Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Clicked dialog button) Gleich WaypointButton1[(Player number of (Triggering player))]
'THEN'-Aktionen
-------- teleports the hero to WaypointDestination1 --------
Einheit - Move Heroes[(Player number of (Triggering player))] instantly to (Center of WaypointDestination[1])
Kamera - Pan camera for (Triggering player) to (Center of WaypointDestination[1]) over 0.00 seconds
-------- creates teleport special effect on the hero --------
Spezialeffekt - Create a special effect attached to the origin of Heroes[(Player number of (Triggering player))] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
Spezialeffekt - Destroy (Last created special effect)
'ELSE'-Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Clicked dialog button) Gleich WaypointButton2[(Player number of (Triggering player))]
'THEN'-Aktionen
-------- teleports the hero to WaypointDestination2 --------
Einheit - Move Heroes[(Player number of (Triggering player))] instantly to (Center of WaypointDestination[2])
Kamera - Pan camera for (Triggering player) to (Center of WaypointDestination[2]) over 0.00 seconds
-------- creates teleport special effect on the hero --------
Spezialeffekt - Create a special effect attached to the origin of Heroes[(Player number of (Triggering player))] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
Spezialeffekt - Destroy (Last created special effect)
'ELSE'-Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Clicked dialog button) Gleich WaypointButton3[(Player number of (Triggering player))]
'THEN'-Aktionen
-------- teleports the hero to WaypointDestination3 --------
Einheit - Move Heroes[(Player number of (Triggering player))] instantly to (Center of WaypointDestination[3])
Kamera - Pan camera for (Triggering player) to (Center of WaypointDestination[3]) over 0.00 seconds
-------- creates teleport special effect on the hero --------
Spezialeffekt - Create a special effect attached to the origin of Heroes[(Player number of (Triggering player))] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
Spezialeffekt - Destroy (Last created special effect)
'ELSE'-Aktionen

[/trigger]



v1.1 (19th Apr 2012):
- WaypointExplore0-3 are merged with each other
- the system is now easier to implement
gen

Keywords:
waypoint, system, daroth, warcraft, rpg, orpg, map
Contents

Waypoint System v1.1 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Required changes Heroes controlled by non-human players can also trigger the system The system creates multiple overlapping visibility modifiers for the same player, and thus causes...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

Reviewed by Maker, Waypoint System v1.1, 17th Jul 2012

Required changes
  • Heroes controlled by non-human players can also trigger the system
  • The system creates multiple overlapping visibility modifiers for the same player,
    and thus causes leaks
  • The floating text lines cause location leaks
  • Move hero instantly lines cause location leaks
Suggested changes
  • You could make the hero not teleport when selecting a waypoint where the unit
    is at already
  • Remove unneeded variables
  • Use a loop instead of if/then/else in the Explore trigger
  • Use a loop instead of if/then/else in the Triggers trigger
 
Remove any waits.

The reason why a hashtable is preferred is to avoid repetition of if/then/elses (to check what region contains the (Triggering unit) ~ btw, use (Triggering unit) instead of (Entering unit)). Using the actions
  • Set i = i + 1
  • Set Region[i] = Explore 1 <gen>
  • call SaveInteger (udg_Hash, GetHandleId (udg_Region[udg_i]), 0, udg_i)
  • Set i = i + 1
  • Set Region[i] = Explore 2 <gen>
  • call SaveInteger (udg_Hash, GetHandleId (udg_Region[udg_i]), 0, udg_i)
  • Set i = i + 1
  • Set Region[i] = Explore 2 <gen>
  • call SaveInteger (udg_Hash, GetHandleId (udg_Region[udg_i]), 0, udg_i)
can help you retrieve the number of the way point with GetTriggeringRegion().

If a user has many way points, it will be hard for them to edit the system.

The system currently leaks. Store (Player number of (Triggering player)) in a variable, before calling it all the time in the same trigger.
 
Level 2
Joined
Aug 13, 2011
Messages
3
I have some problems with the hashtable...
If I test the triggers the WPNumber stored in the hashtable stays always '0' regardless the area I've entered!
I think the problem is, that GetTriggeringRegion() is a region in jass and the WPExplore is a region in GUI which means a rect in Jass. So I don't find a way to convert the TriggeringRegion into a rect for having a region in GUI.

I hope you can help me...



  • Initialization
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Hashtabelle - Create a hashtable
      • Set WPHashtable = (Last created hashtable)
      • Set i = 0
      • Set WPExplore[i] = WaypointExplore0 <gen>
      • Set WPExploreHandle[i] = (Center of WPExplore[i])
      • Hashtabelle - Save i as 0 of (Key WPExploreHandle[i]) in WPHashtable
      • Set i = (i + 1)
      • Set WPExplore[i] = WaypointExplore1 <gen>
      • Set WPExploreHandle[i] = (Center of WPExplore[i])
      • Hashtabelle - Save i as 0 of (Key WPExploreHandle[i]) in WPHashtable
      • Set i = (i + 1)
      • Set WPExplore[i] = WaypointExplore2 <gen>
      • Set WPExploreHandle[i] = (Center of WPExplore[i])
      • Hashtabelle - Save i as 0 of (Key WPExploreHandle[i]) in WPHashtable
      • Set i = (i + 1)
      • Set WPExplore[i] = WaypointExplore3 <gen>
      • Set WPExploreHandle[i] = (Center of WPExplore[i])
      • Hashtabelle - Save i as 0 of (Key WPExploreHandle[i]) in WPHashtable


  • WaypointExplore
    • Ereignisse
      • Einheit - A unit enters WaypointExplore0 <gen>
      • Einheit - A unit enters WaypointExplore1 <gen>
      • Einheit - A unit enters WaypointExplore2 <gen>
      • Einheit - A unit enters WaypointExplore3 <gen>
    • Bedingungen
      • ((Triggering unit) is Ein Held) Gleich True
    • Aktionen
      • -------- you have to adjust the WaypointExplore areas above! --------
      • Set WPPlayer = (Owner of (Triggering unit))
      • Set WPPlayerNumber = (Player number of (Owner of (Triggering unit)))
      • Custom script: set udg_WPExploreTemp = GetTriggeringRegion()
      • Set WPNumber = (Load 0 of (Key WPExploreTemp) from WPHashtable)
      • Sichtbarkeit - Create an initially Aktiviert visibility modifier for WPPlayer emitting Sichtbarkeit across WPExplore[WPNumber]
      • Schwebender Text - Create floating text that reads (Waypoint + (String(WPNumber))) at (Center of WPExplore[WPNumber]) with Z offset 150.00, using font size 8.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • WPNumber Gleich 0
        • 'THEN'-Aktionen
          • -------- activates the option to teleport to this waypoint --------
          • Set WPExploreBool0[WPPlayerNumber] = True
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • WPNumber Gleich 1
        • 'THEN'-Aktionen
          • -------- activates the option to teleport to this waypoint --------
          • Set WPExploreBool1[WPPlayerNumber] = True
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • WPNumber Gleich 2
        • 'THEN'-Aktionen
          • -------- activates the option to teleport to this waypoint --------
          • Set WPExploreBool2[WPPlayerNumber] = True
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • WPNumber Gleich 3
        • 'THEN'-Aktionen
          • -------- activates the option to teleport to this waypoint --------
          • Set WPExploreBool3[WPPlayerNumber] = True
        • 'ELSE'-Aktionen

 
Top