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 / Using a switch/button/any entity to spawn multiple objects - script for you all!

Author
Message
piXX3D
17
Years of Service
User Offline
Joined: 27th Mar 2007
Location: Nowhere
Posted: 25th Nov 2008 08:48
Hey all,

By recommendation I have posted this script here for you to use for whatever necessary.

It's a pretty flexible script, so theres quite a few things it can do.

WHAT IT DOES: (in a nutshell)

You link this script to an entity, such as a button or switch
Upon using the button or switch in game, it will spawn the object in its ifused field
Once that object has been spawned it can then go on to spawn a further two objects, enabling the player to spawn three different objects with one switch

I am using this script for my entry in the Xmas puzzle game competition. However you are free to use this in whatever.

THE SCRIPT:



HOW TO USE: (Read carefully!)

1. Create a switch - I wrote this script based around "switch2.fpi", so whether this works on other objects other than those using switch2.fpi is uncertain - please tell me if you find out. I recommend using this on the liftswitch found in Sci-Fi/Wall furniture for a good starter.

2. Make your three objects. Although the script is easy enough to adapt to allow four, five, six etc. objects to work with a bit of copy/pasting.

In the script I have called the three objects object1 object2 and object3, although if you rename the objects make sure you change it in the script. You may notice object1 isn't referenced in the script... put the name of the first object in the switch's IFUSED field.

3. Position objects 1, 2, and 3 around your map where you'd like them to appear. Give them these settings in the editor:

Spawn at start: No
Max at any time: 1
Maximum spawn: 1


You can leave everything else. Changing the Max at any time and the Maximum Spawn options as you like them will give some interesting results...I'll leave you to experiment

4. Run the game... and you are done! Upon pressing the switch, first object1 will appear. Pressing it again makes object2 spawn, and a third time will create object3.

Any problems, post them below in this thread, and good luck!

Have a nice day!

~ piXX3D
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 25th Nov 2008 19:25
...very generous of you, piXX3D.

Great work on this. Most definitely will be of value to many folks, no doubt.

Thanks,

Seth Black


Maniac Modeler
16
Years of Service
User Offline
Joined: 15th Jan 2008
Location:
Posted: 26th Nov 2008 02:13 Edited at: 26th Nov 2008 02:14
This is great, you are very nice! Thank you so much!

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 8th Dec 2008 15:06
Could I add this to the guide piXX3D?

piXX3D
17
Years of Service
User Offline
Joined: 27th Mar 2007
Location: Nowhere
Posted: 8th Dec 2008 17:59 Edited at: 8th Dec 2008 18:05
Nickydude, please do! I'd be honoured

BTW, when will the next edition be coming out?
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 9th Dec 2008 11:36
Thanks

Quote: "BTW, when will the next edition be coming out? "


I'm gathering stuff as we speak.

Login to post a reply

Server time is: 2024-11-24 16:39:38
Your offset time is: 2024-11-24 16:39:38