HELP BEFORE I GO CRAZY -coding Created 16 years ago2007-12-19 23:28:30 UTC by aaron_da_killa aaron_da_killa

Created 16 years ago2007-12-19 23:28:30 UTC by aaron_da_killa aaron_da_killa

Posted 16 years ago2007-12-19 23:28:30 UTC Post #241556
I have a huge headache and I'm about to go insane, I need some help :(

I'm trying to add a crow into half-life. I have the crow's sounds and model, thats not a problem. I managed to make a new entity called "npc_crow" and link that up to the crows model and all, thats fine.

Now I'm not going as far yet as to putting the crows AI in, but I want to know where the hell you define a monsters animations in the code. I tried to look up the zombies animations, and had no success. HOW THE HELL DOES THE ENGINE KNOW WHAT ANIMATION TO PLAY WHEN!?!?!?!?!?!?!?

This is where I need some help. Basically, I just want to make the crow do an idle animation (and the next step would be randomly more than one animation) and I want to be able to kill the crow, and (this is what I don't understand) to let the code know which animation is the crows death animation, and to make the killing of a crow act truly work (not that I am for the killing of animals).

Any help would be much appreciated. Sysops, you've been doing some ai/monster changes in arrange mode. Pietrekder, how did you do it with your poison zombie/poison head crab, how does the code know?!?!?!?!

Thanks in Advanced,
Aaron
Posted 16 years ago2007-12-20 09:28:48 UTC Post #241597
SetActivity( Activity NewActivity );
It sets the animation and ai for set activity, look it up.
(Activities also has to be defined in the model's .qc file)

An easier way to get just the animation is to use
pev->sequence = Number-of-animation.
pev->frame = 0;
ChickenFist ChickenFist<Witty Title>
Posted 16 years ago2007-12-20 10:59:52 UTC Post #241601
Yep, just call the setter method for the activity and set the parameter as the object of the new activity you want.
Posted 16 years ago2007-12-20 17:03:48 UTC Post #241629
You might want to look at the cockroach code too. It has a pretty simple random movement algorythm; I'm sure you could make your crow fly around and land on random objects with a couple of additions.
Daubster DaubsterVault Dweller
Posted 16 years ago2007-12-20 18:26:20 UTC Post #241633
Thanks so much guys, love ya all.

Daubster, I really like your idea of looking at the cockroach code. Thanks.
Posted 16 years ago2007-12-20 23:47:21 UTC Post #241637
I also suggest you look at how the alien_controller works so you can incorperate air waypoint navigation, to prevent them crashing into walls like cockroaches do
Posted 16 years ago2007-12-21 08:34:17 UTC Post #241660
Ahh, thats a good idea. Nice thinking.
Posted 16 years ago2008-01-02 20:14:56 UTC Post #242338
heh, if anyone solves aarons problem with the crow, then that means i no longer have a problem with adding a strider :biggrin:
Posted 16 years ago2008-01-04 08:21:52 UTC Post #242565
I solved the problem folks and thehalflifedude, it had nothing to do with the code, in fact it was the crows walk animation. I'll cut it short because I don't want to create a wall of text, the crow's walk animation behaved like it had the "LX" flag, but it didn't, I have to fix that.

By any chances, is any body here a good modeler, I have a different question, still related.
You must be logged in to post a response.