Drakan
2008-09-11 20:43:50
Hey everyone, welcome to my tutorial on Making and Walking Paths using my D-Include which can be found here: http://code.google.com/p/reflectioninclude/
Lets go ahead and start from the beginning:
This is basically just including all of the needed files, and using the SetupSmart function.
Now navigate to ..\D-Include\Tools\PathMaker.scar. This is my PathMaking tool! Open it and press start. Let smart load, then log in and get to your starting location.
Once at the starting point, walk to a tile on the path you are going to take. Remember to not choose a tile too far away, but not too close. Once your character reaches that point at a stop, Press F2 to record the tile.
Continue doing this until you have every tile needed to make your path. Once you record your last tile, press F4. This will print out a function for your path. (function LoadPath1: TPointArray;).
Now we can insert this into your script. It should look something like this:
Once you have that done, you have to use the WalkPath function from my include. This is pretty simple:
What this will do is walk the path (LoadPath1) then return whether or not it was successful. You can add to this of course, like fail safes, or opening doors, or walking another path. Simple enough?
So your finished product would look a little something like:
Yes this isn't very graphic and super detailed, but you should be able to get through it fairly simply. Post if you have questions/comments!
Lets go ahead and start from the beginning:
program PathWalking;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
{.include D-Include\DInclude.scar}
procedure SetupSmart;
begin
SmartSetup('world109', True, True, false);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
begin
SetupSRL;
SetupSmart;
end.This is basically just including all of the needed files, and using the SetupSmart function.
Now navigate to ..\D-Include\Tools\PathMaker.scar. This is my PathMaking tool! Open it and press start. Let smart load, then log in and get to your starting location.
Once at the starting point, walk to a tile on the path you are going to take. Remember to not choose a tile too far away, but not too close. Once your character reaches that point at a stop, Press F2 to record the tile.
Continue doing this until you have every tile needed to make your path. Once you record your last tile, press F4. This will print out a function for your path. (function LoadPath1: TPointArray;).
Now we can insert this into your script. It should look something like this:
program PathWalking;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
{.include D-Include\DInclude.scar}
procedure SetupSmart;
begin
SmartSetup('world109', True, True, false);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
function LoadPath1: TPointArray;
begin
SetLength(Result, 4);
Result[0] := (Point(2665, 3348));
Result[1] := (Point(2676, 3349));
Result[2] := (Point(2686, 3355));
Result[3] := (Point(2690, 3359));
end;
begin
SetupSRL;
SetupSmart;
end.Once you have that done, you have to use the WalkPath function from my include. This is pretty simple:
function whateveryouwant: boolean;
begin
Result := WalkPath(LoadPath1);
end;What this will do is walk the path (LoadPath1) then return whether or not it was successful. You can add to this of course, like fail safes, or opening doors, or walking another path. Simple enough?
So your finished product would look a little something like:
program PathWalking;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
{.include D-Include\DInclude.scar}
procedure SetupSmart;
begin
SmartSetup('world109', True, True, false);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
function LoadPath1: TPointArray;
begin
SetLength(Result, 4);
Result[0] := (Point(2665, 3348));
Result[1] := (Point(2676, 3349));
Result[2] := (Point(2686, 3355));
Result[3] := (Point(2690, 3359));
end;
function whateveryouwant: boolean;
begin
Result := WalkPath(LoadPath1);
if Result then Writeln('Walked path!');
end;
begin
SetupSRL;
SetupSmart;
end.Yes this isn't very graphic and super detailed, but you should be able to get through it fairly simply. Post if you have questions/comments!