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 / If Destroyed Command?

Author
Message
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 5th May 2011 01:14
I can't seem to find a if destroyed kind of command? Does anyone know it? Thanks.


Cheers.

God help me, Please.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 5th May 2011 09:53
Are you looking for a condition for an entity that is destroyed? I don't think one exists, but you can utilise the "destroy" script which is only ran when the entity is destroyed. Maybe create a variable called EntityDestroyed and only set it to 1 when the destroy script is ran.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 5th May 2011 15:21 Edited at: 5th May 2011 15:47
So is there a EntityDestroyed command or not? If not is there a strengthless command for those entities without health?


Cheers.

God help me, Please.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 5th May 2011 15:27
There is no "entitydestroyed" script condition in stock FPSC, but I beieve you can generate a work-around using the destroy script.

The solution really depends on what you are trying to do. If you give me some more information I can try and find a suitable solution for you.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 5th May 2011 15:47
Ok, well I'm trying to activate something when a door is destroyed by the player(not by the destroy command). I have tried everything like health, quantity, and destroy but nothing works. If only there was a strength command like how there is a health command (ex. healthless, strengthless). Sadly since doors don't have health I can't use the health... Actually if I set the doot to have something like this:



Do you think that this would work with a door?


Cheers.

God help me, Please.
Anigma
13
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 5th May 2011 15:57
There is no "entitydestroyed" condition and here's why: Most conditions in FPSC apply to the entity running the script. How far away from *ME* is the player? How much health do *I* have left? Can *I* see the player from here? Etc. There's no way for it to ask itself "Am I dead?" because if it can ask, it's not dead. Dead things (including FPSC entities) don't do anything, including check themselves for conditons.

Depending on what you're trying to do, you may be able to accomplish what you want by, as Ched said, using a variable that gets set during the destroy event. That will let the other entities around it know that ONE of the entities running that script has been destroyed. If you need to know when ALL of them have been destroyed then that's a little different - you want to ADD to the variable during the destroy event and then script the other entities to react when the variable equals the total number of entities that you're waiting for the player to destroy. The key to remember is that main scripts will loop, i.e. run over and over. Destroy scripts don't - they run once and then stop when the entity running them is destroyed (or suspended).

It compiled! Ship it!
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 5th May 2011 16:03
I understand now.

when i say destroy script, I don't mean the destroy command.

Every entity has at least three default scripts: Start, Main & Destroy.

The Start script is ran once when the entity is spawned.
The Main script is looped as long as the entity is 'alive'.
The Destroy script is ran once when the entity is destroyed.

So i think the effect you are after is relatively easy to achieve.

Create an "ActivateOnDeath.fpi" script that contains the following:

You may want to add more to the script if you have a death animation to play or want to fade the entity out before destroying it.

Put the script in the door's destroy script path and your entity should spawn when the door is destoryed.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 5th May 2011 16:12
Thank you guys very much. I understant what to do now. Thanks.


Cheers.

God help me, Please.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 5th May 2011 23:56
I don't know why I just completely forgot about the destroy script. I was trying to fit it all in the main script. Thanks Again.


Cheers.

God help me, Please.

Login to post a reply

Server time is: 2024-11-24 09:07:05
Your offset time is: 2024-11-24 09:07:05