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!!
What means this error???
Re: What means this error???
Should be:Kite_eop wrote:self.think("NormalSword");
self.think = "NormalSword";
***EDIT***
Welcome to the forums, mate.
Last edited by Juutis on Sun Oct 19, 2008 12:39 am, edited 1 time in total.
Pain is only psychological.
- metal_head
- Posts: 1244
- Joined: Sat Jan 05, 2008 8:31 pm
- Location: Bulgaria,Sofia
- Contact:
Re: What means this error???
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.
When do I write
Code: Select all
self.think("NormalSword");
Code: Select all
self.think = "NormalSword";
Re: What means this error???
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.
Code: Select all
self.think("NormalSword");
Code: Select all
self.think = "NormalSword";
- metal_head
- Posts: 1244
- Joined: Sat Jan 05, 2008 8:31 pm
- Location: Bulgaria,Sofia
- Contact:
Re: What means this error???
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.
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???
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:
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???
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 = ...').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.
Pain is only psychological.