New NPC will not move.

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

New NPC will not move.

Postby Jangalomph on Thu Nov 24, 2011 5:48 am

Greetings,

I'm coding a Firelion, which is an antlion that breathes fire. I created a completely new class system so it has nothing to do with the normal antlions. I've made it use (Below) which is straight copied from the antlions, but Just replaces antlion with Firelion.

Code: Select all
typedef CAI_BlendingHost< CAI_BehaviorHost<CAI_BlendedNPC> > CAI_BaseFirelionBase;

class CNPC_Firelion : public CAI_BaseFirelionBase
{
public:

   DECLARE_CLASS( CNPC_Firelion, CAI_BaseFirelionBase  );

   CNPC_Firelion( void );


The problem is, The code compiles, but the NPC doesn't move. I've tried using "capabilitiesadd" and the npc still doesn't move. Its using the normal antlion model.

I was wondering would it have to do with the antlions model? I had to change all tasks, and animationevents etc from AE_ANTLION_... to AE_FIRELION LIKE SO.

Code: Select all
   DECLARE_ACTIVITY( ACT_FIRELION_ZAP_FLIP )

   //Events
   DECLARE_ANIMEVENT( AE_FIRELION_WALK_FOOTSTEP )


How can I tell the NPC to move?
If I use any same declaration such as AE_ANTLION_WALK_FOOTSTEP It automatically hates me and gives me .LNK errors from the antlions Object file saying its already declared. Hence, making a new class for the firelion.

Also editing firelion into the normal antlion code resulted in royally screwing the normal antlions up. So I made this totally new npc.


Last thing, I'm not sure if it has anything to do with the moving problem. But the NPC also doesn't die from explosions. :|


EDIT:

Current paste bin files.
npc_firelion.cpp
http://pastebin.com/US9p2HBZ
npc_firelion.h
http://pastebin.com/Aub6nFx5
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: New NPC will not move.

Postby zombie@computer on Thu Nov 24, 2011 9:16 am

you should probably rename all the activities as well (ie. ACT_FIRELION_BLAH).

I did the same modification to the antlion worker not too long ago, and it worked out fine. All i did was copy the filecontents to a new file and replaced all instances of ANTLION when referring to activities/cond/sched/task and the classname. Nothing else (that i can remember :p ).
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Oss, Netherlands

Re: New NPC will not move.

Postby Sandern on Thu Nov 24, 2011 10:10 am

If you use the same antlion model you should leave the ACT_ names the same, otherwise they don't match. Same applies to AE_. If you use a custom model you should use the names you used for those activities and animation events in your qc file of the model.

These custom activities and animation events shouldn't directly affect the moving of your npc though, since that uses a shared activity (ACT_RUN or ACT_WALK). Maybe you could check if the AI is stuck in some other task/schedule using one of the npc debug commands (like npc_tasks)?
Sandern
Regular
Regular
 
Joined: Thu Jun 30, 2005 1:08 pm
Location: Netherlands

Re: New NPC will not move.

Postby zombie@computer on Thu Nov 24, 2011 10:37 am

Ah, looking back at the code i merely replaced the antlion, not copied its class. Nevermind ;)
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Oss, Netherlands

Re: New NPC will not move.

Postby Jangalomph on Thu Nov 24, 2011 3:58 pm

For me, I completely copied all the antlion codes. In console it tells me it can't find the schedules which is total bogus because they are right there stated in the code! I kept the ACT_ANTLION etc and made it external. Because if I didn't list it as external it would give me linking errors.

If you look at the .cpp paste bin i have posted errors i've gotten all the way at the top in the comments section.

EDIT: for the lazy ones :P

Code: Select all
// ERROR: LoadSchd (CNPC_Firelion): (SCHED_FIRELION_JUMP) Unknown task TASK_ANTLION_FACE_JUMP!
 
// ERROR: LoadSchd (CNPC_Firelion): (SCHED_FIRELION_JUMP) Unknown task TASK_ANTLION_FACE_JUMP!
 
// ERROR: file contains a schedule (SCHED_FIRELION_JUMP) that has already been defined!
      // Aborting schedule load.
 
