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 / Please help! I,m new to scripting.

Author
Message
prepe
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: phx. az.
Posted: 10th May 2007 03:47
Ok! I found this script on the net and need help please!

This is a script I found to destroy a entity by a switch. How do I use it, and why dose it heart me when I move into it?



Thanks for the help!

MikeB
17
Years of Service
User Offline
Joined: 5th Apr 2007
Location: My Computer, Shropshire, England
Posted: 10th May 2007 09:19
There is an easier way.......

Ok, open up the MAIN script of the entity to be destroyed by a switch. (You'll find it in C:\Program Files\The Game Creators\FPS Creator\Files\Scriptbank.)

Now, just after the first colon ( on every single line, add this:

activated=0


Ok, now add a line at the bottom of the script:

:activated=1:destroy

(The first colon translates as IF, the second translates as "THEN DO" and commas translate as AND.) So you build a script like:
if activated=1 then destroy
And translate to:
:activated=1:destroy.

Ok, now save that, and place your entity in the level, making sure his main script is the one you just edited, and that its name (the box at the top) is destroyswitch.



Ok, now add a switch (any switch) from the wall furniture set.
Place it in the level and right click.
Change the If Used field from what is already there (It will be Light or Remote Door) to the name of your entity (If you followed the tutorial right, this should be "destroyswitch")

Test the level.
Look at the entity.
Press the switch.
Boom! It died.


I hope that helped.... I haven't had time to test this yet, but there is no reason why it shouldn't work.

E.D.

prepe
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: phx. az.
Posted: 11th May 2007 01:59
Ok thanks, I will try it in a few when I get home!



Thanks

Prepe

prepe
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: phx. az.
Posted: 12th May 2007 07:44
i could not get it to work could you explane a little better sorry and thanks for your help


Prepe

Jock
17
Years of Service
User Offline
Joined: 14th May 2007
Location: UK
Posted: 18th May 2007 22:02
Is someone posting falsely noted/named scripts as a practical joke?

The first script Prepe posted at the top of the thread is surely designed to kill the player....it's a hurtzone script!

:state=0,activated=0,plrdistwithin=40:state=1,TIMERSTART,plraddhealth=-50
prepe
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: phx. az.
Posted: 18th May 2007 23:16
no it is a decal it is a heart zone type of entity that i found and if i am rong then lock delet or somithing but i want it to destroy when i get do somithing like kill someone ok no it is i hope it is not fake cuse i been messin with it i found it here on yhis forum if it is protected then tell me and delet the post i just want it to disaper whin i kill somone thats all

Jock
17
Years of Service
User Offline
Joined: 14th May 2007
Location: UK
Posted: 18th May 2007 23:37
I'm no script guru (just a newbie here!), but I thought that a negative value on plraddhealth was intended to hurt the player.... e.g plraddhealth=-50 would DEDUCT 50 points of health.

I didn't mean to suggest that you (Prepe) had posted a dodgy script, but that someone had posted one as a practical joke and you been the fall guy on it.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 22nd May 2007 07:24
This is no joke.
It looks like a script for an object you need to destroy. (by finding the switch)
This object was something that could hurt you if you got too close (furnace, force field defense, etc)

No joke really.

Don't forget to visit Conjured Entertainment
Jock
17
Years of Service
User Offline
Joined: 14th May 2007
Location: UK
Posted: 22nd May 2007 21:47
ah... I see it

:state=0,activated=1,plrdistfurther=40:destroy

and there would be switch with an ifused command to activate the object, which would automatically destroy it (I assume the switch is more than 40 units away...)


The more I'm learning here, the more I start to understand: FPSC scripting is very limited in itself...but the multitude of ways it's applied in-game is fantastic - Limited script on the engine's part, unlimited imagination on the scripters part.

Login to post a reply

Server time is: 2024-11-23 18:00:54
Your offset time is: 2024-11-23 18:00:54