Game Development Community

triggering the new AIPlayer?

by Stefan Beffy Moises · in Torque Game Engine · 12/01/2002 (11:18 am) · 1 replies

Hi,
now that the new AIPlayer is based on the Player class,
I can't get it to trigger shooting or jumping any more...
I've added some code to AIPlayer::getAIMove() setting the trigger states (based on a boolean I am setting somewhere else), but it doesn't have any effect:
( neither
movePtr->trigger[0] = true; nor setImageTriggerState(0,true); )
if (mModeFire) {

	Con::printf("ModeFire!!");
	const char *WeaponSlot = Con::getVariable("$WeaponSlot");
	S32 slot = dAtoi(WeaponSlot);

	if (slot >= 0 && slot < ShapeBase::MaxMountedImages) {
		if (getMountedImage(slot)) {
			
			if (!movePtr->trigger[slot]) {
				movePtr->trigger[slot] = true;
				setImageTriggerState(0,true);
				Con::printf("Shoot!!");
				//setMove(&move);
			}
		}
	}
		
}
I've also commented that part in getAIMove() out:
// Replicate the trigger state into the move so that
   // triggers can be controlled from scripts.
   //for( int i = 0; i < MaxTriggerKeys; i++ )
      //movePtr->trigger[i] = getImageTriggerState(i);
... but that didn't help either...
The Con::printf() both work, so everything gets executed, but somehow the trigger states don't get through...
Does anybody know what has to be changed to get the triggers to work for the new AIPlayer??

#1
12/01/2002 (12:19 pm)
Nevermind, it works... it was a stupid script typo... :/