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 / When Player dies show pop-up menu

Author
Message
GraPix
User Banned
Posted: 18th Jun 2009 16:16
Wondering if it is possible to pause the game and show a menu (or clickable hud) before player respawns. Continue ... and Quit to Menu like the ones in VirtualCop(TM)2.

Your signature has been erased by a mod - please make it no larger than 600x120, thanks
Kravenwolf
15
Years of Service
User Offline
Joined: 14th Apr 2009
Location: Silent Hill
Posted: 18th Jun 2009 16:53
Doesn't the escape key already do that


Kravenwolf

GraPix
User Banned
Posted: 18th Jun 2009 18:09 Edited at: 18th Jun 2009 18:16
No...

escape key let user pause the game....

What i want is if i have 3 lives.. and my health goes 0 lives automatically changes to 2 (-1) and it respawns the player. BUT.. i am wondering that if i have 3 lives.. and my health goes 0 BEFORE lives change to 2 (-1) and it respawns the player it pause the world (game) and shows a menu like when we press Esc key and we have buttons - Continue and Exit to Menu. If Continue then it will resumegame,respawns player and reduce lives numeric to -1 (total 3) and if exit to menu then it will exit the level and open Main Menu. Play VC, u will then knew what i am wondering if...

Your signature has been erased by a mod - please make it no larger than 600x120, thanks
Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 18th Jun 2009 21:56
Hmm. if you use the playerhealth less than = 1 command (not actually the correct wording), you could have the game pause, maybe using timers so that after the player dies, right before they respawn, the game pauses, and you script the menu in.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 19th Jun 2009 07:32
Or you could alter your setuplevel.fpi script to bring up the menu when your player's health reaches 0. It would be easier that way since the setuplevel.fpi script is the one that controls the pausing of the game.


The one and only,


GraPix
User Banned
Posted: 19th Jun 2009 08:02 Edited at: 19th Jun 2009 09:24
Thanks... i will give it a go.....

EDIT: i tried but it is not working at all.

Your signature has been erased by a mod - please make it no larger than 600x120, thanks
GraPix
User Banned
Posted: 19th Jun 2009 10:52 Edited at: 19th Jun 2009 10:53
is there is any action for RESPAWN PLR?

i tried editing setuplevel.ini AFTER build, but no results...

Your signature has been erased by a mod - please make it no larger than 600x120, thanks
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 19th Jun 2009 22:51
Quote: "i tried editing setuplevel.ini AFTER build, but no results... "


Try it again, but this time do it like this... (add the bold)

Quote: "

; Main Game
:state=1,escapekeypressed=1:pausegame,state=2
:state=1,plralive=0:pausegame,state=2

"


That doesn't show the whole thing, just what to add and where to add it.

So, in the 'Main Game' section ...

We added that second line to state=1.

Then go down and change the following...

Quote: "

; Game Menu

...
...

:state=6:hudunshow=gamemenutitle,hudunshow=loadgame,hudunshow=savegame,hudunshow=quitgame,hudunshow=returngame,hudunshow=pointer,resumegame,state=7
:state=7,plralive=1:state=1


"


Once again, I do not show the whole thing just what you need to ad and change.

So, under the heading 'Game Menu'...

We changed state=6 to go to state=7 instead of state=1.

Then we added state=7.

Try that, because it worked in my test.

Have Fun!

GraPix
User Banned
Posted: 20th Jun 2009 11:37 Edited at: 20th Jun 2009 13:04
@CE but where do i put my huds?



EDIT: i got it working. thanks...

I have one more question...
I want the user to press Q and he will be transported to Game's Main Menu.

STATE=0,SCANCODEKEYPRESSED=X:QUITGAME

BUT QUITGAME action quits the WHOLE game... How can u script so it quits to main menu NOT the whole game???????????????????????????????????????????????

Your signature has been erased by a mod - please make it no larger than 600x120, thanks
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 20th Jun 2009 17:26
Quote: "I have one more question...
I want the user to press Q and he will be transported to Game's Main Menu.

STATE=0,SCANCODEKEYPRESSED=X:QUITGAME

BUT QUITGAME action quits the WHOLE game... How can u script so it quits to main menu NOT the whole game???????????????????????????????????????????????"

I hope you mean when we have died and have the menu up, otherwise hitting 'Q' accidently during game play would exit automatically and really make people angry.

So, lets look at what the Exit does and emulate it. (it does not QUITGAME)

Quote: "

; Game Menu
:state=2,escapekeypressed=0:state=3
:state=3:hudshow=gamemenutitle,hudshow=loadgame,hudshow=savegame,hudshow=quitgame,hudshow=returngame,hudshow=pointer,state=4
:state=4,hudselectionmade=2:loadgame
:state=4,hudselectionmade=3:savegame,state=6
:state=4,hudselectionmade=5:continuegame,destroy
:state=4,hudselectionmade=4:state=6
:state=4,scancodekeypressed=16:continuegame,destroy
:state=4,escapekeypressed=1:state=5
:state=5,escapekeypressed=0:state=6
:state=6:hudunshow=gamemenutitle,hudunshow=loadgame,hudunshow=savegame,hudunshow=quitgame,hudunshow=returngame,hudunshow=pointer,resumegame,state=7
:state=7,plralive=1:state=1

"


We can see in the line in italics what the menu does when someone selects "Exit Game" which takes them back to the Main Menu as you call it.

:state=4,hudselectionmade=5:continuegame,destroy

It doesn't QUITGAME, it continues and destroys.
So that is what we want to do is someone presses 'Q', right? (scancodekeypressed=16)
So we add the line in bold right above the check for the escape key...

:state=4,scancodekeypressed=16:continuegame,destroy

GraPix
User Banned
Posted: 22nd Jun 2009 08:34
thanks...
i figured it out...

Your signature has been erased by a mod - please make it no larger than 600x120, thanks

Login to post a reply

Server time is: 2024-11-25 02:49:44
Your offset time is: 2024-11-25 02:49:44