Page 1 of 1
What means this error???
Posted: Sat Oct 18, 2008 5:30 pm
by Kite_eop
hello everybody! well, i make a scripted player but when I touch the key 16 skips the following error
ERROR Scripts/Kite.s/Normal:162 Method (something xD) not found*
this is the order of the keypressed
if (IsKeyDown(16))
{
self.think("NormalSword");
}
}]
And this is the order "NormalSword"
NormalSword[()
{
walkmove(self.current_yaw+DIR, VEL );
self.yaw_speed=9999;
self.current_yaw=self.ideal_yaw;
ChangeYaw();
PlayerRender(false);
Kite.PawnRender(false);
KiteSword.PawnRender(true);
if (self.IsFalling=true)
{
self.think="FallingwithSword";
}
else
{
(... the rest of the script)
I dont know what happens please help!!
Re: What means this error???
Posted: Sat Oct 18, 2008 9:18 pm
by Juutis
Kite_eop wrote:self.think("NormalSword");
Should be:
self.think = "NormalSword";
***EDIT***
Welcome to the forums, mate.

Re: What means this error???
Posted: Sat Oct 18, 2008 9:24 pm
by metal_head
Sorry for interrupting,not that I'm using theese commands yet,but I want to ask.
When do I write
and when do I write
and what's the difference? Just..i've seen theese in scripts and I've always asked myself about that.
Re: What means this error???
Posted: Sat Oct 18, 2008 9:38 pm
by Allanon
Don't really know this scripting language but I am a programmer and it seem the difference is:
self.think is a function and "NormalSword" is a parameter being passed to the function self.think.
self.think is a variable and "NormalSword" is being assigned to self.think.
Re: What means this error???
Posted: Sat Oct 18, 2008 9:58 pm
by metal_head
hmmm,I'm not really sure about that,I'm not a programmer yet,but I have the feeling that this is not a variable.
slef.think is a command,right? I have the feeling that it has something to do with the low level and the high level,but I may be totally wrong.
Re: What means this error???
Posted: Sat Oct 18, 2008 10:45 pm
by Allanon
I just looked at the RF code and it's a lot more complicated than I thought but for simplicity sake you can think of self.think as a variable and every time self.think is assigned a value the RF code will assign that value to the object's Order variable.
Here is the setvalue code from the ControllerObject, I think this code gets called when self.think is assigned a value. Other objects have similar code:
Code: Select all
/* ------------------------------------------------------------------------------------ */
// setValue
/* ------------------------------------------------------------------------------------ */
bool ControllerObject::setValue(const skString& fieldName, const skString& attribute, const skRValue& value)
{
if(fieldName == "think")
{
strcpy(Order, value.str());
return true;
}
else if(fieldName == "ThinkTime")
{
ThinkTime = value.floatValue();
return true;
}
else if(fieldName == "time")
{
ElapseTime = value.floatValue();
return true;
}
else
return skScriptedExecutable::setValue(fieldName, attribute, value);
}
Re: What means this error???
Posted: Sun Oct 19, 2008 12:42 am
by Juutis
metal_head wrote:Sorry for interrupting,not that I'm using theese commands yet,but I want to ask.
and what's the difference? Just..i've seen theese in scripts and I've always asked myself about that.
The difference is, there's no such command as self.think(). Switching between low level orders is done only with the variable style ('self.think = ...' , or 'think = ...').