Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Not spawning when in line of sight of the player

Author
Message
bobbyisthebest
13
Years of Service
User Offline
Joined: 12th Mar 2011
Location:
Posted: 30th Nov 2011 19:55
Hi, just wondering if there is a way to prevent something from spawning if it is in line of sight with the player.

I have an enemy that respawns but I don't want it to respawn if the player it there.

Maybe I can have it destroy itself when it spawns if it is in sight of the player. Can I do that without the player seeing it happen?

Help me.... I'm new!
angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 1st Dec 2011 16:40
put this into the enemy's script after everything else

:activated=1:etimerstart
:etimergreater=100,inview=1:activated=0,destroy
:etimergreater=100,inview=0:activated=0

untested, it should, once activated start a timer that will destroy the entity in the blink of an eye. If that's not fast enough, removing all the timer related stuff should make it instant. Also timers never work for me so I wouldn't use them anyway

I appear to have burst into flames...
bobbyisthebest
13
Years of Service
User Offline
Joined: 12th Mar 2011
Location:
Posted: 2nd Dec 2011 19:24
I'm already using a timer in my game. Can I have more than one?

Help me.... I'm new!
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 5th Dec 2011 10:43
Quote: "I'm already using a timer in my game. Can I have more than one?"


fpsc is using 2 commands for that:

timerstart / timergreater=X is a global variable wich you can only use once a time.

etimerstart / etimergreater=X is a specific variable used for a specific entity. you can run it once PER ENTITY, so "endless" timers possible in a map when using this. "e" for entity.

Login to post a reply

Server time is: 2024-11-24 03:23:45
Your offset time is: 2024-11-24 03:23:45