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 Product Chat / Using Keys to activate switches

Author
Message
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 8th Jun 2009 17:15
ive gone thro all the switch options
and put the key name in the key required feild in the switch
but it seems to activate without me needing the key
how do i fix this?



Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 8th Jun 2009 17:22 Edited at: 8th Jun 2009 17:24
You have to pick the right door as in the ones that say (key) beside them.
Those doors use the doorkey.fpi for their main ai.
If you place a different door then you need to reassign the main ai to the doorkey.fpi.
If the door uses a different script then the keys won't work, or the door will open without them. (see attached pic)

Attachments

Login to view attachments
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 8th Jun 2009 17:32 Edited at: 8th Jun 2009 17:33
No what i want is
theres a switch far from the door
the player has to find the key
find the switch
then use the switch to open the door

ty for a detailed response anyway



Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 8th Jun 2009 19:21
try using global variables to determine if/when the player has the key.if the player doesn't have the key, then nothing happens when they try to use the switch.

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 9th Jun 2009 14:33
can you noobify that please



Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 9th Jun 2009 14:57
I'm not sure it can be noobified more than it already is, but I'll try:

Use a global variable to determine if the player has a key or not. Place a line in the switch script that checks if a global variable has a certain value, such as 99. Then place a line in the key script that sets the global variable to 99 when the player picks it up.

Did that help?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 9th Jun 2009 15:54 Edited at: 9th Jun 2009 16:07
is it me or is the time on tgc mucked up.. Your Time Offset is: 0 hours from the Server time
9th Jun 2009 06:57
anyway

i know how dbpro works
but i dont know how this scripting works
so i have guessed and
:state=1,activated=1:state=2,lighton
i saw that in the light bit and i guess that means
If state=1 and activated=1 then state=2 and light is on

ok so what your saying is i want to make a global variable, such as 99 (explain why 99?) ok but how do i know if the player owns the key
is it like
:itemcollected=keyname: switch=activate
=P (fail)

ill look for a basic scripting tut
http://www.madladdesigns.co.uk/fpsc/guide/ocfpscguide.pdf
seems to not explain it

heres my best attempt at failing >.<

Holy chicken it works!


tyvm for replys
it works



Attachments

Login to view attachments
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 9th Jun 2009 18:20
Ok, let's see if I can help without having any of the scripts you are using in front of me. I'm not at my home pc, but we'll try this anyhow.

1. Find the script that is used for the switch, probably something like "Switch.fpi". Copy and rename it to something else, like "AlteredSwitch.fpi".

2. Open this up in FPI Editpad (or your favorite scripting program), and add the following lines at the very beginning of the script:


What this does is sets the current variable being checked to 1, and sets the value of that variable to 0. It then moves to state 99, which will prevent anything else in the script from being executed.

3. In this same script, add the following lines at the very end of the script:


What this does is it once again sets the variable being looked at to 1, and then checks to see if the value of it is equal to 1. If it is, it moves to state x, where x is the state that the switch can be used. This is more than likely state 1, but that will be dependent on the script itself.

4. Find the script used for the key, something like "DoorKey.fpi", and once again copy and save it with a new name like "AlteredDoorKey.fpi" and open it up with FPI Editpad (you really should have this handy little program - Terry is a genius!).

5. Add the following line at the very top of the script:


This once again is setting the variable 1 to the value of 0.

6. Find the line that indicates when you have picked up the key and add this:


This sets the variable 1 to a value of 1. Then when you go back to the switch, the switch will work.

Test this out and let us know if this worked or not.

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 9th Jun 2009 23:17
sweet tyvm
ill try it out tomorow



Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 11th Jun 2009 22:00
Tried that out
it didnt work
but i managed to use my own way of doing and it worked
ty anyway



Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 11th Jun 2009 22:49
how did you get it to work?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 11th Jun 2009 22:58 Edited at: 11th Jun 2009 22:58




Login to post a reply

Server time is: 2024-10-12 15:26:17
Your offset time is: 2024-10-12 15:26:17