SRL Archive - OSR Help

inbuilt simba/scar Types


bg5

2011-12-20 07:16:56

In script repository there is a lot of functions with inbuilt types as arguments. Types like TBox ,TIntegerArray ,T2DPointArray ,TInvenItemArr and other strange names. I can't find anything about them on http://docs.wizzup.org/ ,so only way to learn how to use them is analysing other scripts ,but it's a bit pain for me.

Where can I read description of these types?


Secondly I have problem with definiting TBox. I Found on http://wiki.scar-divi.com/titan/index.php?title=Types.TBox example ,but it seems to not work in Simba.

var
b: TBox;

begin
b := Box(5, 6, 7, 8);

end.

I'm getting error
[Error] (26:12): Unknown identifier 'Box' at line 25

I know I can define every field separately like:

var
b: TBox;

begin
b.x1 := 5;
b.y1 := 6;
b.x2 := 7;
b.y2 := 8;
end.

,but is there any faster one-line way?

KingKong

2011-12-20 07:23:22

make a function that does it, then call that function.

RISK

2011-12-20 07:23:55

Most tutorials in the tutorial section hold information on all of these types. :) Some of them you also learn by experience.

Coh3n has most of these covered: http://villavu.com/forum/showthread.php?t=49089

bg5

2011-12-20 08:58:13

From: KingKong
make a function that does it, then call that function.


Yes ,but i thought Simba has equivalent of that Scar "box" function.


Ok I just found what i needed here:
https://github.com/MerlijnWajer/Simba/blob/4f861ffb5dfa7a8159e03cd186937cbb1264c972/Units/MMLCore/mufasatypes.pas

NCDS

2011-12-20 08:59:52

We do. It's called IntToBox();

;)

Kyle Undefined

2011-12-20 09:09:22

EDIT: :ninja:'d by NCDS

You want to use "IntToBox();", like so:


program new;

var
b : TBox;

begin
b := IntToBox(5, 6, 7, 8);

with b do
begin
x1 := 5;
y1 := 6;
x2 := 7;
y2 := 8;
end;
end.

Home

2011-12-20 09:10:43

In scar you can do Box(….) but with Simba you must do IntToBox(….)


~Home