SRL Archive - Bugs

DTM[] is not consistant.


Coh3n

2010-04-23 17:42:09

Hey,

I'm not exactly sure what it means, but it just started happening when running the MSI script. It opens AntiRandoms.scar and highlights line 351, which is a white line?


Error: Exception: FindDTMs: DTM[] is not consistant. at line 351


Did I mess something up in the script? Or what?

Thanks,
Coh3n

Wizzup?

2010-04-23 18:51:08

Can you add a printdtm(getdtm(yourdtm)) before that line, so we can see the DTM?

Coh3n

2010-04-23 19:40:34

From: Wizzup?
Can you add a printdtm(getdtm(yourdtm)) before that line, so we can see the DTM?

Uhm, I can't exactly…

[PHP]
{*******************************************************************************
function FindFight: Boolean;
by: EvilChicken!
Description: Results true if charachter is in a fight.
*******************************************************************************}
//this is line 351
function FindFight: Boolean;
begin
Result := False;
if (not LoggedIn) then exit;
if (CountColor(10496, 200, 130, 280, 180) + CountColor(198716, 200, 130, 280, 180) > 50) then
begin
if (CheckHpFirst) and (HpPercent = 100) then exit;

Result := True;
AddToSRLLog('******** FOUND FIGHTING RANDOM ********');
WriteLn('******** FOUND FIGHTING RANDOM ********');
TakeScreen('Found Fight');
Inc(RandSolved[rand_Fight]);
end;
end;
[/PHP]

Wizzup?

2010-04-24 12:08:11

Disregard the tab it opens, that's probably pascalscript passing a wrong position. Do you use DDTMs and such in your script? If so, can you print the DTMs just before you use them? IIRC on the other thread you only saw it happen with a recent change in the MSI script, so perhaps we can narrow it down to a few DTMs?

Coh3n

2010-04-24 14:29:15

From: Wizzup?
Disregard the tab it opens, that's probably pascalscript passing a wrong position. Do you use DDTMs and such in your script? If so, can you print the DTMs just before you use them? IIRC on the other thread you only saw it happen with a recent change in the MSI script, so perhaps we can narrow it down to a few DTMs?

I set it to print the DTM everytime one is loaded and nothing was printed. It keeps happening right after the script banks logs (which uses DTMs), but it banks them, so I can't see anything being wrong with the DTM. I put this in the function that loads the DTMs.
[PHP]
PrintpDTM(GetDTM(MSI_Item[ID].DTM));
[/PHP]

Wizzup?

2010-04-24 17:14:53

So perhaps the DTM really is empty? :o

Coh3n

2010-04-24 17:17:19

In that case, would it print a blank line? I don't know what DTM would be empty cause the only one loaded is the logs, and it deposited them fine, so it couldn't be empty.

Wizzup?

2010-04-24 17:43:23

From: Coh3n
In that case, would it print a blank line? I don't know what DTM would be empty cause the only one loaded is the logs, and it deposited them fine, so it couldn't be empty.


Alright. What script is this? :)

Coh3n

2010-04-24 17:53:49

The MSI VE Woodcutter.

PM me if you need an account.

Wizzup?

2010-04-25 06:13:25

From: Coh3n
The MSI VE Woodcutter.

PM me if you need an account.


Yes, please. :) (I'll post here, bit easier. Acc is better via PM :p )

Coh3n

2010-04-25 11:20:24

Sent :)

Coh3n

2010-04-26 16:46:58

I noticed in the latest version it says that a DTM bug was fixed. Not sure if that was suppose to be this problem or not, but it didn't fix it. I'm sure you would have posted here if it was, but I'm just checking.

mastaraymond

2010-04-26 17:10:06

No that had to do with finding.. I will take a look at this bug 2morrow :).

Coh3n

2010-04-26 23:29:47

From: mastaraymond
No that had to do with finding.. I will take a look at this bug 2morrow :).

Thanks <3

mastaraymond

2010-04-27 16:12:40


for i := HATCHET_BRONZE to LOGS_YEW do
MSI_GetItem(i);
for i := HATCHET_BRONZE to LOGS_YEW do
PrintpDTM(GetDTM(MSI_Item[i].dtm));
for i := HATCHET_BRONZE to LOGS_YEW do
DTMRotated(MSI_Item[i].dtm,x,y,0,0,50,50);

Works here.. I don't see what is causing this error.

mastaraymond

