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 / Need advice: scripting away health/life/ammo/gun huds

Author
Message
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 15th Aug 2012 01:55 Edited at: 15th Aug 2012 01:55
Is there a way to do the following within a single script:

"Disabling" the display of health/life/ammo/gun huds (no matter which huds have exactly been chosen in the Level Settings) and enable them again?

Or even better to disable ALL huds presently active and enable them again later in teh script?

I tried anything I could imagine with HUDHIDE, HUDUNSHOW or HUDLAYER but I can't get my script to "target" just a hudtype or clear my screen

In case you find my grammar and spelling weird ---> native German speaker ^^
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 15th Aug 2012 02:23 Edited at: 15th Aug 2012 02:25
We had to comment out (in the setuplevel.fpi) the ammo, health, life, and gun huds for our method of displaying life and health to work in one of our developments. We scripted the two required huds to be toggled on/off. It may or may not give you a start in the right direction.

Here is an example script we used:



When the player started the level, no huds were visible. The script was attached to a trigger and either the player entered the zone or the script and trigger were spawned to run. The player could then toggle on/off the huds, and in another level we added guns and ammo to the script when required.


Twitter: @NFoxMedia
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 15th Aug 2012 02:34
I am thankful for the reply but I am searching for a method to make the script self-contained without the need to edit anything else. It's probably impossible.....

But I might use your script+setup for another project

In case you find my grammar and spelling weird ---> native German speaker ^^
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 15th Aug 2012 02:42 Edited at: 15th Aug 2012 02:59
Quote: "I am thankful for the reply but I am searching for a method to make the script self-contained without the need to edit anything else. It's probably impossible....."


It is. We looked at adding a couple commands in the source for this purpose, but we still had to comment out the hud line(s) in the setuplevel.fpi first. In the end, this was the easiest method for us.

Quote: "But I might use your script+setup for another project"


Certainly. Anything I post is free to use/hack/modify.

*ADDITIONAL*

There was something I thought of and had to check my notes. Now bear in mind we are still in v1.17, so I know this is the case in our version (I assume it is still the case for all versions). The script running can only control huds that it defines. For example, I used a script to show a map when the player entered the zone and pressed "M". Another script was running and setup to hide that map hud if the player pressed "L". The second script did not define any hud for the map image, whereas the first script did define the hud. Entering the test game, the map came up when I press M, but did not hide when I pressed L. This lead us to test more and our theory was that only the huds a script defines can show/hide.

With that in mind, you may want to try and have the ammo/life/guns/health defined but not visible in the setuplevel.fpi. Then you can setup a key/keys to have them show/hide when needed in the ";Main Game" section. No guarantee if that will work how you wanted.


Twitter: @NFoxMedia
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 18th Aug 2012 10:22
try to use the script not in a triggerzone but as entity-mainscript always active, this may or not overcome the problem with controlling a hud not defined in the script, but it solves many problems i had with interacting scripts when using triggerzones. reference/basic for me is conjured´s cash system all the time.

just a suggestion, not tested anything.

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th Aug 2012 15:45
@ Maho76

The issue here is that he wanted to disable and enable the lives, health, gun, and ammo huds. You can only do that if the script used to enable/disable has those huds defined in it. If they are defined in the setuplevel.fpi, you can't disable/enable using another script. If you remove the hud lines from the setuplevel.fpi and put in a script called "main_huds.fpi", then you can disable/enable because you would have the huds defined in that script. Only the script(s) that have huds defined can control them.


Twitter: @NFoxMedia
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 20th Aug 2012 10:51
ah, ok thanks for info, fox. what you can do to control setuplevel-lines with other scripts is using dimvars as additional state-conditions. just to mention...

Login to post a reply

Server time is: 2024-11-23 22:27:58
Your offset time is: 2024-11-23 22:27:58