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 / Mission Objectives HUD

Author
Message
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 6th Nov 2008 19:51
Got a quick question. I'm not looking for any answers, I just want to make sure I am placing this in the right spot.

I want to have the player be able to display a short mission briefing, or objectives, or something along those lines at any point in the game. Player presses the "O" key, and the game pauses and displays a HUD with the objectives. Player presses the "O" key again, and the HUD disappears and the game resumes play. Simple enough to write the script and display the HUD. That's not what my question is.

My question is where does the script go? If I understand right from reading the forum posts, this should be placed in the global script (or, well, incorporated into it). Of course, you should make a backup of the default global script before messing with it.

I just want to know if this is correct? Would the global script need to be altered to account for this? I also read about trigger zones at the beginning of the game doing this - how does the script in the trigger zone run in the background when you aren't in the zone?
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Nov 2008 00:25
Quote: "how does the script in the trigger zone run in the background when you aren't in the zone? "


Same reason that it's able to detect if the player isn't in it and can still do something in that case.


I suggest using a triggerzone. Messing with the global script usually is only needed when you want to alter the way the game handles Pausing (pressing escape to pause), quicksaving, quickloading, creating perma-HUDs, etc, etc.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 7th Nov 2008 05:29
Quote: "Same reason that it's able to detect if the player isn't in it and can still do something in that case."

Yeah, major brain fade on my part. duh to me!

Got it now. I'll use a trigger zone right at the beginning of the level to implement the mission objectives. thanks!
maikyy
16
Years of Service
User Offline
Joined: 29th Jul 2008
Location: between my front and back door
Posted: 7th Nov 2008 17:49
you can use an dynamic light ass wel too
or can't you do that with this kinda scripts

sorry for my bad english (i am dutch)
Thistle Studios
18
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 7th Nov 2008 21:07
A basic thing to do is duplicate the 'press button to show objectives hud' script then mix that in with "startmenu" from plys mod to pause the game.

Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Nov 2008 22:08
"startmenu" doesn't pause the game.

It prevents player movement, but everything else is still running.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 8th Nov 2008 20:05
Yeah, I believe the command to actually pause the game would be PAUSEGAME.
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 8th Nov 2008 20:29
But that suspends all running scripts.....

Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 8th Nov 2008 23:47
Isn't that the point of pausing the game, CG?

To truly pause the game, the scripts shouldn't be running.


But then... this runs into a problem, since doesn't your "pause script" REQUIRE processing in order to get out of the pause?


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
xplosys
19
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 9th Nov 2008 05:16
Quote: "you can use an dynamic light ass wel too"


What is a dynamic light ass?

Anyway, the script could be assigned to any dynamic entity. I like the while key pressed option. It doesn't require the played to press another key to close the HUD.

This code creates a loop and waits until the key is released. Simple and effective.



Best.

Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 9th Nov 2008 17:10
Love the script xplosys, but I prefer to have the player need to press a key to get the script to go away. But thanks for your input!

@ply: Leave it to you to figure out a way to twist the scripting logic of PAUSEGAME around.
Diablos Bud
16
Years of Service
User Offline
Joined: 8th Aug 2008
Location:
Posted: 16th Nov 2008 01:59 Edited at: 16th Nov 2008 02:00
Xplosys: That's a cool script, do you mind if I use it in my game?

If Yes: To prevent from having multiple posts, how would I turn the held key to Tab. Also would there be a way to have multiple objective HUD .tgas to change the objectives with each mission/update them in the same mission?

Thanks for taking your time to read my post .

Diablosbud Productions - a name for the game's developed by me.
xplosys
19
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 16th Nov 2008 04:55
Diablos Bud,

As you can see from the beginning of the script, it's not mine but it was freely given to the community, so yes. You can use it. To use the TAB key, change the scancodekeypressed value to 15. (I think that's right) You can have as many as you like I guess. Whatever trigger you use would call the correct HUD.

Best.

Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 16th Nov 2008 18:18
Ok, so I'm having a little bit of a problem with this. Here's the script I am using:



I have created a HUD called moathousebriefing.tga (and I also have the DDS image) that I created in Paint.NET. I dropped a trigger zone into my level right where the player starts. Now, not only does this not work, but I drop from 32 frames per second (fps) to 10 fps. That's right - with the trigger zone I lose 20 fps in performance.

Can anyone let me know why this isn't working, as well as why I am losing so many fps?
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 16th Nov 2008 19:59 Edited at: 16th Nov 2008 20:05
It may be that it is triggering the input twice causing a loop.
If we detect the release of the key before proceeding, then it may resolve the issue.
Try this...



PS
its scancodekeypressed not scankeycodepressed

Don't forget to visit Conjured Entertainment

Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 16th Nov 2008 22:31 Edited at: 17th Nov 2008 01:54
Ok, so I went back to my original script, and I changed SCANKEYCODEPRESSED to SCANCODEKEYPRESSED (I am a VB programmer by nature, and everything there is keycode, so...). Anyhow, I can get the hud to display and the game to pause. (This is, of course, with my original script just changing the wording of the command.)

However, now I cannot get the hud to unshow? I have to hit ESCAPE 2 times to resume the game, and the hud still shows. Anyone know what I'm doing wrong now? I thought the script would work the way I have it, but....?

EDIT: I used the script provided by Xplosys, and of course that works. So there has to be something wrong with mine, but I cannot tell what?
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 17th Nov 2008 02:50 Edited at: 17th Nov 2008 03:02
Did you try mine?
I did not test the one that I posted above, so give it a try and tell me what happens.
The one xplosys gave you was one of mine too, but it is an old one that doesn't pause the game.
The Pause part of the script is not necessary though, unless you need two seperate pause buttons.
It's not like they need to look at the objective in the middle of a fire fight.
They can pick a safe spot or time it between action to peek at objectives.
Besides, it gives them incentive to remember them if they can get shot looking at the reminder.

Don't forget to visit Conjured Entertainment

Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Nov 2008 07:07
"pausegame", if memory serves, will disable ALL scripts except for the global "setuplevel.fpi" script (which needs to keep running because it's the one that handles the pause menu), so when you invoke "pausegame" you're effectively telling your script to suspend.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 17th Nov 2008 12:49
@ply: Yeah, unfortunately I thought that it would suspend all scripts EXCEPT the script that invoked it. Oh well - I used the one from xplosys above and have tweaked it for my needs.
maikyy
16
Years of Service
User Offline
Joined: 29th Jul 2008
Location: between my front and back door
Posted: 17th Nov 2008 18:17
Quote: "What is a dynamic light ass? "

lol i meant a dynamic light as wel too

sorry for my bad english (i am dutch)

Login to post a reply

Server time is: 2025-05-23 04:30:33
Your offset time is: 2025-05-23 04:30:33