Play A Sound When the Automap is Opened

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
SiMpLeToNiUm
Posts: 112
Joined: Mon Aug 01, 2016 9:06 am

Play A Sound When the Automap is Opened

Post by SiMpLeToNiUm »

How would I go about adding a sound effect when the automap is opened and closed?

Auxillary question:

How do I make the automap disabled until you pick up an item in the level?

Thanks
User avatar
cortlong50
Posts: 753
Joined: Mon Jun 24, 2013 7:12 pm
Location: UT-WA

Re: Play A Sound When the Automap is Opened

Post by cortlong50 »

damn thats a good question. youre going to need a script that causes two things.
whatever the hell the ACS command is for opening the automap (i did a quick search but didnt find anything so im gonna leave that for you.)
and one to play the sound (duh..right?)

youre probably going to need to define it in the KEYCONF lump
Spoiler:
then in your ACS lump youll need to do something like this (at least this is what i would do)
Spoiler:

THENNN in your decorate lump (just make a new one for your automap)
Spoiler:
replace everything in that last decorate actor with the shit you need and you can probably make something happen.

not even sure why i chimed in on this...youre asking for something complicated and im decent at ACS and decent at decorate...but working with both is always bad for me.
User avatar
SiMpLeToNiUm
Posts: 112
Joined: Mon Aug 01, 2016 9:06 am

Re: Play A Sound When the Automap is Opened

Post by SiMpLeToNiUm »

cortlong50 wrote:damn thats a good question.
Indeed, but I think I'm getting somewhere with it.
cortlong50 wrote:whatever the hell the ACS command is for opening the automap (i did a quick search but didnt find anything so im gonna leave that for you.)
I have found by digging through the menu options at least that when you type togglemap into the console it does exactly that. Perhaps there is a hacky way to find the value of togglemap (a true or false perhaps?) and act afterwards.
cortlong50 wrote:not even sure why i chimed in on this...
Nonetheless, I appreciate it. I think you steered me in the right direction, so thanks for that! :D
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Play A Sound When the Automap is Opened

Post by Nash »

The only available way to read the status of the automap is the ZScript global variable automapactive. Be careful when using this, and be sure to make sure that the sound is only playing in the UI channel and only for the specific player with consoleplayer.
User avatar
SiMpLeToNiUm
Posts: 112
Joined: Mon Aug 01, 2016 9:06 am

Re: Play A Sound When the Automap is Opened

Post by SiMpLeToNiUm »

https://zdoom.org/wiki/CCMDs:Customization

mapbind [key] [command]
This command works just like bind, except it controls the action that occurs when the automap is displayed. (Panning controls are ineffective on the overlay map.) A list of automap-specific controls may be found here.

This also looks promising.

*EDIT
It would be so much easier if GetPlayerInput had an INPUT_AUTOMAP parameter.
Post Reply

Return to “Scripting”