RE: Help with Enemies
To have a monster de-spawn, you can do a few things.
1) You could set a path for the monster to follow and put a script area in the path. Then run a script so that when the MONSTER collides with the SCRIPT AREA, it runs "SetEntityActive("MONSTERNAME", false);".... This will set him inactive, or in other words, remove him from the game.
2) Have him roam or follow a path like normal and run a timer for him to de-spawn, such as, when activated, in the same function he is activated, you can put in: AddTimer("despawnmonster", TIME *FLOAT*, "CALLBACKFUNCTION");
and in the callback function, SetEntityActive("MONSTERNAME", false); .... This does the same as above, but both have different requirements. Your choice, TIMED de-spawn? Or when he reaches an area, he despawns...
As for not making any noise, you would have to open him in the ModelEditor, go to Edit > User Defined Variables and scroll down to where it says "EnabledSound" and make it empty. Then save it in your "entities" folder (AS A NEW ENTITY, DO NOT OVERWRITE), AS WELL AS your Custom Story folder. The "EnabledSound" is the noise the monster makes upon being spawned. without it, he makes no noises upon activation... ALSO, If you need it, the "ActivationDistance" in the User Defined Variables tells the game how far the player must be before it de-spawns. if you are within the distance, the monster does not go away, however, when you are at a greater distance, the monster will de-spawn automatically. Tweak it if needed.
It's 1:30AM here and I was going to leave, but I figured I'd help one last time. XD Hope this helps!
(This post was last modified: 12-30-2011, 07:34 AM by Statyk.)
|