NPC Programming in Source

Grab your favourite IDE and tinker with the innards of game engines

NPC Programming in Source

Postby Corewarp on Sun Mar 11, 2012 3:15 pm

Alright so.

We've got NPC, let's call him Sam. He's a dog and his animations have been triple checked to make sure they link up with the activities.

Problem is, in-game he just stands there. Not even his idle animations plays. He doesn't want to walk, even when forced to. Giving his own NPC code he STILL doesn't want to walk even when specifically telling him which animations to play when and where.

Could I get another code to help me spot if there's an issue in my code or if there is a fix for this.
I don't have a problem posting code here, but Skype is prefered.
User avatar
Corewarp
Been Here A While
Been Here A While
 
Joined: Thu Mar 13, 2008 6:29 pm

Re: NPC Programming in Source

Postby ScarT on Sun Mar 11, 2012 6:57 pm

Which class does Sam inherit from?
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: NPC Programming in Source

Postby Corewarp on Tue Mar 13, 2012 2:03 pm

Tried with CAI_BaseNPC and CNPC_PlayerCompanion. Neither worked.
User avatar
Corewarp
Been Here A While
Been Here A While
 
Joined: Thu Mar 13, 2008 6:29 pm

Re: NPC Programming in Source

Postby Chris528 on Wed Mar 14, 2012 1:01 am

Did you declare your activities in your npc code?

For example this is how i did it in my npc code.
Code: Select all
AI_BEGIN_CUSTOM_NPC( npc_charger, CNPC_Charger )
   DECLARE_ACTIVITY( ACT_CHARGE_START )
   DECLARE_ACTIVITY( ACT_CHARGE_RUN )
   DECLARE_ACTIVITY( ACT_CHARGE_CRASH )
   DECLARE_ACTIVITY( ACT_CHARGE_STOP )
User avatar
Chris528
Member
Member
 
Joined: Sat Mar 01, 2008 10:21 pm

Re: NPC Programming in Source

Postby Corewarp on Tue Mar 20, 2012 3:13 am

Turns out the animator/rigger didn't link the appropriate activities to what was expected. It has been fixed.

related for the .qc file:

$sequence "Idle" "idle.smd" FPS 30 activity ACT_IDLE 1 loop
User avatar
Corewarp
Been Here A While
Been Here A While
 
Joined: Thu Mar 13, 2008 6:29 pm

Return to Programming

Who is online

Users browsing this forum: No registered users