Jump to content

Home

npc strange behavior


Bell

Recommended Posts

my npc isn't walking to his nav goals he is force jumping to them.

 

here is the script

set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_CINEMATIC" );

set ( /*@SET_TYPES*/ "SET_WALKSPEED", 50 );

set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "true" );

set ( /*@SET_TYPES*/ "SET_RUNNING", /*@BOOL_TYPES*/ "false" );

set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" );

 

task ( "demowalk1" )

{

set ( /*@SET_TYPES*/ "SET_NAVGOAL", "demopro1nav1" );

}

 

 

task ( "demowalk2" )

{

set ( /*@SET_TYPES*/ "SET_NAVGOAL", "demopro1nav2" );

}

 

 

task ( "demowalk3" )

{

set ( /*@SET_TYPES*/ "SET_NAVGOAL", "demopro1nav3" );

}

 

 

task ( "demowalk4" )

{

set ( /*@SET_TYPES*/ "SET_NAVGOAL", "demopro1nav4" );

}

 

 

task ( "demowalk5" )

{

set ( /*@SET_TYPES*/ "SET_NAVGOAL", "demopro1nav5" );

}

 

 

task ( "demoturn" )

{

set ( /*@SET_TYPES*/ "SET_DYAW", 180.000 );

}

 

 

task ( "demosit" )

{

set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_STAND5TOSIT2" );

set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 );

}

 

dowait ( "demowalk1" );

dowait ( "demowalk2" );

dowait ( "demowalk3" );

dowait ( "demowalk4" );

dowait ( "demowalk5" );

do ( "demoturn" );

dowait ( "demosit" );

 

strange thing is.. i have two npc's with virtually the same script walking paralell paths..one does everything right, the other jumps from navgoal to navgoal...weird...any idea how to fix this?

Link to comment
Share on other sites

Is the jumping guy a force user and the normally walking a non-force user?

 

With JA came indeed this jumping behavior. It has delighted my a couple of times, once in the Team Corellia map and once in my current project, both times with a CLASS_JEDI NPC. It seems they are very precise with their requirements for waypoints and nav_goals. Especially if you are trying to build a route around some low obstacle.

 

There are two things you can try:

1) Adjust the nav_goals (and supporting waypoint network. Yes, the waypoint network to support nav_goals is of utmost importance in JA). Perhaps try a wider path around the obstacle. Notice that it doesn't need to be a great bulk in between. Some small detail can be quite enough. They jump very easily.

 

2) Try adding some NPC_noentry or NPC_noenter or whatever was the name of the shader. That might provide you another way to control the paths of the NPCs. Just be aware that it might easily just get the NPC stuck in place, if not used with caution.

Link to comment
Share on other sites

All I know is, if his behavior status is set to jump, then.. he will jump. If its set to cinematic it will (should walk)

 

The jumping thing is really cool, I remember in JK2 I was trying to throw my NPCs in the air to get them to jump. Now its much easier.

 

Make each of those tasks individually, like youll need to keep saying 'affect' NPC, task 'do task'.. etc... affect NPC task do task...etc

 

Its possible that it will work.

 

 

and supporting waypoint network. Yes, the waypoint network to support nav_goals is of utmost importance in JA).

 

 

Lassev, is it possible to make a bunch of navgoals, hook them together, and make an NPC walk from one navgoal to the next without a complicated and repeating script? Im just asking, because it would cut the scripting time down.

 

 

It's weird, sometimes the NPC hesitates then sprints to the navgoal.

 

Yeah, their AI is annoying, if you say bs_cinematic, they still 'want' to do what they 'want' to do. For example, If I tell Kyle to push a jedi, the other jedi will block the force, same with grip. I think this is what Raven used long animations, because NPC does exactly what they want, and Raven wouldnt have do as much scripting.

Link to comment
Share on other sites

Originally posted by lukeskywalker1

All I know is, if his behavior status is set to jump, then.. he will jump. If its set to cinematic it will (should walk)

But it doesn't. They are quite eager to jump while in the cinematic behavior state.

 

Originally posted by lukeskywalker1

Lassev, is it possible to make a bunch of navgoals, hook them together, and make an NPC walk from one navgoal to the next without a complicated and repeating script? Im just asking, because it would cut the scripting time down.

Just use ordinary waypoints. You can have a long and winding corridor and make the NPC walk all the way through with just one nav_goal and one script command. Place the first waypoint overlapping the NPC, and then just place a long line of them all the way to the very end where the nav_goal waits. Target the waypoints always to the next waypoint, of course.

 

The problem is that the NPC will ignore quite easily the waypoints if it sees the nav_goal. So, if there's a low obstacle in between (or chasm or something that doesn't block LOS but prevents movement) the NPC is quite ready to just stand there, going nowhere, even if the waypoint string should show the way. In these situations I found no other way than use multiple nav_goals and separate set_navgoal commands for each.

Link to comment
Share on other sites

Well, an NPC has never jumped for me unless I told it to. I guess it depends on the NPC/situation/script. It will probably happen eventually... like I said, there AI is still partially activated, even though it isnt supposed to be. Sometimes it benificial, but most of the time is annoying. Like in my trailer, heh, lucky me, I have no clue how to get Boba to fly forward, but he did... I got him to jump with the Jetpack on, I then froze him in mid-air (BS_noclip) then Later on I turned him to bs_cinematic, and he just moved forward (or randomly upward, untill he hit his head on the ceiling, I got lucky when I recorded, he flew straight) :D

 

Then I used an invisible Boba to jump into the hole.

 

Anyways.. thanks for the info. I would have scripted every corner, its good to know such tricks as the one you posted, it makes life easier.

 

EDIT: Bell, you dont need the set_running 'false' all you need is set_walking 'true' and it will forget about running.

Link to comment
Share on other sites

excellent thanks ya'll i'm going to fool with it and see if i can get it to work. I didn't realize the first waypoint has to intersect the player entity. Does the player entity need to be targeted to the first waypoint as well?

Link to comment
Share on other sites

Originally posted by Raven

>Never name 2 waypoints with the same targetname.

 

Radiant does that regularly, doesn't it? :confused: I could almost swear I have such waypoints that have the same targetname. It's kind of hard to avoid it, really, if you build a network that is anything more than a string.

 

But who knows, maybe this is the reason for some of my problems, although I doubt it.

 

Don't target the NPCs to any waypoints, that's not necessary. The AI handles such things. The NPC only uses waypoints if it cannot see the target location, due to loss of LOS :)

 

Naturally if there's any contradiction between anything I have said and what Raven said behind that link of Mercenary's, listen to Raven first. But if that doesn't work, then listen to me :p

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...