SRL Archive - Help and Support

Help...


Hobbit

2008-05-04 20:15:39

Yes I'm making a script. *gasp* but yet again it is for a flash game :p I've only made 3 RS scripts and none have ever been released or still work…and i lost the sheet of paper with all my passwords to my autoers..but maybe I'll make another RS script.

ANYWAYS..I'm having some trouble…

The total length of my form code is 828 lines… most of it is a bitmap for the picture but it's a cool picture so I'm not taking it out.

Anyways (again…jeez i keep getting side tracked) my problem is, instead of making the script like 3000 lines long I decided to make the form code and include…

Now in the main script I tried
{.include DHForm.scar}
but then it freaked out at me that there was no such file in includes folder. So my first question is, is there anyway to change the default location of .include other than the includes folder? I'd like to be able to include from the scripts folder. If not, no biggie.

-Second Part Fixed-

Dan Cardin

2008-05-04 20:31:17

its not of scar, its of the saved file that you're including from

Bobarkinator

2008-05-04 20:49:59

Include the absolute path. I just tried it and it worked. I put a .scar file on my C harddrive with a procedure called Hi that printed out "hi". I did
{.include C:\Blah.scar}

Begin
Hi;
End.

and it worked just fine. So just have the user set their script directory. Or ask freddy if their is any way to get the default script directory and go from their.

Hobbit

2008-05-04 21:01:44

Ok and now i have a new problem….

I'm getting this error from this Proc.
Line 17: [Error] (12712:13): Type mismatch in script C:\Program Files\SCAR 3.15\includes\DHForm.scar

procedure buttonclick(sender: TObject);
begin
case sender of
Button1 : begin
frmDesign.ModalResult := mrOk; //line 17
Edit1:= name;
Writeln('Setup Sucessful.')
Writeln('Your name is '+name+'.');
end;

Button2 : begin
frmDesign.ModalResult:= mrCancel;
TerminateScript;
Writeln('Setup Canceled - Script Terminated');
end;

Button3 : begin
OpenWebPage('http://www.srl-forums.com/');
frmDesign.ModalResult := mrOk;
Exit;
end;
end;
end;

MylesMadness

2008-05-04 21:06:36

What line is 17?

Dan Cardin

2008-05-04 21:07:20

edit1.caption?? if thats a TEdit

Hobbit

2008-05-04 21:21:18

I feel stupid… I got it.

shoulda been
name:= Edit1.text;

Now I can't remember how to forward a function.
is it
exampleprocedure : Forward;
??

Method

2008-05-04 21:25:25

I think it's:

procedure AProcedure; forward;
function TestMeOut(Arguments: Type): Result; forward;

Hobbit

2008-05-04 21:52:15

Yep thats it! Thanks. I was close..

@Bob yea I could do that. And hopefully Freddy does know away that the user wont have to put it in…

————————————–
edit:

hehehe another problem… as you can tell I'm very rusty.

Instead of doing the long way like
if(RadioButton1.Checked)then
blahahahahaha

if(RadioButton2.Checked)then
blahahahaa

Would this work? It's giving me this error.
Line 38: [Error] (12733:7): Assignment expected in script C:\Program Files\SCAR 3.15\includes\DHForm.scar

and in the form code I added in
RadioButton1.Checked := @buttonclick;
Radiobutton2.Checked := @buttonclick;
etc

procedure buttonclick(Sender: TObject);
begin
//[code from above problem]\\

case Sender of
RadioButton1 : Begin
sound = True;
end;

RadioButton2 : begin
sound = False;
end;
end;
end;

How would i rewrite this to make it work??

R0b0t1

2008-05-04 22:32:37

'Checked' is whether or not its got that green mark in it, you'll need to find the event name of when it gets changed.

Santa_Clause

2008-05-04 22:34:55

When assigning the values of a variable, we use a colon and equals sign ' := '. When comparing the values of a variable, we only use the equals sign ' = '.

It should be:

procedure ButtonClick(Sender: TObject);
begin
case Sender of
RadioButton1 : Begin
Sound := True;
end;

RadioButton2 : begin
Sound := False;
end;
end;
end;

R0b0t1

2008-05-04 22:39:49

Wait. Wait.

AHAHAHAHAHAHAHAHAHA. :p


I thought he meant something else.

Hobbit

2008-05-04 22:51:06

I already fixed the = :p
I figured it out, it was OnClick… I thought I had tried that already.

Widget

2008-05-05 00:58:20

Lol, do you still need help on the first post? You can also do
{.include ..\Scripts\DHForm.scar}
to look in the directory above Includes, then in \Scripts\ :)

Also, might as well shorten this:
procedure ButtonClick(Sender: TObject);
begin
case Sender of
RadioButton1 : Sound := True;
RadioButton2 : Sound := False;
end;
end;

Or better yet:
procedure ButtonClick(Sender: TObject);
begin
Sound := (Sender=RadioButton1)
end;