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 / Destroy an entity if an enemy dies

Author
Message
Yearcut
User Banned
Posted: 26th Dec 2009 05:48
I have a game where player have to go upstairs to complete the level. But i want to restrict the player so s/he cannot go upstairs until s/he shoots all the enemies. So, i have put a invisible wall in front of the stair so the player can't go through it. But is it possible to make the invisible wall destroy if all the enemies dies?

Thanks in Advance!

-YearCut

Your signature has been erased by a mod. please make it no larger than 9999999 x 9999999
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Dec 2009 07:06
The invisible wall needs to be a dynamic entity, first off. If it is, then great!

In your enemies' destroy scripts, have them increment a variable by 1 before they are destroyed (via the "destroy" command)

Have your invisible wall's script check this variable for when it reaches the number of bad guys that need to die. When the variable is at that number, have it destroy itself (again, via the "destroy" command)


The one and only,


The Master Dinasty
16
Years of Service
User Offline
Joined: 14th Sep 2008
Location: Valhalla
Posted: 26th Dec 2009 11:45
Quote: "The invisible wall needs to be a dynamic entity, first off. If it is, then great!

In your enemies' destroy scripts, have them increment a variable by 1 before they are destroyed (via the "destroy" command)

Have your invisible wall's script check this variable for when it reaches the number of bad guys that need to die. When the variable is at that number, have it destroy itself (again, via the "destroy" command)


The one and only,
"


Cant you just make it so when badguys health reaches zero, run the destroy script to invisible wall? Thats how i would do it anyway.




-Massap2

Beacause massa is the master!
Staring blankly at the sun waiting for my time to come...
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 27th Dec 2009 09:12
Well, he made a mention of "shoots all the enemies", so I was under the assumption that there would be multiple enemies needing to be killed and not a specific one.


The one and only,


Yearcut
User Banned
Posted: 27th Dec 2009 10:38 Edited at: 27th Dec 2009 13:16
Quote: "Cant you just make it so when badguys health reaches zero, run the destroy script to invisible wall? Thats how i would do it anyway.
"

It is going out of my mind. Can you please explain it in detail Massap?

And plystire, can you please tell me the commands i can use, and which script to put in which entity?

Sorry if i sound like noob, but i have not touched fpsc for last 2 weeks.

-YearCut

Your signature has been erased by a mod. please make it no larger than 9999999 x 9999999
The Master Dinasty
16
Years of Service
User Offline
Joined: 14th Sep 2008
Location: Valhalla
Posted: 27th Dec 2009 11:22
Quote: "Thanks Plystire.... and Massap2"


If you are going my way remember that you need a costume death script or else you would kill everything on the map.







-Massap2

Beacause massa is the master!
Staring blankly at the sun waiting for my time to come...
Yearcut
User Banned
Posted: 27th Dec 2009 13:26
EDITED previous post (sorry)

Your signature has been erased by a mod. please make it no larger than 9999999 x 9999999
The Master Dinasty
16
Years of Service
User Offline
Joined: 14th Sep 2008
Location: Valhalla
Posted: 27th Dec 2009 14:02 Edited at: 27th Dec 2009 14:03
I would for example



and you would need to insert the "death" script to the wall , but if you use a regular one i think every one with the asigned script would destroy just copy a "death" script and rename it that should do the trick.
(btw that code may not work i dindt bother to open FPSC and script editor...

Hope you can find this usable.

-Massap2

Beacause massa is the master!
Staring blankly at the sun waiting for my time to come...

Login to post a reply

Server time is: 2025-05-27 18:39:47
Your offset time is: 2025-05-27 18:39:47