Scripting an NPC to Move Created 7 years ago2016-08-24 13:14:09 UTC by Ubique Ubique

Created 7 years ago2016-08-24 13:14:09 UTC by Ubique Ubique

Posted 7 years ago2016-08-24 13:14:09 UTC Post #331411
Hi guys,

I'm trying to get a grunt who is fighting off alien slaves that are warping in through various corridors to chase after a slave as it warps in around the corner from his initial position.

What is the best way to get the grunt who has just finished killing a slave to hear another slave warping in around the corner, causing him to run off to where the new slave is and attack it?

I have been messing around with trigger relays, path corners and scripted sequences but I can't get anything to happen.

Any advice would be appreciated, cheers.
Posted 7 years ago2016-08-24 15:05:44 UTC Post #331414
monster alien slave
triggertarget = sequence1
trigger condition = death

monster human grunt
name = bob

scripted sequence
name = sequence1
target = monstermaker1
target monster = bob
move to position = run
✓ no interruptions
✓ override AI

monstermaker
name = monstermaker1
monster type = monster_alien_slave

This setup should work, i think.
Posted 7 years ago2016-08-24 23:50:40 UTC Post #331423
Hi 2muchvideogames, thanks for the response.

I'm not starting with a slave, the slave warps in - using the warp in entities from Angry Carrot's example map:

http://twhl.info/vault.php?map=3157

Right now it's not working, after the first slave is killed, the grunt just stands there and I can't get his attention or kill him.

I should also mention that I don't want the grunt to run off to the other slave as soon as it is dead, I want him to walk over and inspect the dead body as he normally would, and THEN hear the new slave warping in and go run after it.

Does the scripted sequence need to be placed where you want the monster to run to, or is the monster able to find the entity you want it to go after by putting its name in the "target" field?
Posted 7 years ago2016-08-25 02:46:49 UTC Post #331424
that sounds unnecessarily specific...

1 - Monsters spawned from a monstermaker CANNOT run scripts or trigger conditions. (you would have to teleport it in from somwhere else)

2 - If you want there to be a delay between the slave dying and the grunt running, you will have to put a delay before trigger (in seconds) for the scripted sequence. You will have to time the delay to be exact with the other slave's warp.

3 - The scripted sequence will be where the monster runs to. Unless the path from the grunt to the squence is a straight line, the grunt might have a bit of trouble running to the sequence.

Scripted sequences do NOT work like path corners. you must put the monster grunt's name in the scripted sequence's 'target monster' field, I think. Also path corners are easily overriden by monster AI and can be interrupted just as easily. The reason to use scripted sequence over path corner is so that it's not interruptable, which is what you seem to want here
You must be logged in to post a response.