SRL Archive - Help

Internal error


rj

2013-02-06 16:30:32

I am currently making a muilti-auto fighter for project 2006, and I'm getting a internal error at this part of the script:

Procedure SetKill;
Begin
Case LowerCase(MonsterKill) Of
'globlin':
Color_Monster = 5
Hue_Monster = 0
Sat_Monster = 0
Tol_Monster = 0
Uptext_1 = 'Attack Go'
Uptext_2 = 'ttack Gob'
Uptext_3 = 'ack Globin';
'custom':
Color_Monster = C_COLOR
Hue_Monster = C_HUE
Sat_Monster = C_SAT
Tol_Monster = C_TOL
Uptext_1 = C_UPTEXT_1
Uptext_2 = C_UPTEXT_2
Uptext_3 = C_UPTEXT_3;
End;
End;

[Error] C:\Simba\Scripts\Project2006autofighter.simba(74:6): Internal error (20) at line 73
Compiling failed.

Line 20:
Hue_Monster = 0  


I think im using cases wrong.. but IDK, if you need to see whole script let me know

Mark

2013-02-06 16:36:17

you need to add a begin and end; when calling more than one function/procedure or setting values
in case statements


Procedure SetKill;
Begin
Case LowerCase(MonsterKill) Of
'globlin':
begin
Color_Monster = 5
Hue_Monster = 0
Sat_Monster = 0
Tol_Monster = 0
Uptext_1 = 'Attack Go'
Uptext_2 = 'ttack Gob'
Uptext_3 = 'ack Globin';
end;
'custom':
begin
Color_Monster = C_COLOR
Hue_Monster = C_HUE
Sat_Monster = C_SAT
Tol_Monster = C_TOL
Uptext_1 = C_UPTEXT_1
Uptext_2 = C_UPTEXT_2
Uptext_3 = C_UPTEXT_3;
end;
End;
End;

major edits sorry about that.

i luffs yeww

2013-02-06 16:39:39


Procedure SetKill;
Begin
Case LowerCase(MonsterKill) Of
'globlin':
begin
Color_Monster := 5;
Hue_Monster := 0;
Sat_Monster := 0;
Tol_Monster := 0;
Uptext_1 := 'Attack Go';
Uptext_2 := 'ttack Gob';
Uptext_3 := 'ack Globin';
end;
'custom':
begin
Color_Monster := C_COLOR;
Hue_Monster := C_HUE;
Sat_Monster := C_SAT;
Tol_Monster := C_TOL;
Uptext_1 := C_UPTEXT_1;
Uptext_2 := C_UPTEXT_2;
Uptext_3 := C_UPTEXT_3;
End;
End;
End;

rj

2013-02-06 16:40:26

From: CRU1Z1N
you need to add a begin and end; when calling more than one function/procedure or setting values
in case statements


Procedure SetKill;
Begin
Case LowerCase(MonsterKill) Of
'globlin':
begin
Color_Monster = 5
Hue_Monster = 0
Sat_Monster = 0
Tol_Monster = 0
Uptext_1 = 'Attack Go'
Uptext_2 = 'ttack Gob'
Uptext_3 = 'ack Globin';
end;
'custom':
begin
Color_Monster = C_COLOR
Hue_Monster = C_HUE
Sat_Monster = C_SAT
Tol_Monster = C_TOL
Uptext_1 = C_UPTEXT_1
Uptext_2 = C_UPTEXT_2
Uptext_3 = C_UPTEXT_3;
end;
End;
End;

major edits sorry about that.


Still getting the same error :s

i luffs yeww

2013-02-06 16:42:10

From: rjj95
Still getting the same error :s


Semicolons.

Also, your first case says 'globlin.' shouldn't it be 'goblin?'

Mark

2013-02-06 16:42:45

yeah i see your missing semicolons

Color_Monster = C_COLOR

should be
Color_Monster:= C_COLOR

Edit:ninja also didnt notice that Globlin :d nice catch

i luffs yeww

2013-02-06 16:45:34

From: CRU1Z1N
yeah i see your missing semicolons

Color_Monster = C_COLOR