2010-04-27 16:14:24

From: Coh3n
In that case, would it print a blank line? I don't know what DTM would be empty cause the only one loaded is the logs, and it deposited them fine, so it couldn't be empty.

It doesn't print a white line, it just doesn't print to the Form; It prints to the Console ;).

Coh3n

2010-04-27 16:15:43

From: mastaraymond

for i := HATCHET_BRONZE to LOGS_YEW do
MSI_GetItem(i);
for i := HATCHET_BRONZE to LOGS_YEW do
PrintpDTM(GetDTM(MSI_Item[i].dtm));
for i := HATCHET_BRONZE to LOGS_YEW do
DTMRotated(MSI_Item[i].dtm,x,y,0,0,50,50);

Works here.. I don't see what is causing this error.

Okay thanks for looking at it. It was happening on my laptop (but didn't always happen), but that may be the problem. I'm going to test on my desktop and see how it goes.

From: mastaraymond
It doesn't print a white line, it just doesn't print to the Form; It prints to the Console ;).

Ohh okay haha my bad. :p

Coh3n

2010-04-27 18:48:39

It still happens. You have to run the script to see what happens. I don't know if what you testing would make the error occur or not. I PM'd you an account if you want to try it.

itSchRis917

2010-04-27 23:33:59

I actually just ran into this issue.. And what i discovered was that I had an array of DTMs(obviously), and i searched the inventory for them. The array was of all the fishing equipment. When i found one of the DTM's(or both for fly fishing etc), i would free all the other DTM's in the array, and I am assuming it cut all of those DTM's out of the array.. So then when i looped through the DTM's, trying to find if we still had the equipment, I would get that error. And i believe it was because it was trying to loop through a TIntegerArray at spots that didn't hold DTM's. At least that is my understanding.. I have waited to free all the DTM's until the end of the script now, and that has fixed it. Hope this helps?

Coh3n

2010-04-28 10:31:49

From: itSchRis917
I actually just ran into this issue.. And what i discovered was that I had an array of DTMs(obviously), and i searched the inventory for them. The array was of all the fishing equipment. When i found one of the DTM's(or both for fly fishing etc), i would free all the other DTM's in the array, and I am assuming it cut all of those DTM's out of the array.. So then when i looped through the DTM's, trying to find if we still had the equipment, I would get that error. And i believe it was because it was trying to loop through a TIntegerArray at spots that didn't hold DTM's. At least that is my understanding.. I have waited to free all the DTM's until the end of the script now, and that has fixed it. Hope this helps?

Yes it does help, thanks very much. It doesn't explain why I'm getting the error, but it does give me a place to start looking. :)

E: I found the source of the problem. After depositing the logs, an array of DTMs gets freed, but I don't understand why that would cause an error. Lol

E2: I changed where the DTMs were loaded and freed and it seems to have fixed the problem. I'll have to test a long run, but thanks a lot! :D

Wizzup?

2010-04-28 11:04:18

Yay! :)

E: But is this still a problem in Simba? I don't fully understand…

itSchRis917

2010-04-28 11:10:58

Glad it's fixed! =)

mastaraymond

2010-04-30 08:39:01

So; In the latest Simba it will throw a different error when you access a freed DTM.

Coh3n

2010-04-30 09:09:12

From: mastaraymond
So; In the latest Simba it will throw a different error when you access a freed DTM.

Awesome, thanks :) <3

E: Off topic, but I'm sure you'd be glad to know that SMART works for me in WINE with the latest version of Simba. :)

Baked0420

2010-04-30 10:21:21

only thing I can think of is maybe he is trying to free every dtm in the array when maybe he didn't load them all, so maybe free'ing a dtm that hasn't been loaded will give you the error he's getting? sorry I haven't used simba much at all, so I'm not sure, and I don't really use scar often either anymore. Just trying to help, it seems like that's the problem from the posts, but I never tried to see if that would actually give an error or not.

Coh3n

2010-04-30 12:39:23

From: Baked0420
only thing I can think of is maybe he is trying to free every dtm in the array when maybe he didn't load them all, so maybe free'ing a dtm that hasn't been loaded will give you the error he's getting? sorry I haven't used simba much at all, so I'm not sure, and I don't really use scar often either anymore. Just trying to help, it seems like that's the problem from the posts, but I never tried to see if that would actually give an error or not.

Yeah, we already determined and fixed it. :p