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 / Shoot several enemies to open a door

Author
Message
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 9th Jul 2007 14:27 Edited at: 17th Jul 2007 21:38
In some fps games I have played, you cannot open certain doors until an area in the current level has been cleared of all enemy characters. This is a solution in fpsc.

You will need to select a character and change their fpe file so I suggest making a copy of it and (if it exists) the bin file. Use the copied fpe file in the following process. When you view the entities in the map editor, you should see the copied character available for selection.

Using Wordpad to edit, add the line ifused = box to a characters fpe file in the ;ai section. Box is an entity we will use for a 'counter'.

In this example, I am going to use 3 copies of the same character.

Add the 3 characters to a game and change the destroy script to destroyandactivate.

Add a box entity to the game and change the name to box. Make sure you cannot use or destroy the box. It needs to be dynamic and zero strength (indestructable). Probably does not matter too much about it being movable but also ensure the name of the box is unique.

Add the following script to the box as its Main AI:

desc = Counter

;Triggers

:activated=1:incstate=1,activate=0
:state=3:activateifused=1

;End of Script

Change the IfUsed parameter to Door.

Add a Door to the level and ensure its main ai is doorremote and its name is Door.

When you shoot the 3 characters, the door will open.

You can do this for more characters. For 5, ensure the box script has state=5 in place of state=3.

This does open more ideas (and not just doors!) maybe have a key or weapon upgrade appear.

Also it could speed games up. Only allow progession (and more characters to spawn) once an area has been cleared.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 9th Jul 2007 16:10
First off, I haven't tried this but if if you say it works, then it's brilliant. You have somewhat gotten around the lack of useable variables by using incstate. Very nicely done.

I normally use a light to assign the AI Main script to because it can't be used or destroyed, and can be placed outside, above or below the accessible area of the map.

Thanks for sharing this.
Best.

(NOTE: this should be made into a graphical tut and posted in the proper tut sticky)

I'm sorry, my answers are limited. You must ask the right question.

TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 9th Jul 2007 18:57
Tried it with 3 enemies in small map then 5. I have just added the process to a game I am working on. All works fine.

If you save away all the characters files (fpe and bin) then once the game has been built and completed, put back the copies for your next game.

Of course, you do not have to use a box...any alternate entity will do. Just make sure its dynamic and you have the ifused set to its name in the characters fpe.

Also the Door can be any name as long as this name is used in the process I described.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 9th Jul 2007 19:10 Edited at: 9th Jul 2007 19:13
Quote: "Of course, you do not have to use a box...any alternate entity will do. Just make sure its dynamic and you have the ifused set to its name in the characters fpe. "


Yep. Initially I thought of using a light, but there is no IfUsed option on a light.

Again, great find and it opens up a few more possibilities, like having to collect so much money or pick up so many items. Another twist to the store idea.....

Thanks.

I'm sorry, my answers are limited. You must ask the right question.

Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 9th Jul 2007 23:27
Would it be ok to add to mu guide Tzap?


Search for "HellHouse" in Showcase.
brummel
18
Years of Service
User Offline
Joined: 26th Nov 2005
Location: Sweden
Posted: 10th Jul 2007 00:17
Nicely done mate.

www.myspace.com/sculptednoise
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 10th Jul 2007 01:17
Ok to do that Nickydude....could you put my name against it in the guide?

Thanks for the guide...it's great!
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 10th Jul 2007 12:53
Nice work! Very much appreciated.


[center]
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 10th Jul 2007 19:43
Quote: "Ok to do that Nickydude....could you put my name against it in the guide?"


Oooo, don't know about that...






Search for "HellHouse" in Showcase.
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 11th Jul 2007 00:35
Oh, ok.
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 11th Jul 2007 12:29
I was kidding I hope you realise. Of course your name will be there, this also goes for anyone else that sends anything in (which they haven't ) your name will be there.


Search for "HellHouse" in Showcase.
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 11th Jul 2007 16:37 Edited at: 11th Jul 2007 16:41
lol...cheers mate! I've tweaked the text in the opening post to make it more readable.
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 17th Jul 2007 21:35
Made another tweak to the opening text. It's better to make copies of a character and use that in the open door/object appear process.

Copy the characters fpe and if it exists, the bin file. The copied character should be available for selection when viewing the fpsc Entities.
JoeSan
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location:
Posted: 3rd Sep 2007 15:39
Excellent TZap !! it works and is very useful.
Now tell me in which "manual" can anyone read about script language so as to do what you have done?
Like adding another line in an .fpe script?, etc.
And then when I asked how can one learn the intricacies of the language I have the very inspiring answer: See the FPSC manual or it is a simple if-then-goto language !!!!!!
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 3rd Sep 2007 21:15
Thanks a lot! I would advise against changing a characters fpe script unless you make a copy and use the copy.

Search the forums. If you need a script you can probably find one on here. I have found a lot!

Login to post a reply

Server time is: 2024-11-23 20:18:26
Your offset time is: 2024-11-23 20:18:26