User Tools

Site Tools


linking_maps_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linking_maps_tutorial [2017/07/26 16:59] justinlinking_maps_tutorial [2017/11/07 11:27] (current) justin
Line 1: Line 1:
-======Linking Maps Together======+======Linking Maps======
 ---- ----
  
-======(Work in Progress)======+This tutorial demonstrates how to link one map to another (for example, linking a dungeon entrance tile in a wilderness map to a separate dungeon mapwith the use of a simple script. Generally, a hand-written script is the quickest and most convenient approach for this common type of scenario, however this guide will cover both the [[quick script]] method and the alternate approach of creating a visual script in the [[Script Editor]].
  
-This tutorial demonstrates how to link one map to another with the use of a scriptfor example to link dungeon entrance tile in an wilderness map to a separate dungeon map. Generallya hand-written script is the quickest and most convenient approach for this type of scenario, however the guide will cover both the [[Quick Script]] method and the alternate approach of creating a visual script in the [[Script Editor]].+<WRAP center round info 100%> 
 +You can now also use the "Link with Map" shortcut available from the Map Editor's right-click menu to easily generate the necessary quick scripts. To do soselect a tile in one map, then right-click the destination tile in the other map and choose "Link with Map" from the popup menu. 
 +</WRAP>
  
 **1)** Open the destination map that you'd like to link to in the Map Editor and switch into "Edit" mode. In this example, I will be linking to a dungeon map. **1)** Open the destination map that you'd like to link to in the Map Editor and switch into "Edit" mode. In this example, I will be linking to a dungeon map.
Line 10: Line 12:
 **2)** Locate the the target tile that you want the player to be positioned on after the map has loaded (in this case, the stairs), then right-click on the tile and select "Copy (X,Y,Z) Coordinate" from the popup menu. This will copy the coordinate of the selected tile onto your system's clipboard to be used in a later step. **2)** Locate the the target tile that you want the player to be positioned on after the map has loaded (in this case, the stairs), then right-click on the tile and select "Copy (X,Y,Z) Coordinate" from the popup menu. This will copy the coordinate of the selected tile onto your system's clipboard to be used in a later step.
  
-**3)** Open the map you will be linking from (the wilderness map) in the Map Editor and locate the tile that should trigger the destination map to be loaded when the player steps onto it. Using our example, this would be the dungeon entrance tile. Right-click on this tile and select "Properties" from the popup menu.+{{:wiki:link_map_tut_01.png?nolink|}}
  
 +**3)** At this point, we are going to create the script that will link the wilderness map to the dungeon map. I'd recommend learning how to write small scripts like this by hand, but you can skip ahead to step 9 if you'd prefer to only see the visual script approach. Otherwise, continue to the next step.
  
 +**4)** Open the map you will be linking from (the wilderness map) in the [[Map Editor]] and locate the tile that should trigger the destination map to be loaded when the player steps onto it. Using our example, this would be the dungeon entrance tile. Right-click on this tile and select "Properties" from the popup menu.
  
-Select Quick Script from the Script dropdown box and then click the pencil icon to start editing the Quick Script in the Quick Script Builder.+{{:wiki:link_map_tut_02.png?nolink|}}
  
 +**5)** Select "Quick Script" from the Script dropdown box, then click the pencil icon to start editing the script in the [[Quick Script Builder]].
  
 +{{:wiki:link_map_tut_03.png?nolink|}}
  
-In the palette list on the left, double-click the Load Map function to add it to the script. You will want to change the function parameters (map name, X,Y,Z coordinate, and player direction) to the desired values. For the X,Y,Z coordinate, you can highlight the default values of "0, 0, 0" and then press Ctrl+V to paste in the target coordinate that you copied earlier.+**6)** In the palette list on the left, double-click the [[Load Map]] function to add it to the script. You will want to change the function parameters (map name, XYZ [[coordinate]], and player direction) to the desired values. For the [[coordinate]], you can highlight the default value of "coord[0, 0, 0]" and press Ctrl+V to paste in the target [[coordinate]] that you copied earlier.
  
 +{{:wiki:link_map_tut_04.gif?nolink|}}
  
 +**7)** Click OK to close the [[Quick Script Builder]], then close the Properties dialog. If markers are enabled in the [[Map Editor]], you'll see a marker icon ({{:wiki:script_lightning.png?nolink|}}) appear over the selected tile indicating that there is now a [[quick script]] attached to the tile.
  
-Click OK to close the Quick Script Builder and then close the Properties window. If markers are enabled in the Map Editor, you'll see a script marker appear over the selected tile indicating that there is now a script attached to the tile.+{{:wiki:link_map_tut_05.png?nolink|}}
  
 +**8)** I will also demonstrate how to visually create the same script using the [[Script Editor]]. If you've already completed the [[quick script]] approach, you can still follow along to learn, or skip ahead to step 12 if you'd prefer.
  
 +**9)** Click the "New Resource" button ({{:wiki:new_resource.png?nolink|}}) on the [[Game Explorer]] toolbar. Select "Script" for the type, then enter a name for the script (for example, "load_dungeon") and click OK.
  
-Save the map, and then follow the same procedure to make the reverse connection (for example, linking from the dungeon back to the main starting map). The player will now be able to traverse back and forth between the two maps!+{{:wiki:link_map_tut_06.png?nolink|}} 
 + 
 +**10)** Find the [[Load Map]] item in the function list on the left and double-click it to add it to your visual script. Then click and drag from the output connector of the "Start" node to the input connector on the left side of the newly added [[Load Map]] node. Select the destination map from the dropdown box then click the "Paste Coordinate" button ({{:wiki:paste_plain.png?nolink|}}) to paste in the target [[coordinate]] that you copied earlier. You can optionally choose a direction for the player to be facing once the map is loaded. Save the script once you are finished. 
 + 
 +{{:wiki:link_map_tut_07.gif?nolink|}} 
 + 
 +**11)** Open the map you will be linking from (the wilderness map) in the [[Map Editor]] and locate the tile that should trigger the destination map to be loaded when the player steps onto it. Using our examplethis would be the dungeon entrance tile. Right-click on this tile and select "Properties" from the popup menu, then select the script that you just created from the "Script" dropdown box and close the dialog. 
 + 
 +{{:wiki:link_map_tut_08.png?nolink|}} 
 + 
 +If markers are enabled in the [[Map Editor]], you'll see a marker icon ({{:wiki:script.png?nolink|}}) appear over the selected tile indicating that there is now a script attached to the tile. 
 + 
 +{{:wiki:link_map_tut_09.png?nolink|}} 
 + 
 +**12)** Save the map, then follow the same procedure to make the reverse connection (for example, linking from the stairs in the dungeon back to the entrance in the wilderness map). The player will now be able to traverse back and forth between the two maps! 
 + 
 +{{:wiki:link_map_tut_10.gif?nolink|}}
linking_maps_tutorial.1501113576.txt.gz · Last modified: 2017/07/26 16:59 by justin