SRL Archive - Help and Support

Best way to manage lots of walking


Bobzilla69

2010-09-29 06:31:58

Hi guys/girls,

I am planning on making a quest runner, naturally there will be walking and lots of it, but what i want help with is the best way to store all the walking.

i was thinking of using a function that will take a variable of location (where to walk to) and use a case to store all the possibilities, however i am not sure of this is the best way to do it.

whats your opinions on the matter

weequ

2010-09-29 07:52:10

Color walking is not easy. I have no idea how you should deal with all the walking :/

Bobzilla69

2010-09-29 07:54:44

From: antti mies
Color walking is not easy. I have no idea how you should deal with all the walking :/


yes i know its not easy, but i like the challenge to make something that's hard, even if i fail its still fun, well for me at least to have attempted. chances are i will learn alot from it.

i think i am going to try case of and see how things go from there

TomTuff

2010-09-29 09:27:43


procedure WalkTo(loc: string);
begin
case loc of
'duhduh' := {walking here};
'dumdum' := {walking here};
end;
end;

Bobzilla69

2010-09-29 10:34:12

From: TomTuff

procedure WalkTo(loc: string);
begin
case loc of
'duhduh' := {walking here};
'dumdum' := {walking here};
end;
end;


That exactly have i decided on :)

will just end up with a extremely long case.

i am still open to other suggestions

Rich

2010-09-29 10:42:18

Reflection?

Cstrike

2010-09-29 11:31:21

You want reflection. It works on tiles, and if you make a TTileArray (it's basically the same as a TPoint, except the array would be like TTile(3323,3112)), and then if you call WalkPath you'd be good.

To expand on TomTuff's code:

procedure WalkToLoc(loc: string);
var pathToWalk : TTileArray;
begin
case loc of
'pathToSpot1' :
begin
pathToWalk := []; // TTA = TTileArray, and put tiles inside brackets like a TPA
writeln ('Walking: '+loc);
end;
'PathBackToBank' : // etc etc etc, copy the above for all your places
//etc
end;
WalkPath (pathToWalk);
end;

Use WalkPath, WalkToTile is not great without failsafes and walkpath is pretty much flawless! :)

To get the tiles, get Sumillion's Tile Path maker (reflection SVN, I don't have it with the reflection.sex though… need to get it) and make sure you plug in the updated offsets in the txt file when you get the full thing.

Bobzilla69

2010-09-29 11:43:06

From: cstrike
You want reflection. It works on tiles, and if you make a TTileArray (it's basically the same as a TPoint, except the array would be like TTile(3323,3112)), and then if you call WalkPath you'd be good.

To expand on TomTuff's code:

procedure WalkToLoc(loc: string);
var pathToWalk : TTileArray;
begin
case loc of
'pathToSpot1' :
begin
pathToWalk := []; // TTA = TTileArray, and put tiles inside brackets like a TPA
writeln ('Walking: '+loc);
end;
'PathBackToBank' : // etc etc etc, copy the above for all your places
//etc
end;
WalkPath (pathToWalk);
end;

Use WalkPath, WalkToTile is not great without failsafes and walkpath is pretty much flawless! :)

To get the tiles, get Sumillion's Tile Path maker (reflection SVN, I don't have it with the reflection.sex though… need to get it) and make sure you plug in the updated offsets in the txt file when you get the full thing.


ok cheers for the info, will look into doing it that way if i cant get color walking to work.