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 / advanced door timer

Author
Message
Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 16th Dec 2008 22:23
I have searched for timers on doors but they aren't what I need.

So, here is the rundown. The player enters the bay, then five of the doors opens up, and spawns an unlimited amount of alien critters,(Maximum at a time: lets say twenty.) There are five switchs, each that will shut the doors next to them. This works fine, but I wanted it more challenging. Each of the switches needs to re-open the doors after 20 seconds or so. In order to stop the creatures from spawning, you have to shut All five doors, then the timers stop, and the doors will never open again. I'm sure this is possible, but I'm terrible at scripting

,thanks.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 16th Dec 2008 23:59 Edited at: 17th Dec 2008 00:02
It sounds like you need multiple timers. (one for each door)
I just gave a script to the community that utilizes multiple timers.
You could use that script and have each door or its switch use a separate variable.
The example I gave has five timers, so it would work for this perfectly.

Quote: " I'm sure this is possible, but I'm terrible at scripting"

I might as well start offering my scripting services for hire.
How much is it worth to you , or did you want it for Free?

Don't forget to visit Conjured Entertainment

Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 17th Dec 2008 02:12
I think that this is an important addition to what I have created already. I'm slowly figuring out some of the scripting. I might just pause on this level, (as that is the end before and animated movie at the end of this level), and come back soon.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 17th Dec 2008 03:46 Edited at: 18th Dec 2008 04:13
That's the spirit.

Just like using placeholders for unfinished models. (skip it and move on)
You can always go back later to sort it out, so no since it halting for a setback.

I was only kidding about charging you.
I wrote the first three scenes for my movie treatment today, and I want to stay with it until I am finished.
Maybe I can find some time soon if I take a break and sort this out for you.
If I do, it will only be the scripts for the switches to operate remote doors via the multiple timers.
You will have to handle the character spawns on your own.
I have a final exam this week, but maybe I can play with this a little tomorrow and see what I can come up with.

Edit
Well lucky you, your wait is over already.
I found time today to play with this. (put off my exam until tomorrow)
It took me most of the day, but I was distracted on many occasions.
Anyway, through trial and error and lots and lots of test builds, I finally got it to work.
It does everything you wanted it too, and each doors timer is reset when the door is closed so you get 20 seconds from that point.
When all doors are closed the timers stop (perpetual reset), however if one of the doors is re-opened, then all timers start again and the other 4 doors will open after 20 seconds like they normally would if all the doors are not closed.

Make sure you use segments for doors and not entites.
I used the ww2/scenery/Door Vault (remote) for the doors in the test.
The switches used for the test were those ones with the hands in entities/scifi/wallfurniture/lightswitch1

There are ten files in the ZIP
1 - Instructions (Word Doc)
1 - DDS Image for display (you'll also need the numeral HUDs from my cash system for this display)
8 - FPI Script files (5 for doors, 1 for main timer, 1 for switches, 1 for trigger)

I hope you and others can learn something from these scripts.
There wasn't enough free time for comments, but you can add them as you figure it out.
Feel free to edit or distribute these scripts guys, but please leave the header at the top so people will know where the base script originated.

Have Fun!

Don't forget to visit Conjured Entertainment

Attachments

Login to view attachments
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 18th Dec 2008 16:18 Edited at: 18th Dec 2008 18:11
I guess I need to bump this so people will notice that I posted the solution here Yesterday.
Since I used the edit button, I don't think anyone noticed the download.
I guess I will post another Zip so this double post is for a reason.

So, here are the numbers 1 through 5 for the display in case you guys don't want to download the whole the cash system.


Place these 5 number images in the following path...

C:/Program Files/The Game Creators/FPS Creator/Files/languagebank/english/gamecore/huds/user


Don't forget to visit Conjured Entertainment

Attachments

Login to view attachments
Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 19th Dec 2008 23:06
Wow. Thanks. I followed the instructions but I'm a little confused, its having error's (Crashes, ect.) It may just be that I need to re-install fpsc, as there is problems every couple weeks. Do you still have the .fpm file? Btw, I peeked at the code, and nightmares came rushing back. It reminded me of when I was learning Java scripting. You're a genius for doing this.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 20th Dec 2008 01:32 Edited at: 20th Dec 2008 03:01
Quote: "I followed the instructions but I'm a little confused, its having error's (Crashes, ect.) It may just be that I need to re-install fpsc, as there is problems every couple weeks. "

You will need v1.09 or higher for the FPI variables. (this effect uses variables 70 to 75)
It was tested here with v1.12.
Which version gave you the errors?

1) You need to put all the files in their proper folders, so the scripts go in the scriptbank, etc.

2) Place your five doors in your map and name them door1, door2, door3, door4, and door5.
The doors each have their own script which handles their individual timers.
So, door1 gets the door1 script and door2 gets the door2 script and so on.
Assign the proper door script to each door's Main AI.

