SRL Archive - OSR Help

Help on resulting a type Please


Troll

2011-04-13 04:02:53

Umm so in a function i am trying to result in a type.

Type
Monster = Record
Colour,Toll:Integer;
Hue,Sat :Extended;
Uptext :String;
End;






Function MonsterDetails(MonsterName:String):Monster;
Begin
Case MonsterName Of
'Goblin':Begin
End;
End;
End;

But every time i do Result := —— it throws an error

Thanks for the help

Bobzilla69

2011-04-13 04:11:13

Type
Monster = Record
Colour,Toll:Integer;
Hue,Sat :Extended;
Uptext :String;
End;

var
MonsterSetup : Monster




Function MonsterDetails(MonsterName:String):Monster;
Begin
Case MonsterName Of
'Goblin':Begin
with MonsterSetup do //loads recoard to store specific infomation for script
begin
Colour:= ;
Toll:= ;
Hue:= ;
Sat:= ;
Uptext:= '' ;
end;
End;
End;
End;

use the above case to store all monsters.

when you call a specific one use MonsterSetup.Colour, Toll and so on to call the relevant info.

thats how i did it last time, hope it all makes sense

Gu3st...

2011-04-13 04:18:23

@Bobzilla69: with MonsterSetup do -> with Result do

Troll

2011-04-13 04:46:32

Wow that great, thanks both of you :)