-----------------------------------
    SSP - RELEASE VERSION 1.01 
  Segmented String Pathing System
-----------------------------------

1.) Importing Triggers.

a) Before you import the triggers, make sure your World Editor is set to "Automatically Create Unknown Variables when pasting trigger data".  If you don't already know where this is, it's under FILE - PREFERENCES - GENERAL.
b) Copy over a custom unit called "Pathing Node"
c) Copy the {SSP System} category and paste it into your map.  Several things will be disabled by default, do not do anything with the triggers just yet.
d) Copy waypoints 1 to 5 into your map.  You can copy them all if you want to, but if you only do 5 you will learn faster by doing more of your own inevitable work.
e) Lay 5 Waypoint regions out in sequence, going from 1 to 5.  Notice the purple waypoint is number 5.

2.) Preparing Your Map.

a) Locate the trigger [SETUP Pathing NODES].  All the variable definitions will be disabled because at the time the triggers were copied the regions didn't exist.  This is what we want, for now.
b) Locate and DELETE the 2nd line which is called : Set REGION_WaypointNames[1] = barn.  We don't need this.
c) Enable the first 5 region definition functions so that the first 5 lines look like this: 

	Set REGION_Waypoints[1] = Waypoint 1 <gen>
	Set REGION_Waypoints[2] = Waypoint 2 <gen>
	Set REGION_Waypoints[3] = Waypoint 3 <gen>
	Set REGION_Waypoints[4] = Waypoint 4 <gen>
	Set REGION_Waypoints[5] = Waypoint 5 <gen>

d) Locate the trigger [SETUP Pathing SEGMENTS].  This trigger contains the logical roads you will create.
e) Scroll down and edit the first Mid Segment line.  It looks like this:

	Set STR_MidSegments[1] = 0510111213141516173618

f) You need to delete the values being assigned to it(But do not delete the whole thing) so it's being assigned an empty string. It should look like: 

	Set STR_MidSegments[1] = <Empty String>

	This tells the system that there are no middle segments yet.

g) Locate and find the End Segment assignments.  They are indexed by a number that starts with 50 and go up to 56.  You need to DELETE all of them EXCEPT for [50].  Furthermore, delete the values being assigned to STR_EndSegments[50] so it's being assigned an empty string.  It should look like this when you're done.

	Set STR_EndSegments[50] = <Empty String>

	There should be NO other STR_EndSegments() definitions, you should have deleted the others.  Don't worry, you'll learn how to create your own in just a sec.

h) If you didn't set STR_EndSegments[50] equal to an Empty String, you should do so, because right now you'll learn how pathing strings are defined so the game can read them.  

Remember we laid the road out going from Waypoings 1 to 5?  Also remember that 5 is the purple one?  Color really doesn't make any kind of difference to the system, but you'll see shortly it's easier if you color things the way I have it.

IMPORTANT:  Purple squares are the Waypoints of a MidSegment.  Giving it a unique color makes it easier to work with.

What you're going to do is tell the game there is a logical road going from waypoint 1 to Waypoint 5.

To do this, you put the order of your waypoints into the STR_EndSegments[50] in the order they appear on your map.  There's just one important thing to know, the PURPLE squares, or the squares that are part of the Midsegment, MUST be last.  In this case, the Purple square (part of a midsegment we're going to create) is Waypoint 5.  So thus, you enter the data going from 1 to 5.  It should look like this, notice I added a 0 in front of the numbers(I'll explain why in a sec).

	Set STR_EndSegments[50] = 0102030405

The string is read in pairs, so 01 becomes 1, 02 becomes 2, etc.  You should ONLY do this with single digit waypoint numbers.  

i) Now that you have some waypoints defined as well as a virtual road defined in the form of an End Segment, we're going to do a few things to prepare the map for your first test.

	1) Locate [SSA QUEUE CONTROLLER] Trigger and find a disabled function in it.  Enable it.
	2) Locate [SSA DATA ASSEMBLY] Trigger and find a disabled function in it (it's towards the bottom).  Enable it.
	3) Place a unit of some sort by one of the Waypoints on the map that has movement and is level 1 or higher.  It doesn't matter which waypoints you put it by.
	4) Locate [SSA GOTO POINT] Trigger and find the SSA_Units[25] function and set this to the unit you just placed.  Mine looks like: 

		Set SSA_Units[25] = Siege Engine 0001 <gen>

	5) Open the Global Variables editor and locate a variable called {TIM_TriggerTimers}.  You need to increase the array size of this variable to 7.
	6) Also in the Global Variables editor, set SSA_CityPathers and SSA_T_WalkChecker array sizes to 400.  They are both timer variables as well.
	7) In the {SSP Initialization} Trigger, make sure that everything is enabled by enabling any function that isn't.  They should enable without errors(if any are disabled)

j) GO AHEAD AND TEST THE MAP!

	1) You should be able to type in "goto x" where x is 1 to 5 and the unit you placed should find it's way to that destination.  
	2) The reason you see the numbers on the regions and the SSA algorithm's output is because in {SSP Initialization} the DEBUG is set to True by default.  Just remember you can turn this off later.

If everything worked out for you, you should advance on to the User Guide where i'll explain everything you need to know to create a virtual road network.

- -  Creator: Dalten
- -  Dalten@BlackPassage.com
- -  www.BlackPassage.com
- -  www.BlackPassage.com/forum


