id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Scripting => Topic started by: bitterman on March 13, 2018, 01:01:36 AM

Title: The AI_FORWARD don't handled by custom script
Post by: bitterman on March 13, 2018, 01:01:36 AM
This is ai_player.script with some additions.

The string "sys.println( "^3 idle loop" );" does get control.
But looks like string "sys.println( "^3 ai_forward" );" does not.

void player::Torso_Idle() {

playCycle( ANIMCHANNEL_TORSO, "idle" );

eachFrame {

// added by me ************************

        sys.println( "^3 idle loop" );

if ( AI_FORWARD ) {
//                      animState( ANIMCHANNEL_TORSO, "Torso_Walk", 4 );
//                      Torso_Walk();
                        sys.println( "^3 ai_forward" );
}
// end of modification ************************

if ( AI_TELEPORT ) {
animState( ANIMCHANNEL_TORSO, "Torso_Teleport", 0 );
}
if ( AI_WEAPON_FIRED || weapon.WEAPON_START_FIRING ) {
animState( ANIMCHANNEL_TORSO, "Torso_Fire", 2 );
}
if ( AI_ATTACK_HELD && start_fire ) {
animState( ANIMCHANNEL_TORSO, "Torso_Fire_StartFire", 2 );
}
if ( AI_PAIN ) {
animState( ANIMCHANNEL_TORSO, "Torso_Pain", 0 );
}
}
}


Same native block on legs channel is works with AI_FORWARD fine.
I trying to acheive playng walk anim not only for legs but for torso too.

Why this is happens?

Thanks.
Title: Re: The AI_FORWARD don't handled by custom script
Post by: bitterman on March 13, 2018, 11:21:48 AM
Well, the lost anims in ai_player.script can generate an unexpected loops in "while (!animDone)" expression.

It can be checked via "listThreads" console command.

Done.
Title: Re: The AI_FORWARD don't handled by custom script
Post by: The Happy Friar on March 22, 2018, 02:15:09 PM
It is because of the main channels like you mentioned here: http://idtechforums.fuzzylogicinc.com/index.php?topic=632.msg6580#msg6580

Add more bones to channel and should work.