//Couldn't find schedule (SCHED_FIRELION_FLIP)
//GetScheduleOfType(): No CASE for Schedule Type 99!
//Couldn't find schedule (SCHED_FIRELION_FLIP)
//GetScheduleOfType(): No CASE for Schedule Type 99!
//Attempted to create unknown particle system type "FirelionGib"!
//Attempted to create unknown particle system type "FirelionGib"!
//Couldn't find schedule (SCHED_FIRELION_FLIP)
//GetScheduleOfType(): No CASE for Schedule Type 99!
//Attempted to create unknown particle system type "FirelionGib"!
//Couldn't find schedule (SCHED_FIRELION_FLIP)
//GetScheduleOfType(): No CASE for Schedule Type 99!
//Couldn't find schedule (SCHED_FIRELION_FLIP)
//GetScheduleOfType(): No CASE for Schedule Type 99!
 


Various errors i've gotten in debug mode.
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: New NPC will not move.

Postby Gary on Thu Nov 24, 2011 4:12 pm

You could of just modified the Antlion code and turn them into FireLions via keyvalue and/or input.

Couple of if statements and you would save your self a lot of trouble.
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: New NPC will not move.

Postby Jangalomph on Thu Nov 24, 2011 4:19 pm

Last time I tried this, I tried copying all the worker codes inside of the antlion.cpp and making them firelion but thats called royally screing up you acid lions and normal antlions. It just doesn't work right. I don't see how its possible to make new classes of something inside of an existing NPC. I tried making my wastelandscanners based off of the normal cscanner code. And added a new class, but it messed up all the other ones.
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: New NPC will not move.

Postby [Steve] on Thu Nov 24, 2011 6:09 pm

hmm rather than start a new thread i thought id post here, im having a simaler problem,

Ive been working on converting hl2 npc's to the asw engine, everything is working great, however some npcs just stand there when spawned.
the Zombie and headcrab, both move when spawned,
but the combine, metrocop, antlion, just stand there unless u shoot one then they kinda come to life, or if u spawn a headcrab and it attacks one of the above , they then come to life .
ive debugged the relationships and they are setup correct, just seems ive broken something, but with no error its difficult to pinpoint the problem.

any ideas on what could be causing this?
User avatar
[Steve]
Interlopers Staff
Interlopers Staff
 
Joined: Fri Mar 06, 2009 11:25 pm

Re: New NPC will not move.

Postby Gary on Thu Nov 24, 2011 7:09 pm

There is so very much the NPCs rely on that just isn't there in ASW.
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: New NPC will not move.

Postby [Steve] on Thu Nov 24, 2011 7:11 pm

true, but im pretty sure ive ported all if not most of it. as mentioned, the headcrab and zombie work fine, as does the antlion guard.

edit : it seems ive overlooked somthing, i didnt think to check before but the ASW_drone and asw_boomer and ASW_buzzer are also now broke ! they spawn but do not react unless shot, seems the same bug is affecting these npcs aswell

pic just to show the zombie working,

Image



edit: update ! seems if the zombie kills you, when you respawn he is then suffering from the same bug! he cannot see you or does not try to attack you, unless you shoot him and then he will come after you again.
User avatar
[Steve]
Interlopers Staff
Interlopers Staff
 
Joined: Fri Mar 06, 2009 11:25 pm

Re: New NPC will not move.

Postby Jangalomph on Thu Nov 24, 2011 10:14 pm

I guess you just can't make new npcs.
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: New NPC will not move.

Postby Gary on Thu Nov 24, 2011 10:33 pm

Some mods have NPCs, look at HumanError. It has a fully custom NPC.
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: New NPC will not move.

Postby Jangalomph on Thu Nov 24, 2011 11:42 pm

But this is so stupid. It really irritates me, There is nothing wrong at all with my code. Yet it just doesn't work. Tells me schedules arent there BUT THERE THEY ARE. wtf.
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: New NPC will not move.

Postby [Steve] on Fri Nov 25, 2011 12:02 am

custom npc's arnt that hard to implement, ill post code for a fireantlion when i get home,
User avatar
[Steve]
Interlopers Staff
Interlopers Staff
 
Joined: Fri Mar 06, 2009 11:25 pm

Re: New NPC will not move.

Postby Jangalomph on Fri Nov 25, 2011 12:16 am

All I want basically is a duplicate of the antlion npc. Nothing changed. Just a duplicate. Thats all I'm trying to accomplish right now. I'll make the fire part via particles etc. I just don't understand what the problem is. Some one else doing it for me doesn't help me learn you know? I wan't to know whats wrong with MY code.
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC
Next

Return to Programming

Who is online

Users browsing this forum: No registered users