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 / making a door open when every character entity is killed

Author
Message
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 17th Sep 2010 09:44
Is there a way to make a door open when all the character entitys in the room is killed?
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 17th Sep 2010 11:53
Yes, create a variable and create a death script for each enemy where by the variable will be increased by one for each death. Then, you can use a piece of code like:

:varequal=enemies 5:activateifused=1

into a trigger zone, with the IfUsed being the name of the door and setting the door to the doorremote script.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 17th Sep 2010 13:49
Okay!

Here's what I have done:

I've made a RemoteDoor with the Name: RemDFinal
I've put a triggerpoint in front of the door with the IfUsed property set to the name: RemDFinal

There are six enemies that has to be killed in order to open the door, they all have the same death script set in their Destroy property

The scripts look like this:

The enemies death script:


The trigger zone script:



I think I understand the problem here; The variable has to be global.

You said something about creating a variable. Could you, or anyone please explain this to me, cuz' I don't know how.
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 17th Sep 2010 14:01
Why are you putting incvar as a half condition ..

Place a trigger zone and add a globalvar to the level

:state=0:globalvar=0,state=1

Then put the death script to the enemy

:state=0:state=1,suspend,coloff
:state=1:incvar=1,state=2

Then edit the doors main script and add a condition line

:varequal=6:

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 17th Sep 2010 16:15
Are you using 1.17 or above? If so, this script will work:

Trigger Zone Script:

:state=0:dimvar=enemies,setvar=enemies 0,state=1
:state=1,varequal=enemies 6:activateifused=1,destroy

Enemy Death Script:

:state=0:suspend,coloff,addvar=enemies 1,destroy


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 17th Sep 2010 18:03
Wait...Marc...this works under stock fpsc with 1.17?

I thought you needed a mod like PB for it?

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 18th Sep 2010 09:29
1.17 and above now has the Project Blue variable system so it is much easier to work with variables


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 18th Sep 2010 11:52
Hmm...For some reason it doesn't work.

I have a reason to believe the system was implemented but will be released in a later 1.18 beta.

Payam
15
Years of Service
User Offline
Joined: 28th Mar 2009
Location:
Posted: 18th Sep 2010 14:41
Shoot several enemies to open a door:

By TZap

In some fps games I have played, you cannot open certain doors until the 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 all that characters files. Using Notepad to edit, add the line ifused = box to a characters fpe file in the ;ai section. 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! Maybe place it in an inaccessible part of the level. 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.




(Before asking here just search OFPSGuid.pdf from your the The Game Creators\FPS Creator\Docs be sure you'll find many things there)

Have our guns was a mistake!!!

I am PaYaM
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 29th Sep 2010 23:44
If you have a release that allows variables, this replaces my script above:-

Add to a remote door as main script:-

:state-0:globalvar=1
:state=0,varequal=6:state=1,setframe=0,sound=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff

;End of Script

Add 6 characters and set this as the destroy script:-

:state=0:state=1
:state=1,alphafadeequal=100:decalphafade=0
:state=1,alphafadeequal=0:globalvar=1,incvar=1,state=2,destroy

Shooting the 6 characters will open the door immediately. It works as I've tested it. The door will also stay open.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 30th Sep 2010 00:43
Quote: "1.17 and above now has the Project Blue variable system so it is much easier to work with variables"


I thought it was v1.18 and above. But, I'm sure you know best since you've been following this since day one. I'm too lazy to check the v1.17 code right now, though.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Sandante
16
Years of Service
User Offline
Joined: 9th Sep 2008
Location: Dark World
Posted: 2nd Oct 2010 23:22 Edited at: 2nd Oct 2010 23:27
nvm

Login to post a reply

Server time is: 2024-11-24 20:00:03
Your offset time is: 2024-11-24 20:00:03