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 / Any way to script a trigger zone to destroy?

Author
Message
Fyfer08
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: Scotland
Posted: 3rd May 2011 00:23
is there a way to script a trigger zone to de destroy an entity?

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 3rd May 2011 03:00 Edited at: 3rd May 2011 03:00
Yeah, that's pretty simple..... I think.

For the triggerzone, use plrinzoneactivateifused.fpi for the main.
For the entity script, use default and add "activated=1:destroy".

Like so....



Brian.

Fyfer08
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: Scotland
Posted: 3rd May 2011 13:05
Could you not do this by setting the object you want to be destroyed to "if used" and them use the trigger zone?

frafra_95
14
Years of Service
User Offline
Joined: 27th Oct 2010
Location: Black Mesa Research Facility
Posted: 3rd May 2011 18:48 Edited at: 3rd May 2011 19:06
i think this will work, it doesn't destroy the zone but if you re-enter the zone nothing will happen... it just deactivates itself
Fyfer08
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: Scotland
Posted: 3rd May 2011 21:13 Edited at: 3rd May 2011 21:15
@xplosys I don't know if that will work as i dont want player in zone but entity

will this work?


Oh and what im actually trying to do is when and enemy enters a trigger zone it destroys an entity

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 3rd May 2011 21:46
You want an entity in a zone? I don't get it.

What I gave you above works. I wouldn't post it if it didn't. I'll go through it again.

1. Set a trigger zone and use plrinzoneactivateifused.fpi for the main script.
2. In the IfUsed field of the trigger zone put the name of the entity you want to destroy.
3. Use this script for the entity.


Brian.

frafra_95
14
Years of Service
User Offline
Joined: 27th Oct 2010
Location: Black Mesa Research Facility
Posted: 3rd May 2011 21:46 Edited at: 3rd May 2011 21:47
oh, well... this is not possible if you don't use this method:
in the zone script:

and in the entity script:

set activateallinzone and activated to 2 if you are alredy using activated check
hope this helps
Fyfer08
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: Scotland
Posted: 3rd May 2011 22:00
Yes but i don't want it when i enter a trigger zone but an enemy to enter the zone

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 3rd May 2011 22:51
Oh.

Then try what frafra_95 said. I haven't tried that so I don't know if anywithinzone will work with a character, but he says it will.

Brian.

Fyfer08
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: Scotland
Posted: 3rd May 2011 22:57
i made one with entity within zone...



frafra_95
14
Years of Service
User Offline
Joined: 27th Oct 2010
Location: Black Mesa Research Facility
Posted: 4th May 2011 16:18
does it work?
Fyfer08
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: Scotland
Posted: 4th May 2011 19:14
Nope when i start the game the plank isnt there i turned off physics and that too :/??

frafra_95
14
Years of Service
User Offline
Joined: 27th Oct 2010
Location: Black Mesa Research Facility
Posted: 4th May 2011 20:14
i don't think that entitywithinzone condition alredy exists...
Fyfer08
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: Scotland
Posted: 4th May 2011 21:05
what do you mean?

Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 5th May 2011 12:50 Edited at: 5th May 2011 12:51
Just to add my penny's worth, this is what I would do:

Zone's Main Script (headers, etc. have been removed):


Replace EntityToDestroy with the name of the entity you want to destroy.

The anywithinzone=1 condition will be true if the any entity, including the player, doors, lights, etc. , is within the trigger zone. So you'll need to make sure the trigger zone is free from any entities.

I always choose 666 as the activation value for destroying entities as i find it amusing, but you can set it to whatever value you want, just make sure it is the same value in both scripts.

EntityToDestroy's Main Script (If you plan on using a custom script for the entity to be destroyed just add this line at the top):


For information: the entitywithinzone condition does not work within FPSC - the condition is featured within the source code, but it does not do anything.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
frafra_95
14
Years of Service
User Offline
Joined: 27th Oct 2010
Location: Black Mesa Research Facility
Posted: 5th May 2011 16:29
Quote: "what do you mean?"


this:
Quote: "the entitywithinzone condition does not work within FPSC - the condition is featured within the source code, but it does not do anything."

Login to post a reply

Server time is: 2024-11-24 08:53:08
Your offset time is: 2024-11-24 08:53:08