lfnetwork.com mark read register faq members calendar

Thread: More scripting stuff
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 09-19-2002, 12:42 AM   #1
JavaGuy
 
JavaGuy's Avatar
 
Join Date: Aug 2002
Posts: 141
More scripting stuff

Here's the script:
*******************************************
rem ( "Script to make stormtroopers chase Kyle" );
rem ( "parm1: NPC_targetname of stormtrooper" );
rem ( "parm2: Navgoal to which to run" );
declare ( STRING, "nav1" );
set ( "nav1", get( STRING, "SET_PARM2") );

affect ( get( STRING, "SET_PARM1"), FLUSH )
{
set ( "SET_IGNOREENEMIES", "true" );
set ( "SET_BEHAVIOR_STATE", "BS_CINEMATIC" );

task ( "gonav1" )
{
set ( "SET_NAVGOAL", get( STRING, "nav1") );
}

dowait ( "gonav1" );
set ( "SET_ENEMY", "kyle" );
set ( "SET_IGNOREENEMIES", "false" );
set ( "SET_AGRESSION", 5 );
set ( "SET_BEHAVIOR_STATE", "BS_DEFAULT" );
}
*******************************************

I set parm1 to "stormtrooper1", which is the shared npc_targetname of a bunch of stormtroopers. I set parm2 to "rock1", which is the targetname of a nav point near some rocks. The nav point has a radius of 50, and it's declared as a waypoint_navgoal, so I know it's legal to set a radius for it. So far so good. Now when the script runs, what I want to happen is that the stormtroopers run over to the rocks _first_ and then attack (hence the ignore enemies, which seems to be necessary even when they're in cinematic behavior state).

What really happens is that _one_ of the stormtroopers does exactly what I want/expect the script to make him do, while the others just stand their ground and start shooting at me.

Any advice?
JavaGuy is offline   you may: quote & reply,
Old 09-19-2002, 04:50 AM   #2
idontlikegeorge
 
idontlikegeorge's Avatar
 
Join Date: Jun 2002
Location: Striking fear into the hearts of Demolicans and Republicrats.
Posts: 951
well, since one of them does what the script says and the others dont, maybe it doesnt like multiple npc_target names; or maybe, the script for some reason only runs once

the only thing i can see that might work, is maybe try having each stormtrooper entity call the script; but that probably isnt the optimal way to do it...
idontlikegeorge is offline   you may: quote & reply,
Old 09-19-2002, 10:58 AM   #3
JavaGuy
 
JavaGuy's Avatar
 
Join Date: Aug 2002
Posts: 141
That seems to be it, since I changed one of the stormtroopers to be called stormtrooper2, then copied my scriptrunner and changed the new one's parm1 to stormtrooper2, and now I see two troopers doing what I wanted and the rest standing around.

That's actually kind of cumbersome, but hey, getting things exactly the way one wants them in life usually requires some work.
JavaGuy is offline   you may: quote & reply,
Old 09-19-2002, 03:18 PM   #4
Catscratch
 
Catscratch's Avatar
 
Join Date: Jun 2002
Location: istanbul, Türkiye
Posts: 171
hmm.
Select a boss out of your storm troopers. Probably the nearest one to the trigger.
Give him a NPC_targetname "st_boss" for example.
Give the others a NPC_targetname "st_marines" for example.
Make a script that sets the marines leader as "st_boss" and give marines the behavior state of Follow Leader. Set this script as the spawnscript of each stormtrooper except the boss.

The trigger entity should trigger a target_scriptrunner.
The script ,which target_scriptrunner uses, should set the leader's (st_boss) nav goal to any navgoal 4 in the map. Navgoal uses targetname, not script_targetname. You would set the leader's running value to true before setting navgoal. You can also set "st_marines" to run with this script.

The script should use two affect commands, one for st_boss and one for st_marines.

Now. I didnt try to stop them firing while they are on the move, but this method makes the other stormtroopers to follow their leader and the leader goes his navgoal with the others following him. You can modify the second script to make them just run insted of running and shooting at the same time.

I hope you got the idea.


This cat scratches free.
Catscratch is offline   you may: quote & reply,
Old 09-20-2002, 01:28 AM   #5
JavaGuy
 
JavaGuy's Avatar
 
Join Date: Aug 2002
Posts: 141
How do I set the leader? I know I use SET_BEHAVIOR_STATE to make them follow him, but how do I tell them who the leader is?
JavaGuy is offline   you may: quote & reply,
Old 09-20-2002, 01:49 AM   #6
JavaGuy
 
JavaGuy's Avatar
 
Join Date: Aug 2002
Posts: 141
Doh! Never mind. I should have tried the most obvious solution before I asked.
JavaGuy 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 > JO Mapping > More scripting stuff

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:01 PM.

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