lfnetwork.com mark read register faq members calendar

Thread: npc strange behavior
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-11-2004, 12:49 PM   #1
Bell
 
Bell's Avatar
 
Join Date: Jun 2002
Posts: 461
npc strange behavior

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

here is the script
Quote:
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?


Bell is offline   you may: quote & reply,
Old 07-11-2004, 02:28 PM   #2
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
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.


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 07-11-2004, 06:32 PM   #3
Mercenary
 
Mercenary's Avatar
 
Join Date: Jun 2002
Posts: 381
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.
Mercenary is offline   you may: quote & reply,
Old 07-12-2004, 01:17 PM   #4
shukrallah
White Dragon
 
shukrallah's Avatar
 
Join Date: Nov 2002
Posts: 3,250
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.


Quote:
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.


Quote:
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.
shukrallah is offline   you may: quote & reply,
Old 07-12-2004, 07:29 PM   #5
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
Quote:
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.

Quote:
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.


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 07-12-2004, 07:41 PM   #6
shukrallah
White Dragon
 
shukrallah's Avatar
 
Join Date: Nov 2002
Posts: 3,250
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)

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.
shukrallah is offline   you may: quote & reply,
Old 07-13-2004, 11:42 PM   #7
Bell
 
Bell's Avatar
 
Join Date: Jun 2002
Posts: 461
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?


Bell is offline   you may: quote & reply,
Old 07-14-2004, 03:30 AM   #8
Mercenary
 
Mercenary's Avatar
 
Join Date: Jun 2002
Posts: 381
You should read this tutorial:
http://www.map-center.com/modules.ph...ewtopic&t=1519

It gives good explanations on the sp navigation system and tells you how to place the entities properly.
Mercenary is offline   you may: quote & reply,
Old 07-14-2004, 04:50 AM   #9
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
Quote:
Originally posted by Raven
>Never name 2 waypoints with the same targetname.
Radiant does that regularly, doesn't it? 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


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 07-14-2004, 11:27 AM   #10
shukrallah
White Dragon
 
shukrallah's Avatar
 
Join Date: Nov 2002
Posts: 3,250
Well, JK2Radiant used to change the targetname automatically, by adding a 1, 2, 3 etc...
shukrallah is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Mapping > npc strange behavior

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:21 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.