3) Place your five switches next to your doors and name them switch1, switch2, switch3, switch4, and switch5.
All of the switches share the same script, so assign the included switch script to all their Main AIs.

4) Put the door names in the IFUSED of the switches, and put the switches' names in the IFUSED of the doors.
So, door1 would go in the IFUSED of switch1, door2 would go in the IFUSED of switch2, door3 would go in the IFUSED of switch3, and so on.
AND switch1 would go in the IFUSED of door1, switch2 would go in the IFUSED of door2, switch3 would go in the IFUSED of door3, etc.
The doors and switches activate each other instead of the normal one way communication.

5) Place a dynamic (Static Mode = NO), invulnerable (Strength=0), immobile (IsImmobile=YES) entity in the map and set its ALWAYS ACTIVE to YES.
Now give this entity the timer script.

6) Place a dynamic (Static Mode = NO), invulnerable (Strength=0), immobile (IsImmobile=YES) entity in the map and set its ALWAYS ACTIVE to YES.
Now give this entity the trigger/display script. (it does both)

Can somebody else please try this and see if they have any problems with the install?

Quote: "Btw, I peeked at the code, and nightmares came rushing back. It reminded me of when I was learning Java scripting. You're a genius for doing this. "

Thanks, but Lee Bamber is the genius for creating the FPI scripting langauge.
I should probably go back and add the comments while it is still fresh in my mind.
It was a good idea and then it took a lot of trial and error.
I can assure you that it does work flawlessly on my end.
I hope we can get the install problems corrected.
Maybe the file is corrupted or something, so anyone else's efforts testing this would be greatly appreciated.

Quote: "Do you still have the .fpm file?"

yes

Here is the .fpm file if that helps.... (uses stock media)

The DANGER sign runs the global timer and the SECTOR 12 sign is the trigger.
So, walk up to the sector 12 sign to activate the intial opening of the doors and the display telling you how many are open.

This effect worked out rather nicely and made a wonderful example of using the multiple timers script that I recently made.
I plan on using this in my games too, so thanks for a cool idea. (I hope you didn't mind me sharing the solution-I should have asked b4 posting it)
I might expand it and give the doors different amounts of wait time, so the player would have to close them in the right order to get them all closed.
Or that could be re-used later for extra difficulty.


Edit
I forgot to specify the exact path for the scripts.
The maintimer is ...
C:/Program Files/The Game Creators/FPS Creator/Files/scriptbank/user/timer

The rest of the scripts go here...

C:/Program Files/The Game Creators/FPS Creator/Files/scriptbank/user/5 doors

So you will need those folders to use the .fpm I included.
Just right click the doors, signs, and switches and you can see the paths that I used for the scripts.
Or you can reassign their AiMains to the paths where you put the scripts.
All of the IFUSED sections for the doors and switches are set for you already, so that should help.

When building your own map you won't have to have the same sub folders that I used, only when using this .fpm file.
You can put your scripts wherever you want in the scriptbank, since you will assign the path to each entity/segment manually anyway.


Don't forget to visit Conjured Entertainment

Attachments

Login to view attachments
Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 20th Dec 2008 02:20
Ok. I had,(and still have), Version 1.09. I followed your instructions and created a quick level using the default models in fpsc. I copied all of your script files into a folder called "door timer".
--------------------------------------------------------------------
Here's what happens: You start off with all the doors closed. When you walk over and hit a switch, the switch turns white. Then after 20 seconds, all the doors open in sequence. After you go around closing all the switch's, 20 seconds later they still open in sequence.

I must have messed up on Assigning a script to an entity...
Sorry for the trouble...

Attachments

Login to view attachments
Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 20th Dec 2008 04:03
by the way, since I lost my old Id and password, i have had to create a new Id, so I have to wait for my posts to be "checked", by mods or whatever, so you might answer my questions before I can ask them. Lol.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 20th Dec 2008 09:08
You don't hit a switch to activate it, the trigger does that when you enter the zone.

I have explained the setup twice, and there is no other way for me to explain it any better.

I gave you the .fpm file and I know it works, so keep playing with it until you figure it out.
Assigning scripts to entites/segments is pretty basic stuff.

Will someone else try this PLEASE!
Maybe you can explain it better.


Don't forget to visit Conjured Entertainment
Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 20th Dec 2008 22:53
As i said, because I'm still a "new user", my posts arrive very late. The second time you explained it, it worked. Then my other post for help showed up, which didn't need to. Thank you very much.

"YOU CAN DESIGN YOUR OWN FIRST PERSON SHOOTER GAMES-NO CODING REQUIRED!"-->Yeah, if you're lazy.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 21st Dec 2008 23:04
ok, glad you got it working.

Welcome to the forums.


Don't forget to visit Conjured Entertainment

Login to post a reply

Server time is: 2025-05-23 09:23:53
Your offset time is: 2025-05-23 09:23:53