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 / Door unlocks when entity is defeated - PLEASE help me im EXTREMELY frustrated!

Author
Message
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 7th Mar 2009 01:56
How can a door be locked then once a certain enemy is defeated then it unlocks? I found a different thread on this and tried to follow along with the solution which involved a bunch of scripting, but got lost and could not fix it as the person who gave the answer was not very specific. i have no idea how to code and i need somebody to be very specific and detailed about this, im very frustrated...
Crusader2
16
Years of Service
User Offline
Joined: 8th Aug 2008
Location: Somewhere...
Posted: 7th Mar 2009 03:25
Very simple; place the script destroyandactivate.fpi in the character's destroy script, and put the name of the door (reccommend renaming it to door1) in the If Used parameter when you right click on the enemy.

I hope you put some effort into scripting; you can't realize its full potential until you experiment with it. At least try to learn; you wouldn't believe how easy the language is. Not trying to bash you, just giving some friendly advice.

Best,
Crusader2

Some people say that I'm crazy... And I agree.
USE PLY'S MOD!
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Mar 2009 06:04 Edited at: 7th Mar 2009 06:04
And, if you don't have this, then try it out:


__________________________________________________________
Make life a little easier and use FPI Editpad for your sctripting needs.
Now with Line Numbers. V3.3.81 is now available and it is still free.

The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC
Brian In Korea
15
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 7th Mar 2009 07:53 Edited at: 7th Mar 2009 08:06
Where is the IF USED property in an enemies property list?


Maybe you could save the script below as IfKilledThenOpen.fpi and place its name (IfKilledThenOpen.fpi) in the destroy AI script property box of the enemy.


Then you place a door (remote) and name it REDdoor and its default scripts should take care of it.
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 7th Mar 2009 14:45
Quote: "Where is the IF USED property in an enemies property list?"


...RIGHT CLICK on the entity, and it will appear on the drop down menu at the right.


King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 8th Mar 2009 02:49
Quote: "put the name of the door (reccommend renaming it to door1) in the If Used parameter when you right click on the enemy.
"


the enemy doesnt have an if used section
Crusader2
16
Years of Service
User Offline
Joined: 8th Aug 2008
Location: Somewhere...
Posted: 8th Mar 2009 03:55
Hm... That's wierd, I'm almost sure I've used the IF USED parameter before...

Some people say that I'm crazy... And I agree.
USE PLY'S MOD!
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 8th Mar 2009 21:12
not on any entities ive seen
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 9th Mar 2009 01:53
Characters don't have an If Used field in their properties. To give a character an IfUsed, you would need to hard code it into their FPE file. (Not very clean but gets the job done)

Your best option here would be to copy the Destroy AI of the enemy and make your own, but add to it so that it will "settargetname" the door you want to activate then "activatetarget=1" to make the door open.


The one and only,


King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 9th Mar 2009 03:25
Quote: "Characters don't have an If Used field in their properties. To give a character an IfUsed, you would need to hard code it into their FPE file. (Not very clean but gets the job done)

Your best option here would be to copy the Destroy AI of the enemy and make your own, but add to it so that it will "settargetname" the door you want to activate then "activatetarget=1" to make the door open."


i know this sounds stupid, and you will probably think i'm stupid, but could you please explain this step by step? i have a hard time following things. i would be extremely thankful if you did this
Brian In Korea
15
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 9th Mar 2009 04:51
Maybe you could read my original post again. It contains the step by steps.
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 9th Mar 2009 21:37
Quote: "Maybe you could read my original post again. It contains the step by steps."


yes that didnt work, they just stand there and the door stays locked
Brian In Korea
15
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 10th Mar 2009 07:06 Edited at: 10th Mar 2009 13:55
That's strange. I just tested my script and it worked for me. I killed him and the door opened.

My guess, if they are just standing there, then you edited the MAIN ai script. If you deleted the MAIN ai script then they will not attack.

You need to edit the DESTROY ai script.

