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 / Shutoff a trigger?

Author
Message
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 26th Oct 2013 20:38
I have trigger that has a mask script.What I want to do is walk into another trigger and switch to another mask.Is this possible and if so how do I do it?
Thanks
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 26th Oct 2013 20:47
Quote: "I have trigger that has a mask script.What I want to do is walk into another trigger and switch to another mask.Is this possible and if so how do I do it?
Thanks "


This should be in Scripting section, not FPSC chat.

In your first script for your first trigger- have the script activate (spawn) the second trigger and terminate your mask script it was running (including removing or hiding the first mask). The second trigger is spawned and that script will now run and show your (second) mask.


There's no problem that can't be solved without applying a little scripting.
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 26th Oct 2013 21:05
Thanks for the speedy reply Blackfox
Yeah sorry about the placement of the thread.
I have this script for the second mask


I thought by hiding the first mask and then making the new mask appear it would work.But this didn't work.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Oct 2013 19:28
riccetts
I did noticed right off the line of code..."hudimagefine=effectbank\postprocess\Dmaskn.png".
Usually if its a "hud" it goes under "gamecore\huds\"YOUR HUD"
Text huds usually go under "languagebank\English\gamecore\text or hud". The "effectbank" is for .fx effect files (shaders and such).
best
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 27th Oct 2013 20:11
Quote: "I did noticed right off the line of code..."hudimagefine=effectbank\postprocess\Dmaskn.png".
Usually if its a "hud" it goes under "gamecore\huds\"YOUR HUD"
Text huds usually go under "languagebank\English\gamecore\text or hud". The "effectbank" is for .fx effect files (shaders and such)."


You can point your script to another folder other than "languagebank\English\gamecore\text". I just ran a test, pointing the script hud to one in my effectbank folder and it worked fine. In a perfect world, you would want to keep your huds in one folder, effects in another, and so on. The only thing that does require to be in the proper folders (other than segments, entities) is the scripts. Scripts must be in the scriptbank folder (or subfolder within scriptbank) but cannot reside elsewhere.

The problem with his script is that he has hudname=goggles for both. You cannot define huds in one script with the same name. You would need to have something like "hudname=goggles1" and "hudname=goggles2" or something along those lines.


There's no problem that can't be solved without applying a little scripting.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Oct 2013 21:00
Quote: "I just ran a test, pointing the script hud to one in my effectbank folder and it worked fine"

Thank you BlackFox. Always wondered if one could do that.
I see the "goggle" names. Yep, your right. One thing that does
elude me is why sometimes I point a script to "gamecore\huds\" and it runs when I place my "HUD\" under either \"gamecore\huds\" or under \"languagebank\English\gamecore\huds\" and sometimes it does
not? I've searched for a "Clear" answer to no avail.
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 27th Oct 2013 21:24
Quote: "One thing that does
elude me is why sometimes I point a script to "gamecore\huds\" and it runs when I place my "HUD\" under either \"gamecore\huds\" or under \"languagebank\English\gamecore\huds\" and sometimes it does
not? I've searched for a "Clear" answer to no avail."


That is strange. I can place a hud in either "gamecore\huds\" or "languagebank\English\gamecore\huds\" and they work fine for me when I point the path to the appropriate folder. I've also tested with both "hudimage" and "hudimagefine" and they work properly.

The only thing off the top of my head is that you reference an image file that may not be getting rendered properly. For example, if a script points to TGA and the DDS is the file extension, it will show the DDS. If the script points to DDS and TGA exists, it will show the TGA (by changing it to DDS for the render). This "switching" only works for TGA<-->DDS.

If there is an issue with the image, it will not display either (such as the settings chosen to create the DDS file). Other mistakes are a script pointing to either DDS or TGA and a PNG/JPG is used, in which case no hud would show as well.

That is how it is in the code I use, unless some drastic change in the latest beta(s) caused a problem.


There's no problem that can't be solved without applying a little scripting.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Oct 2013 21:36
Quote: "pointing to either DDS or TGA and a PNG/JPG is used"

I bet if I dug deeper I'll find I made these mistakes unknowingly.
Thanks for your help BlackFox.
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 29th Oct 2013 18:05
Ok I need help with this.In order to use one hud in a trigger I have to use it's fpi script but I'm not sure how to deactivate that trigger to use another trigger for another hud.I want to be able to walk into another trigger to change to another hud.
What I've tried so far is plrdisfuther in the first fpi and nothing happen.At least the hud stayed and did not change or disappeared.
Can somebody help me with this?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 29th Oct 2013 20:03
riccetts "
Quote: "What I've tried so far is plrdisfuther in the first fpi "

Are you using "plrdisfurther"? If so it should be "plrdistfurther="
In your script using "plrdistfurther=X:destroy" should work and destroy the script.
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 29th Oct 2013 21:09
ncmako,
I'll try that but no I used plrdistfurther just mis-typed.
I'll let you know what happens.
Thanks
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 29th Oct 2013 23:59
ncmako,
Nothing happened.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th Oct 2013 19:12 Edited at: 30th Oct 2013 19:16
riccetts
No, the "plrdistfurther" is usually used for your distance from an "entity". Being a "zone" we use just "plrwithinzone". The easiest to do would be to reset your hud. After you pickup your
"mask" entity and "activate" your first hud, name the second trigger zone the same as first and place this script into it.

