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 / end level by pressing a key on keyboard?

Author
Message
joeganzi
14
Years of Service
User Offline
Joined: 25th Feb 2010
Location:
Posted: 1st Mar 2011 17:03
Hi,
it's possible to end a level when pressing a key on the keyboard?
I'd like to make somenthing like if you go near the bed and press enter you sleep and the level ends to go to another one.....

Can you help me?

Thaks!
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 1st Mar 2011 17:38 Edited at: 1st Mar 2011 18:12
Quote: "
it's possible to end a level when pressing a key on the keyboard?
"


Yes, it is possible. You can use a trigger to activate the winzone. I do it on all my end levels, except I use the trigger to display the level stats, then it activates the winzone and ends my level.

OR

You place just the winzone and edit the script for the winzone so that it will activate the end level sequence when the key is pressed. What you will want to do is use the scancodekeypressed=28 (that's the Enter key) in your script. When that key is pressed, then the rest of the script will run and end your level.

For example, here is a standard winzone script:



To implement the Press Enter feature, you would need to modify the script to include the scancodekeypressed=28, and if you plan to have a hud display that to the player you also need to include the hud info in the script as well.

- BlackFox

The function of good software is to make the complex appear to be simple.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 1st Mar 2011 18:06
You would also need to remove the "rpg_setobjectivemet" part as well.

unless you were using RPG mod

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 1st Mar 2011 18:12
Quote: "
You would also need to remove the "rpg_setobjectivemet" part as well.

unless you were using RPG mod"


Good catch. I edited the script. Thanks for pointing my mistake out.

- BlackFox

The function of good software is to make the complex appear to be simple.
joeganzi
14
Years of Service
User Offline
Joined: 25th Feb 2010
Location:
Posted: 1st Mar 2011 18:48
thanks! it works great!

Login to post a reply

Server time is: 2024-11-24 12:07:04
Your offset time is: 2024-11-24 12:07:04