SRL Archive - OSR Help

ObjDTM


NKN

2012-03-26 15:31:07

So, I'm having trouble to get ObjDTM's to work.
I created the path, but it keeps saying it can't find node 0, and if I set that extra failsafe, it says not in area, and terminates, which it always is in.
Here's the code….
program new;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i SPS/SPS.simba}
{$i ObjectDTM/ObjDTMInclude.Simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
procedure WalkToLineThere;
var
ToLineThere:TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['10_6','11_6']);
ToLineThere := [Point(4219, 2658), Point(4212, 2640),
Point(4193, 2630), Point(4194, 2591), Point(4220, 2567)];
SPS_WalkPath(ToLineThere);
end;
procedure WalkToDungeon;
var
ToDungeonThere:TStringArray;
x,y:Integer;
begin
ToDungeonThere := ['53:36:6:1:7:90:38:1:7:70:71:1:7:41:67:1:7:74:104:1:7:25:100:1:7:90:104:4:96:56:40:68:50:101:120:95',
'47:15:3:1:7:111:63:1:7:49:87:1:7:94:116:4:89:30:31:75:87:119:144:82',
'31:25:4:2:7:119:72:2:7:37:68:2:7:25:80:2:7:70:76:4:76:41:42:82:95:121:131:64',
'69:10:4:2:7:106:124:2:7:50:112:2:7:102:52:2:7:42:60:4:82:53:58:70:74:101:113:87',
'87:17:4:2:7:138:88:2:7:54:96:2:7:118:88:2:7:54:80:4:113:54:43:53:79:128:123:109',
'75:9:4:5:7:72:99:5:7:48:115:5:7:44:99:5:7:68:91:4:90:53:52:75:92:113:118:95',
'87:11:4:5:7:88:63:5:7:60:52:5:7:37:83:5:7:51:115:4:113:35:36:76:98:121:150:85',
'95:35:3:5:7:88:99:5:7:53:99:5:7:57:122:9:107:19:27:29:25:122:77:146:126:126:145:95:147:47:131:28:115:13']
FFlag(0);
Wait(1000+random(100));
if(FindObj(x,y,'wall',3950414,5)) then
Mouse(x,y,3,3,True);
Wait(5000+random(500))
ObjDTM_WalkPath(ToDungeonThere,0,100,80,True,False)
end;
begin
// These 4 lines HAVE to be set BEFORE you call SetupSRL;
Smart_Server := 25;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
ObjDTM_Setup;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
WalkToLineThere;
WalkToDungeon;
end.

Imagine

2012-03-26 15:49:08

Could you include the debug box?
And I'm pretty sure this is not the problem, but you're missing some semicolons near the end of the "WalkToDungeon" function.

NKN

2012-03-26 15:54:47

Object DTM Include: Not at beginning of path.  Exiting.
Successfully executed.
That's one of the errors, let me get the second.
Did not find path node 0.
Did not find path node 0.
Did not find path node 0.
Did not find path node 0.
Failed to walk to path node 0, trying to step forward or back one node.
Error: Out Of Range at line 1768
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

Imagine

2012-03-26 16:02:02

Apparently one of the errors is that it won't find the initial "node". Are you sure you're starting it at a place where it can see all of the Objects that you used when creating the ObjectDTM? Were any of the objects on the edge of the minimap?

NKN

2012-03-26 16:03:50

Nope… I'll try to remake it with only one object

Imagine

2012-03-26 16:06:52

One object won't be enough - too many false ID's. I'd suggest making it with three or four objects that are easily visible from the point you're starting at.

NKN

2012-03-26 16:12:11

I tried, still failed.
Doesn't like the wilderness…

Sir Ducksworthy

2012-03-26 20:35:36

function ObjDTM_Walk(ObjDTMToWalk: String; FlagDistance, PollRate,
Tries: Integer; GroundLevel: Boolean): Boolean;

Change ObjDTM_WalkPath(ToDungeonThere,0,100,80,True,False) to:
ObjDTM_WalkPath(ToDungeonThere,0,100,80,True)

if(FindObj(x,y,'wall',3950414,5)) then this could be wrong to because Uptext is case sensitive

NKN

2012-03-26 22:37:22

From: leetsxc
function ObjDTM_Walk(ObjDTMToWalk: String; FlagDistance, PollRate,
Tries: Integer; GroundLevel: Boolean): Boolean;

Change ObjDTM_WalkPath(ToDungeonThere,0,100,80,True,False) to:
ObjDTM_WalkPath(ToDungeonThere,0,100,80,True)

if(FindObj(x,y,'wall',3950414,5)) then this could be wrong to because Uptext is case sensitive

My walkPath was right, Walk has one less Boolean, WalkPath has two.
I got the uptext right, don't worry. ^^