Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

npc strange behavior

Page: 1 of 1
 Bell
07-11-2004, 12:49 PM
#1
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?
 lassev
07-11-2004, 2:28 PM
#2
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.
 Mercenary
07-11-2004, 6:32 PM
#3
I've had trouble myself with getting NPCs to walk to navgoals in JA. What I used in JK2 worked perfectly but not so in the new version. It's weird, sometimes the NPC hesitates then sprints to the navgoal. :confused:
 shukrallah
07-12-2004, 1:17 PM
#4
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.
 lassev
07-12-2004, 7:29 PM
#5
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.
 shukrallah
07-12-2004, 7:41 PM
#6
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.
 Bell
07-13-2004, 11:42 PM
#7
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?
 Mercenary
07-14-2004, 3:30 AM
#8
You should read this tutorial:
http://www.map-center.com/modules.php?name=Forums&file=viewtopic&t=1519)

It gives good explanations on the sp navigation system and tells you how to place the entities properly.
 lassev
07-14-2004, 4:50 AM
#9
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
 shukrallah
07-14-2004, 11:27 AM
#10
Well, JK2Radiant used to change the targetname automatically, by adding a 1, 2, 3 etc...
Page: 1 of 1