should be
Color_Monster:= C_COLOR

Edit:ninja also didnt notice that Globlin :d nice catch


They should also all be assignments, actually.

EDIT: This is actually the reason he's getting the internal error. I was using Lape so my errors were different.

rj

2013-02-06 16:46:00

Just added semi colons,
Procedure SetKill;
Begin
Case LowerCase(MonsterKill) Of
'goblin':
Begin
Color_Monster = 5015139;
Hue_Monster = 0.07;
Sat_Monster = 0.15;
Tol_Monster = 5;
Uptext_1 = 'Attack Go';
Uptext_2 = 'ttack Gob';
Uptext_3 = 'ack Globin';
end;
'custom':
Begin
Color_Monster = C_COLOR;
Hue_Monster = C_HUE;
Sat_Monster = C_SAT;
Tol_Monster = C_TOL;
Uptext_1 = C_UPTEXT_1;
Uptext_2 = C_UPTEXT_2;
Uptext_3 = C_UPTEXT_3;
End;
End;
End;

but the same result:

[Error] C:\Simba\Scripts\Project2006autofighter.simba(95:30): Internal error (20) at line 94
Compiling failed.

Ian

2013-02-06 16:47:24

They mean colons, like this: :
Procedure SetKill;
Begin
Case LowerCase(MonsterKill) Of
'goblin':
Begin
Color_Monster := 5015139;
Hue_Monster := 0.07;
Sat_Monster := 0.15;
Tol_Monster := 5;
Uptext_1 := 'Attack Go';
Uptext_2 := 'ttack Gob';
Uptext_3 := 'ack Globin';
end;
'custom':
Begin
Color_Monster := C_COLOR;
Hue_Monster := C_HUE;
Sat_Monster := C_SAT;
Tol_Monster := C_TOL;
Uptext_1 := C_UPTEXT_1;
Uptext_2 := C_UPTEXT_2;
Uptext_3 := C_UPTEXT_3;
End;
End;
End;

Press Play

2013-02-06 16:50:43

I had this issue a few days ago - and I only just fixed it now after reading this post! :duh: I was thinking way beyond the problem..

Some SRL Member I am :p

rj

2013-02-06 16:50:45

Now I have a different Error:

Type mismatch 

At this line:

Hue_Monster := 0.07;

I'm guessing that I can't use name number 0.07? (decimals?)

i luffs yeww

2013-02-06 16:51:17

From: rjj95
Now I have a different Error:

Type mismatch 

At this line:

Hue_Monster := 0.07;

I'm guessing that I can't use name number 0.07? (decimals?)


Hue_Monster needs to be of type Extended.

rj

2013-02-06 16:53:37

From: i luffs yeww
Hue_Monster needs to be of type Extended.

not sure how to declare a type sec I think I know how ill come back if I get an error

EDIT:

So I got:

Type
Hue_Monster,Sat_Monster:Integer;

but i get the error:

[Error] C:\Simba\Scripts\Project2006autofighter.simba(19:15): is ('=') expected at line 18
Compiling failed.

So I'm guessing I'll have to declare it inside of the case?

Ian

2013-02-06 16:58:00

An integer is a whole number, an extended is a number that can have decimals. I recommend you read this tutorial, it's very good :) : http://villavu.com/forum/showthread.php?p=601951

var
Hue_Monster,Sat_Monster:Extended;

rj

2013-02-06 17:00:03

From: BMWxi
var
Hue_Monster,Sat_Monster:Extended;


:o ty no errors!

This script is going to be completly NOOB freindly

Mark

2013-02-06 17:02:52

creating a type

Type MonsterCols = record
Hue_Monster,Sat_Monster:Integer;
end;

then you need to create your new type you declare this in your variables like you would create and integer

procedure someproc;
var
MonsterColArray:MonsterCols;//declare your new type here or in your global variables
begin
case wateva of
'boblin':
begin
MonsterColArray.Hue_Monster:= 324;//whateva the value is
MonsterColArray.Sat_Monster:= 324;
end;
end;

edit: something wrong with my browser keeps messing up my posts