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 / 2 or more triggerzones to detect a certain key press?

Author
Message
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 14th Feb 2012 17:55
Ok, not sure if that title is clear enough.

Here's what I want to achieve;

I want to be able to put multiple trigger zones in a level that detect if the player has pressed a certain key, then bring up a different hud image for each trigger zone.

Why I want to achieve this;

I'd like to be able to press the 'M' key in certain areas of a level, to show a hud image which is a screenshot of the FPSC editor view, corresponding to whichever area you're in. In other words, an in-game 'map' to help the player navigate.

My question is this;

If all the trigger zones detect the same key being pressed, will consecutive trigger zones over-ride previous ones?

In other words, when I enter the 1st trigger zone and press the 'm' key, the 1st hud image appears on screen. When I enter the next trigger zone and press the 'm' key, the next hud image appears, and so and so on?

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 14th Feb 2012 19:45 Edited at: 14th Feb 2012 19:47
Prepare yourself for a detailed answer

You can have any number of triggers running a script to detect a key press (particularly a same-key press), and what happens depends on how you scripted the script for that particular trigger.

For example... I have the following map image. Simple layout- you will see one trigger by the player start marker and one at the other side.



The first trigger by the player marker has this script:



The second trigger on the right side has this script:



Now lets review the two scripts. They both show a map image using the M key, one hud is at (x,y) 50,40 and the second at 50,80. When the player hits the first trigger and presses M, the first image shows. Press M again to hide the image hud.



Player then goes to the second trigger and presses M. The second image shows, but not the first.



That is how to do it. A quick tip- if you use this method, it may be good to freeze the player when viewing the image. Otherwise they can still move while the image is up until they either press the key to hide it or you have it hide after x seconds. But you should get the idea here.


Twitter: @NFoxMedia
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 14th Feb 2012 20:45 Edited at: 14th Feb 2012 20:52
Thanks Blackfox! I thought it was possible to do, just wasn't 100% sure.

I figured out the hud and plwithrinzone parts, but hadn't got as far as even thinking about using the etimer!

Now that I've seen it in action, I'm wondering if, by adding a bit of transparency to the hud image, I could combine it with the new radar? That way I'd end up with a rudimentary 'moving map display' type thing (kind of like the map from the early Doom games etc). Of course, in order to do this, I wouldn't be able to freeze the player.

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 15th Feb 2012 20:51
The freezing of the player when displaying the hud(s) with the same key press only serves to prevent the huds from overlapping and depends on how that info from the hud(s) are to be displayed. In a situation where I want to give the player info they need to read and make note of, the player freeze is handy for that. In the situation of displaying a map or maps, then the player freeze is not necessary.

I have two scripts- one that displays a map, if I collect the map first, and one that displays my radar. Both are on the same "key press". If the map is not collected, only the radar shows.


Twitter: @NFoxMedia
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 16th Feb 2012 15:02 Edited at: 16th Feb 2012 15:02
Thanks, I'll bear that in mind.

I'm currently working on implementing the radar, I'm experimenting with changing the x-y position of the radar, so that it appears over the map image. The problem I'm currently having is what to do about the enemy 'blips'. I don't want them, as they would give too much information to the player (fine if you want the radar for its original intended use, but not for a navigation tool). So I'm thinking of requesting a feature to be added, which would display a player 'blip' instead of an enemy 'blip'.

If that feature were to be added, I would then need to script it so that the player 'blip' would move in relation to the map image in the hud.

I had a sleepless night last night, thinking about this lol

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th Feb 2012 04:46 Edited at: 17th Feb 2012 04:49
Until your addition is added, you could script your level so that the AI appear only when you need them to be shown on the radar. Until they appear, they do not show on the radar.

However the idea of having a blip for AI and a blip for player is good and opens some doors for ideas.


Twitter: @NFoxMedia
elbow
13
Years of Service
User Offline
Joined: 3rd Dec 2010
Location:
Posted: 17th Feb 2012 09:52
Thanks for the detailed explanation Blackfox.

I too would like to see the plr blip on a map as I want a player running through the streets of town jumping, dodging etc. but it would be good when he knows he's heading in the right direction.

Regards

Eugene
Scene Commander
Support Manager
16
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 17th Feb 2012 12:46
Quote: " I want a player running through the streets of town jumping, dodging etc. but it would be good when he knows he's heading in the right direction."


Don't forget that using V119.7 you can set multiple entites as objectives which will appear on the radar.

Login to post a reply

Server time is: 2024-11-24 01:28:46
Your offset time is: 2024-11-24 01:28:46