Author Topic: The AI_FORWARD don't handled by custom script  (Read 335 times)

0 Members and 1 Guest are viewing this topic.

bitterman

  • Sr. Member
  • ****
  • Posts: 309
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
The AI_FORWARD don't handled by custom script
« 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.

Code: [Select]
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.
« Last Edit: March 13, 2018, 01:07:20 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 309
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: The AI_FORWARD don't handled by custom script
« Reply #1 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.

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 904
  • Karma: +43/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: The AI_FORWARD don't handled by custom script
« Reply #2 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.