It is currently May 19th, 2024, 5:48 pm

Actions and Bangs

Get help with creating, editing & fixing problems with skins
kh2ff
Posts: 2
Joined: November 26th, 2012, 4:52 pm

Actions and Bangs

Post by kh2ff »

On this "health bar" hud, a sound is supposed to be played when the battery reaches a certain point.
http://luckywilbury.deviantart.com/art/Kingdom-Hearts-2-HUD-299594139
the meter has the sound and if actions set up, but not for the sound to be played.
(To have the sound play on an if action)
here is the if action code:

Code: Select all

[mPercent]
Measure=Plugin
Plugin=PowerPlugin.dll
PowerState=PERCENT
MaxValue=100
MinValue=0
IfAboveValue=25
IfAboveAction=!Execute [!RainmeterShowMeter ImageBar][!RainmeterHideMeter ImageBarLow] [!RainmeterRedraw]
IfBelowValue=25
IfBelowAction=!Execute [!RainmeterShowMeter ImageBarLow][!RainmeterHideMeter ImageBar] [!RainmeterRedraw]
UpdateDivider=0
also I dont know what #filepath# actually entails
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5409
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Actions and Bangs

Post by eclectic-tech »

From the code, this is an older skin, but you can add the Play Sound Bang to this code.

If you know the complete path to the WAV file, just type it in the command:

Code: Select all

IfBelowAction=!Execute [Play "{completepathtofile\wavname.wav}"][!RainmeterShowMeter ImageBarLow][!RainmeterHideMeter ImageBar] [!RainmeterRedraw]
Replace {completepathtofile\wavname.wav} to match the location of your WAV file.
I put it in quotes to avoid problems if there are 'spaces' in the path.
If you put the WAV file in the same folder as this INI file, you would only need the WAV file name in the command.
User avatar
jsmorley
Developer
Posts: 22633
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Actions and Bangs

Post by jsmorley »

Please don't put the curly braces in the option. I'm sure eclectic-tech put those there just to "indicate" that it is an example or something, but they are not needed or allowed in the actual option.

Examples:

!LeftMouseUpAction=[Play "C:\Some Path\SomeFile.wav"]

!LeftMouseUpAction=[Play "#CURRENTPATH#SomeFile.wav"]

!LeftMouseUpAction=[Play "#@#Sounds\SomeFile.wav"]
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5409
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Actions and Bangs

Post by eclectic-tech »

Oops! Should have been clearer... I'll pay closer attention. :(

Thanks JSM
kh2ff
Posts: 2
Joined: November 26th, 2012, 4:52 pm

Re: Actions and Bangs

Post by kh2ff »

Thanks eclectic-tech and jsmorley.
It works fine now, just had to add a [playstop] in the if above