Jump to content

NPC Behavior


Recommended Posts

Posted

I've followed a tutorial and managed to get my NPC to wander. When you fire at him he runs to the nearest combat point and returns fire along the way. But, when you don't fire at him, you have to be right up next to it or it will ignore you. Is there anything in Behaved I can add to the script to make the NPC see me earlier?

 

Here is the script.

 

//Generated by BehavEd
 
set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_WANDER" );
set ( /*@SET_TYPES*/ "SET_RUNNING", /*@BOOL_TYPES*/ "false" );
set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_ANGERSCRIPT", "icestationwampa/alert1" );
 
here is my alert script
 
flush (  );
set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_DEFAULT" );
set ( /*@SET_TYPES*/ "SET_RUNNING", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "false" );
 
Posted

What does this script look like?

flush (  );
set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_DEFAULT" );
set ( /*@SET_TYPES*/ "SET_RUNNING", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "false" );
Posted

Maybe your problem lies in the .npc file. Try setting hfov/vfov to higher values (if they're set at all). Same for "earshot".

 

I think I can set this stuff in BehavED from what I glanced over in the manual. Now, where would I add those script lines to? Would I put it in my Wander script or would I put it in the Alert Script?

Posted

I think it has to do with the SET_BEHAVIOR to WANDER.  I tried what was mentioned but it didn't work. I also switched the BEHAVIOR to SEARCH. My npc will walk from the spawnpoint to the first waypoint but then stops. Now, If he sees me before he gets there, then he'll run to the combat points. But, once he gets to the waypoint, thats it.  He just sits there.

 

I think I have to use nav goals instead of WANDER for the NPC's to fire at me on their own.

Posted

for a correct fight, the BEHAVOUR must be on DEFAULT, or, the NPC will fight in a squad with a commander, in BS_FOLLOW_LEADER and yu need to set the leader in another set line command.

if yu have problem to force NPC to exit by wander state, try in the anger script SET_BEHAVOUR_STATE BS_WANDER : False.

SET_BEHAVOUR_STABE BS_DEFAULT, True.

but it's strange, for me, was every make sufficient to switch by a state to another for solve that's problem. I have a NPC that go in BS_WANDER state in a battle for feed his energy and restore health, and after return of plater and another char there is a movie, at the end of the movie, the wound NPC get full health and switch to combat without problems, he run to a door, open with a magical spell and go inside the door and disappering. the door open in the other side of the hallway and ,...

player and his friend attack enemies by behind, the ex wandering NPC appear by door and strike enemy surprising at the back.

Yes, i that in my mod. O.o

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...