Remember once your in this second zone, first mask wont show again.
BlackFox is the master with "huds", maybe he has something up his sleeve better than this?
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 30th Oct 2013 20:08
ncmako,
I'm experimenting with trigger zones. I want to be able to walk down a hall way with a hud mask triggered by a triggerzone. Then walk into another trigger zone switching hud masks.I replaced plrunderwater with plrwithinzone in your script and nothing happen. I just kept the hud I had in the first place.So block 1 square 1.If you can help I would appreciate it.
Thanks for the script anyway.
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 30th Oct 2013 20:13
Quote: "I'm experimenting with trigger zones. I want to be able to walk down a hall way with a hud mask triggered by a triggerzone. Then walk into another trigger zone switching hud masks.I replaced plrunderwater with plrwithinzone in your script and nothing happen. I just kept the hud I had in the first place.So block 1 square 1.If you can help I would appreciate it."


I am doing an example right now. Give me 10 minutes and I will have it posted.


There's no problem that can't be solved without applying a little scripting.
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 30th Oct 2013 20:14
Thanks Blackfox
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 30th Oct 2013 20:54 Edited at: 30th Oct 2013 20:56
Sorry- it took a bit longer than ten minutes. Was trying to be as detailed as possible with screenshots, descriptions, video PLUS eat my lunch at the same time.

---

The following is a "down and dirty" example of displaying one goggles hud with one trigger and script, then displaying a second goggles hud with a second trigger and script.

Layout and concept

First off, I lay out my level. In this case it is nothing fancy. You will see the player start marker, the first trigger (which will run googles hud #1), and the second trigger (which will run googles hud #2).



Now I enter the level and no goggles hud is displayed off the start.



I reach the first trigger and the first googles hud is activated.



After I have reached a certain distance away from where the trigger was placed, the hud disappears.



I reach the second trigger and the second goggles hud appears.



When I am a certain distance away, the second hud disappears.



Scripts

The first trigger script contains the following:



The second trigger script is as follows:



Notice a key importance when running scripts in a level. If you have one script that calls "googles" as the hudname, you cannot use that same hudname in a second script. In other words, they must have unique names. In my example, I used "googles1" and "googles2".

Second, the first script can only control the hud it defines. It cannot show/unshow the second hud since it is defined in the second script (and vice versa). The scripts also destroy (stop) once I am past the defined "distance further" amount. You can alter according.

Feel free to dissect and add to your development. This is merely just an example to give explanation to how a script handles hud(s) and how to switch. I use one master script to control things like this, but this method is the easiest method to do.

Video Demonstration

Here is a quick video demo showing it working.




There's no problem that can't be solved without applying a little scripting.
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 30th Oct 2013 21:04
Blackfox,
Thank you
I have one question can I use plrdistfurther up to the next trigger zone without the mask disappearing completely before hitting the other trigger zone?
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 30th Oct 2013 21:14 Edited at: 30th Oct 2013 21:32
Quote: "I have one question can I use plrdistfurther up to the next trigger zone without the mask disappearing completely before hitting the other trigger zone?"


You can- all you would have to do is adjust the distance value here...

:state=2,plrdistfurther=100:hudunshow=goggles1,state=3

If it is a hallway (as you had suggested), you could adjust according to what you need. Another approach is to "expand" the triggerzone so that the hud shows in that zone but instead of "plrdistfurther=x", you could replace with "plrwithinzone=0". To expand your trigger to cover a larger area, place the trigger then holding shift, press left mouse button and drag to create the "area".



Then do the same for the second trigger zone.



You can then replace the "plrdistfurther" for both scripts with "plrwithinzone=0". So when the player is in the "zone", that hud shows. Once they leave, the hud for that zone disappears and the other will show when they enter it. Make sure the "zone area" for trigger 1 reaches where the "zone area" for trigger 2 is so the huds will change without the "show-disappear-show" gap, but just switch from one to the other.

Video example

You will see a "smooth" transition from one googles hud to the next using the second method I outlined. This allows you to retain the first hud until that zone is left and the second zone is entered.




There's no problem that can't be solved without applying a little scripting.
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 30th Oct 2013 21:41
Ok I tried it and it switches but I can see the first hud behind the second hud.Rather than using hudunshow can I use destroy in zone1?
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 30th Oct 2013 21:47
Quote: "Ok I tried it and it switches but I can see the first hud behind the second hud.Rather than using hudunshow can I use destroy in zone1? "


I have no idea how you still see the first hud. In my example, the first hud disappears. The "destroy" command will not hide the hud or any image called within a script if it is visible. You have to use "hudunshow" first before destroying the script.


There's no problem that can't be solved without applying a little scripting.
riccetts
13
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 30th Oct 2013 21:51
Thanks again
I'll monkey around with it.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 31st Oct 2013 05:28
@ BlackFox
Thank you for that clear explanation. I wish we had
a dedicated repository for all your quick & clear
"tutorials" across the forums.
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 31st Oct 2013 23:23
Quote: "Thank you for that clear explanation. I wish we had
a dedicated repository for all your quick & clear
"tutorials" across the forums. "


We do right here. I've been adding as I do them.


There's no problem that can't be solved without applying a little scripting.

Login to post a reply

Server time is: 2024-03-28 08:41:35
Your offset time is: 2024-03-28 08:41:35