But the door stayed look. So you didn't add the script to the MAIN ai script or you did add it but you didn't rename the door to REDdoor. Or maybe you didn't use a Door (remote) from the segment section.
Brian In Korea
15
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 10th Mar 2009 14:34
I just came up with some scripts that will require you to kill 4 enemies before the door opens. Actually, any number you want, I just choose 4 for testing.

If anyone is interested, just let me know, and I'll upload a tutorial.
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 11th Mar 2009 02:13
Brian In Korea, i know this is a dumb question, but where do i save the IfKilledThenOpen.fpi to? im new to fps creator
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 11th Mar 2009 02:16
and also, how do i save it there?
Brian In Korea
15
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 11th Mar 2009 05:02
1. Open Notepad and copy and paste the code in:

2. Save the file to your desktop as IfKilledThenOpen.fpi
3. Move the file to your scriptbank folder.
4. Now when you place an enemy in the level editor, you can right click on it and you will zoom in and you will see all the property boxes on the left. There is a section for AI script. You should see the DESTROY box under the MAIN box. Click 3 times on the file name beside DESTROY. And your file browser will open. Choose the IfKilledThenOpen.fpi

5. Now place a door (remote). Right click on it, in its NAME property box type REDdoor and its default scripts should take care of it.
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 11th Mar 2009 23:44
i appreciate your effort but that still didnt work
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 12th Mar 2009 04:31
can somebody PLEASE help me? i know this is getting old but i'm kind of new to FPSC and i don't know a lot of stuff about it, i really need to finish this game, it's very important...
Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 12th Mar 2009 05:06
1. Open Notepad and copy and paste the code in:



2. Save the file to your scriptbank folder as "lockeddoor.fpi"

3. Start a new notepad and copy and paste this code in:


4. Save the file to your scriptbank folder as "killopendoor.fpi"

5. Now when in FPSC, right click the character you are going to use and place the "killopendoor.fpi" script in the destroy field. apply changes

6. Now right click the door you are going to use and place the "lockeddoor.fpi" script in it's main field. apply changes


Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 12th Mar 2009 05:38
And another one if they still don't work

1. Add your character and door (make sure the door is a REMOTE door)
2. Copy this script:



3. Save it as destroyactivate.fpi

4. Right click the character and add the script to the destroy area

5. Change your doors name to door5

6. Go to your characters .fpe file (usually in fpscreator/files/entities/whereveryourenemyis/yourenemy.fpe

7. In it's .fpe add IfUsed=door5 (if you don't know where to put it, look at a doors .fpe it should be in there)

And now it should work :S

Migration Discussion Thread: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Piracy Discussion Thread:
http://forum.thegamecreators.com/?m=forum_view&t=142774&b=21
Brian In Korea
15
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 12th Mar 2009 10:04
1. Have you read the manual? In it you will learn about using the N key and editing entity properties.
2. Have you looked over the Official Community guide? It will introduce you to scripting.

I always start with the basics when I want to try a new script. Start small.

3. Can you create a trigger zone and have it open a door when you walk over the trigger?
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 12th Mar 2009 10:56 Edited at: 13th Mar 2009 04:05
thank you Gamer X, the door now opens after i defeat the enemy, and i hate to bother you more, but my character doesnt attack me and then kneels down after i shoot them once


EDIT: nevermind, my character was set on "coward.fpi" for some reason... fixed it though, and i can't thank you enough for the time you took to answer my noobish question... and thanks to the rest of you who contributed to helping me out also

At night i lay awake on my bed, gazing up at the stars, and wond-hey, where'd the roof go?
The Fps Creator rocks!
16
Years of Service
User Offline
Joined: 24th Oct 2008
Location: Sneaking down your chimney.
Posted: 11th Apr 2009 16:37
Quote: "thank you Gamer X, the door now opens after i defeat the enemy"


How? It doesn't work for me! I followed the instructions 100%! And nothing!

My youtube account: funnybun123

Login to post a reply

Server time is: 2024-11-24 23:48:51
Your offset time is: 2024-11-24 23:48:51