SetImageTrigger
by Nick Mayne · in Torque Game Engine · 03/03/2004 (6:43 am) · 2 replies
Hi after implementing
Jim biffy bots by Stefan Beffy Moises
and
AI SENSES by Daniel Neilsen
brillent scripts both of you too so thanks are in order. though i am having a problem firing.
im getting this error -
starter.fps/server/scripts/aiPlayer.cs (204): Unable to find object: '' attempting to call function 'setImageTrigger'
Accoring to the script it should be firing though for some reason it cant find this object. i would post the *.cs file here but instead ill include it as a link. Click Here for script
this is the problem piece of code.
function Armor::singleShot(%this)
{
// The shooting delay is used to pulse the trigger
%this.setImageTrigger(0,true);
echo( "singleShot" );
%this.setImageTrigger(0,false);
%this.trigger = %this.schedule(this.shootingDelay,singleShot);
}
it proberly jsut hates me. i did get the bot to fire by moving this piece of code %this.setImageTrigger(0,true); to the onShoot area and changing %this.setImageTrigger(0,true); to %obj.setImageTrigger(0,true);
I hope some one can help as ive tryed my best as a noobie to get this to work.
Thanks alot
Nick
Jim biffy bots by Stefan Beffy Moises
and
AI SENSES by Daniel Neilsen
brillent scripts both of you too so thanks are in order. though i am having a problem firing.
im getting this error -
starter.fps/server/scripts/aiPlayer.cs (204): Unable to find object: '' attempting to call function 'setImageTrigger'
Accoring to the script it should be firing though for some reason it cant find this object. i would post the *.cs file here but instead ill include it as a link. Click Here for script
this is the problem piece of code.
function Armor::singleShot(%this)
{
// The shooting delay is used to pulse the trigger
%this.setImageTrigger(0,true);
echo( "singleShot" );
%this.setImageTrigger(0,false);
%this.trigger = %this.schedule(this.shootingDelay,singleShot);
}
it proberly jsut hates me. i did get the bot to fire by moving this piece of code %this.setImageTrigger(0,true); to the onShoot area and changing %this.setImageTrigger(0,true); to %obj.setImageTrigger(0,true);
I hope some one can help as ive tryed my best as a noobie to get this to work.
Thanks alot
Nick
About the author
#2
03/03/2004 (2:03 pm)
Ah you have a point... let me go and have a look at what ive done again and see if i can get that to work. Thanks Kim
Torque Owner Kimberly Unger
I didn't see you setting the setAttackTargetObject() to the object your shooting at. Did you forget this or are my eyes playing tricks on me?