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 / Using a trigger zone to display a HUD (and using a phone script)

Author
Message
BigJayWH
13
Years of Service
User Offline
Joined: 8th Mar 2011
Location: Indiana
Posted: 15th May 2011 18:42
Hello all,

What I'm hoping to do is display a HUD of a pager with a name and number the player must then find a pay phone and call. I have the phone script part down for the most part and have created the pager graphic in GIMP. I'm still new at FPSC and have a long way to go with scripting. I assure you I have already searched the forums but have been unable to find the answers I need. I'm hoping you can help me out. So far the community has been very helpful and I'm hoping you come through for me again.

So here are my questions:

1. How can I use a trigger zone to display the pager HUD on the screen and then have it disappear with a key press? I easily was able to replace the life/health/ammo huds because they are always there. It's the making it appear when triggered then disappear with a key press part I don't get.

2. How could I make the phone script have multiple messages attached to it? For example depending on what number you press different audio plays. This would be handy so I would only have to attach one script to every pay phone in the game and the player would be able to re-listen to previous messages. I'm using the phone script from the Scary Thinker pack.

Any help would be appreciated or if you can direct me to a previous thread that would be great too. All the HUD tutorials I've found are about creating a "the door is locked" kind of thing. I assume it's similar but I admit I'm a scripting noob who is trying to learn.

Thanks in advance.
bobochobo
16
Years of Service
User Offline
Joined: 9th Jul 2008
Location: My house, in the middle of my street
Posted: 15th May 2011 19:12
:state=x,scancodekeypressed=x:showhud=0

That should hide your hud on a key specified by x.

To make it show just copy the hud parts from a pickup, editing the directory. Change the conditions part to plrinzone=1 or plrdistwithin=x.

Part two could be as complex or easy as you want.
Two draft scripts to get you thinking:



And:


A script with so many options code become infinity huge, I'd keep numbers low. No guarantees that script will work.

All browsers should come with compulsory spell checks.

BigJayWH
13
Years of Service
User Offline
Joined: 8th Mar 2011
Location: Indiana
Posted: 15th May 2011 21:57 Edited at: 15th May 2011 22:00
Thanks again Bo. I'll be trying that when I get back to work on the HUD and phone thing.

My current issue is that I have changed the HUD that appears when you walk up to a door from the original script to a custom one. I changed the doorkey script by by copying the original and creating a new one called MYdoorkey. The new image is in my script as mylockeddoor.tga. When I change the door's main to my script the original doorkey.tga image still appears when you walk up to the door.

Any idea what I'm overlooking or doing wrong?

BigJayWH
13
Years of Service
User Offline
Joined: 8th Mar 2011
Location: Indiana
Posted: 16th May 2011 15:26
Sorry, I got distracted from my original post by the doorkey problem I have. It still doesn't work. I'm clueless. I'll start a new thread for help on that one later.

Back on topic 1:
Quote: "That should hide your hud on a key specified by x.
"

Does the showhud=0 "hide" the HUD or "remove" it? I'm guessing without a command to bring it back on a key press it's gone. Is that correct?

I got busy with work and distracted by my other problem. I'll try that out soon and let you know how it works.

Back to topic 2:

Quote: "A script with so many options code become infinity huge"

I agree given that my story needs 10 phone numbers. My WIP is only 5 levels long with 2 numbers per level. It would probably be easier to attach a number script to each levels pay phone. I get the phone script for the most part so I should get a test of that done soon.

Thanks for the help. Help with my doorkey not changing the HUD would be appreciated too.

Login to post a reply

Server time is: 2024-11-24 08:21:42
Your offset time is: 2024-11-24 08:21:42