SRL Archive - Bugs

Known problems


Naike

2010-10-14 05:05:32

Known problems.

Post a thread if you've fixed a "Known problem" so we can delete it from this thread!

Developers will look into this when we find time.
Important bugs will be priorities-ed!

  • None

DON'T POST ABOUT PROBLEMS HERE.
LINK TO THREADS!

Cstrike

2010-10-14 14:21:30

Non important
R_ClickToContinue seems to find it for certain interfaces, but not a wide array of interfaces.

Interface crashes simba when doing for loops

If I do something like this:
for i:=0 to 999 do
begin
if ValidInterface(i) then writeln (i);
end;

That code in particular might not crash it, but when I started debugging text from interface/child/child components, if I didn't throw in a 10 second wait… simba would crap out with some access violation. If I changed it from i:=0 to 999, down to i:=0 to 99, it wouldn't need a wait.

I'll look into this more

pyroryan

2010-10-14 18:01:27

Seems to be like the TGroundItemArray overflowing that crashed simba. Except nothing is being stored. Maybe this time its too many writeln? Why do you need to go from 1 to 999?

As for R_ClickToContinue, maybe try fetching all interfaces using GetValidInterfaces instead of using a list of predetermined interfaces. Then searching them.

Cstrike

2010-10-14 18:36:11

From: pyroryan
Seems to be like the TGroundItemArray overflowing that crashed simba. Except nothing is being stored. Maybe this time its too many writeln? Why do you need to go from 1 to 999?

I don't know what the highest possible interface number is, so I set 999 as it ;)
Maybe there is a way to find out what the highest valid interface is? I dont know if we have code for that though.


As for R_ClickToContinue, maybe try fetching all interfaces using GetValidInterfaces instead of using a list of predetermined interfaces. Then searching them.

I think it will need to get updated for that, someone hardcoded constant windows in for it :(

Inspirations

2010-10-14 18:37:28

From: cstrike
I don't know what the highest possible interface number is, so I set 999 as it ;)
Maybe there is a way to find out what the highest valid interface is? I dont know if we have code for that though.



I think it will need to get updated for that, someone hardcoded constant windows in for it :(


couldn't you use try..except blocks to figure out where you get the out of range error and that would be the highest interface? I'm not 100% sure but that could be a possibility.

Cstrike

2010-10-14 19:03:17

From: Inspirations
couldn't you use try..except blocks to figure out where you get the out of range error and that would be the highest interface? I'm not 100% sure but that could be a possibility.


How would that work? (if you had to verbalize it :)?)

My goal is to find out why using 0 –> 99 is stable, yet 0 –> 999 creates an access violation as soon as the script terminates.

I've not used and try/except's before, so it'd be new ground I'm covering [though Id like to learn!]

i luffs yeww

2010-10-14 23:24:53


var
i: Integer;
TIA: TIntegerArray;

begin
try
for i := 0 to 10 do
begin
SetArrayLength(TIA, i);
TIA[i] := i;
end;
except
Writeln('uh oh..');
end;
Writeln('TIA: 'ToStr(TIA));
Writeln('now without try/except(/finally(not included in this example)).');
Wait(5000);
for i := 0 to 10 do
begin
SetArrayLength(TIA, i);
TIA[i] := i;
end;
end.

Cstrike

2010-10-14 23:36:23

Now thats neat! :)

I'm going to try it and see if I can get around the simba crashing issue

i luffs yeww

2010-10-15 00:01:39

Fatal errors will not be stopped with try/except/finally.

Cstrike

2010-10-15 14:45:27

Here's an up to date image of what I get when I do a DumpInterfaces
Apparently my 10 second wait at the end isn't enough to prevent a crash :(


Maybe if someone knows reflection well they could look into
"Freeing Plugins[1]"
Do not know if that has any bearing on the above problem.


Here's the code:
// This code is by Zephyrsfury
function GetChildComponentText(ParentI, ChildI, CompI: Integer): String;
var
Text, Child, Comp: Integer;
begin
Child := GetInterface(ParentI, ChildI);
Comp := SmartGetFieldArrayObject(Child, hook_interface_GetChildren, compI); //Getting the children components of the Child component
Text := SmartGetFieldObject(Comp, hook_interface_GetText);
Result := GetJavaString(Text, 255);
SmartFreeObject(Text);
SmartFreeObject(Comp);
SmartFreeObject(Child);
end;

// Do not include quotation marks if you're harvesting the string
procedure DumpAllInterfaces (maxChild, maxComponent : Integer);
var Iin, Ich, Ico : Integer;
Sch, Sco : String;
AValidInterface : TIntegerArray;
begin
AValidInterface := GetValidInterfaces;
writeln ('Number of interfaces available: '+inttostr(high(AValidInterface)));
writeln ('-----------------------------------');
for Iin:=0 to high(AValidInterface) do
begin
writeln ('<Interface #'+inttostr(AValidInterface[Iin])+'>');
for Ich:=0 to maxChild do
begin
Sch := GetInterfacetext(AValidInterface[Iin], Ich);
if Sch <> '' then writeln (' <Child #'+inttostr(Ich)+'>: "'+Sch+'"');
for Ico:=0 to maxComponent do
begin
Sco := GetChildComponentText (AValidInterface[Iin], Ich, Ico);
if Sco <> '' then writeln (' <Component #'+inttostr(Ico)+'>: "'+Sco+'"');
end;
end;
end;
writeln ('Waiting 10 seconds to prevent program crash'); // doesn't stop the crash
wait (10000); // doesn't help
writeln ('Dump All Interfaces completed.');
end;

It seems that the more interfaces you go through, the longer the wait has to be before it crashes. I assume something isn't getting freed?