Frictional Games Forum (read-only)

Full Version: Scripting around a (disappearing) enemy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Okay this is kind of a broad problem I've been having with scripting around enemies. A few of my scripts are based around enemies going to a certain place or doing a certain thing, but when the enemy disappears before it can accomplish this, it causes me lots of problems. In some cases I've managed to work around it, but in others it's purely aggravating.

I know there have got to be ways to work around this. I remember that in the main game, no matter what I did that first grunt in the Storage area would not disappear.

Here's the latest example:

In my newest map, the player has to lure an enemy into a certain area in order to trap it. Once it's trapped, it triggers a script necessary to advance in the game. Most of the time, it's not a problem; the map is very small and it's scripted to patrol around an area very close to the trap.

However, if for example it spots the player right when it spawns and the player quickly runs to the other end of the map before it can give chase, the conditions will be just right for the monster to disappear. Then the player can't advance in the game.

I'm trying really hard to find a workaround, but I can't seem to find a way. I can't find a way to stop the enemy from disappearing, and I can't find a way to respawn it in case it does disappear. I've tried using GetEntityExists, but it seems to detect the enemy even when it's disappeared.

Any ideas, fellas?
But YC if you give it a pathnode, it will disappear when it has done the pathnode
Is it neccessary to add the PathNodes one by one as it reaches each PathNode?

I currently have it follow six pathnodes in a circle, and then have a Script Area add them again when it reaches the beginning of the circle. I usually use for loops, but thought this would be a better way to keep it from disappearing. Is this acceptable, or do I have to add them one by one like you did in your video?

Also, I'm not sure if it matters, but when it disappeared on me, it hadn't even reached its first PathNode yet. It had just spawned and was headed toward its node when it spotted me and I ran. I sat and waited for it to arrive at its node, but it disappeared. Maybe this doesn't matter, as the grunt in your video seemed to disappear before it reached its destination too.

Also damn I wish my dev/debug mode worked. Making a custom story of this length is hard without it.
ModelEditor -> Open servant_grunt.ent -> Settings -> User defined variables -> PlayerSearchTime -> Change this value and play around with the other values too to ensure that the grunt won't despawn.
(10-23-2012, 07:33 AM)Ongka Wrote: [ -> ]ModelEditor -> Open servant_grunt.ent -> Settings -> User defined variables -> PlayerSearchTime -> Change this value and play around with the other values too to ensure that the grunt won't despawn.
This could cause some problems when he's going to make other grunt encounters, when and how would they now dissapear?
He doesn't have to replace the original one, he can save it as grunt_2 or whatever he wants. And even if he would replace it (bad idea), he still could script that the grunt has to disappear after a specific time or when he reaches a pathnode.
(10-23-2012, 09:13 AM)Ongka Wrote: [ -> ]he can save it as grunt_2
Forgot everything about that, well then it might actually be a solution, my mistake, i apologise ^^
(10-23-2012, 07:01 AM)beecake Wrote: [ -> ]But YC if you give it a pathnode, it will disappear when it has done the pathnode

Why would it disappear when reaching the last path node when you edited the ENT file for it not to do so?
(10-23-2012, 07:28 PM)Your Computer Wrote: [ -> ]
(10-23-2012, 07:01 AM)beecake Wrote: [ -> ]But YC if you give it a pathnode, it will disappear when it has done the pathnode

Why would it disappear when reaching the last path node when you edited the ENT file for it not to do so?
My monster happened to do so... But i might be wrong. You're nearly always right YC Smile
Pages: 1 2