The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting around a (disappearing) enemy
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Scripting around a (disappearing) enemy

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?

(This post was last modified: 10-24-2012, 05:30 PM by Damascus.)
10-23-2012, 06:17 AM
Find


Messages In This Thread
Scripting around a (disappearing) enemy - by Damascus - 10-23-2012, 06:17 AM



Users browsing this thread: 1 Guest(s)