|
Ok guys, as most of you know, the most basic and easiest
way of having your allies follow you or stay around you, is the friendly
chain.
However, when one gets to more advanced scripting with more
heaviliy scripted missions, one will want to have a bit more control over
ai.
First, you may want to know how to make a guy go to a specific node,
for this you need to be able to identify the guy and his node through
targetnames or script_noteworthy (works the same as targetname, see quote
box)
guy =
getent("node_runner","script_noteworthy");
|
Below here is a small script that
will make our guy go to a specific node
node_example() { node =
getent("da_node","targetname"); guy =
getent("node_runner","script_noteworthy"); guy.goalradius = 4; //makes sure
that this guy doesn't leave his node guy setgoalnode(node); guy
waittill("goal"); //wait 'till he has reached his
node }
|
After that, you can put him on the
friendly chain again, using the setgoalentity command, as in the example
below.
back_to_chain_example() { guy
setgoalentity(level.player); }
|
Then, as a last important thing,
you may want to know how to ,manually activate a certain friendly chain
trigger(that you could hide somewhere in the sky, and activate after a certain
event), for that we use the setfriendlychain
command:
activate_chain_manually_example() { chain =
getent("example_chain", "targetname"); level.player
setfriendlychain(chain); }
|
I have not tested all of this, but
it should work!
I hope this will help some of you with their
singleplayer maps
Flipsen
|