It is currently January 22nd, 2022, 5:31 am

Help setting up a timed image pop up

Help with creating, editing & fixing problems with skins
User avatar
Nilvarno
Posts: 54
Joined: March 24th, 2019, 5:52 pm

Help setting up a timed image pop up

Post by Nilvarno »

Hi everyone, good year!
I'd like, when i start a videogame, to pop up a full screen image just like a custom intro, but the image should be on with a timer, like it stays up for five seconds before disappearing again, otherwise when the game ends i'll be seeing that image again. So a timed meter or skin, in essence. How do i do that? Thank you very much! :welcome:
User avatar
CodeCode
Posts: 854
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Help setting up a timed image pop up

Post by CodeCode »

I think you can use this plugin:
This should be a place to start.

Code: Select all

[MeasureProcessTopOne]
Measure=Plugin
Plugin=Process
ProcessName=Filename.exe
OnChangeAction=[!Update *]
DynamicVariables=1
It generates either a 1 or -1. It is 1 when the process is active. Then -1 when not active.

So an image meter could use that value to pop up an image.

If you can get that working, then the timer will be next.

It is not too freaky, so the timer is just a new thing to figure out. :thumbup:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help setting up a timed image pop up

Post by balala »

Nilvarno wrote: January 11th, 2022, 1:50 pm I'd like, when i start a videogame, to pop up a full screen image just like a custom intro, but the image should be on with a timer, like it stays up for five seconds before disappearing again, otherwise when the game ends i'll be seeing that image again. So a timed meter or skin, in essence. How do i do that?
CodeCode's idea on using the Process measure is alright (Process in meantime became an internal measure, even if a while ago it was a plugin). So here is my thought about this question.
Instead of showing / hiding the meter, I definitely would show / hide the whole skin. So for first you need an Image meter, showing the appropriate image. add the following meter to your code:

Code: Select all

[MeterImage]
Meter=Image
ImageName=#@#YourImage.png
X=0
Y=0
W=#WORKAREAWIDTH#
H=#WORKAREAHEIGHT#
Don't forget to use the proper image name into the ImageName option.
When you load / refresh the skin, you have to move it to the upper left corner of you screen, in order to have it on "full screen". To do this add the following option to the [Rainmeter] section: OnRefreshAction=[!Move "0" "0"].
And finally you need the Process measure, as said by CodeCode, but a few changes are needed there. Use for instance the following measure:

Code: Select all

[MeasureProcessTopOne]
Measure=Process
ProcessName=Notepad.exe
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!ShowFade][!Delay "5000"][!HideFade]
IfFalseAction=[!ShowFade][!Delay "5000"][!HideFade]
Note here that the parameter 5000 used in the !Delay bangs of the IfTrueAction and IfFalseAction options means 5 seconds (5000 milliseconds). If later needed, adjust this value anytime.
Please let me know if you got this working well.
User avatar
Nilvarno
Posts: 54
Joined: March 24th, 2019, 5:52 pm

Re: Help setting up a timed image pop up

Post by Nilvarno »

Thank you all for your help!
Well, it's working, but it loads the image everytime rainmeter loads the skins, like when pc starts, i update rainmeter or it exit from game mode, so i think i must add another line to make it start hidden, perhaps?

Edit: there is another problem, like this the whole skin is working for one game only at a time, which means i can't add other meters to the same skin and i would need to make another skin for each game, which is not really confortable. I guess that the only way is to show/hide the meters in the skin and not the skin itself...

Edit 2: ok, i solved the first problem, just had to change:

Code: Select all

IfFalseAction=[!ShowFade][!Delay "4000"][!HideFade]
to

Code: Select all

IfFalseAction=[!HideFade][!Delay "4000"][!HideFade]
so the image is shown only when game starts. Still trying to figure how to put different entries to different games in the same skin
User avatar
CodeCode
Posts: 854
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Help setting up a timed image pop up

Post by CodeCode »

Nilvarno wrote: January 11th, 2022, 10:04 pm Thank you all for your help!
Well, it's working, but it loads the image everytime rainmeter loads the skins, like when pc starts, i update rainmeter or it exit from game mode, so i think i must add another line to make it start hidden, perhaps?

Edit: there is another problem, like this the whole skin is working for one game only at a time, which means i can't add other meters to the same skin and i would need to make another skin for each game, which is not really confortable. I guess that the only way is to show/hide the meters in the skin and not the skin itself...

Edit 2: ok, i solved the first problem, just had to change:

Code: Select all

IfFalseAction=[!ShowFade][!Delay "4000"][!HideFade]
to

Code: Select all

IfFalseAction=[!HideFade][!Delay "4000"][!HideFade]
so the image is shown only when game starts. Still trying to figure how to put different entries to different games in the same skin
That isn't really true. You can use the same skin to manage your images, just need new Process Measures, likea dis:

Code: Select all

[MeasureProcessTopTwo]
Measure=Process
ProcessName=
...

[MeasureProcessTopThree]
Measure=Process
ProcessName=
...

etc...
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 854
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Help setting up a timed image pop up

Post by CodeCode »

balala wrote: January 11th, 2022, 3:10 pm CodeCode's idea on using the Process measure is alright (Process in meantime became an internal measure, even if a while ago it was a plugin).
I didn't check and went by memory. :oops:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Nilvarno
Posts: 54
Joined: March 24th, 2019, 5:52 pm

Re: Help setting up a timed image pop up

Post by Nilvarno »

CodeCode, sorry, how do i link the process X to Image X and Process Y to Image Y? I have to refer the meter that recognize the process to the meter that shows its image, no?

Edit: ok, i did this and it works! Sadly i have to sacrifice the fade animation because there is no bang with fade for meters, right?

Code: Select all

[ROTTR]
Meter=Image
ImageName=TEST.png
X=0
Y=0
W=2560
H=1440
[MeasureProcessTopOne]
Measure=Process
ProcessName=ROTTR.exe
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!ShowMeter ROTTR][!Delay "4000"][!HideMeter ROTTR]
IfFalseAction=[!HideMeter ROTTR]


[FallGuys_client_game]
Meter=Image
ImageName=TEST3.png
X=0
Y=0
W=2560
H=1440
[MeasureProcessTopTwo]
Measure=Process
ProcessName=FallGuys_client_game.exe
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!ShowMeter FallGuys_client_game][!Delay "14000"][!HideMeter FallGuys_client_game]
IfFalseAction=[!HideMeter FallGuys_client_game]
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help setting up a timed image pop up

Post by balala »

Nilvarno wrote: January 12th, 2022, 9:55 am Edit: ok, i did this and it works! Sadly i have to sacrifice the fade animation because there is no bang with fade for meters, right?
No, unfortunately there is not. Can be done using an ActionTimer plugin measure, but I doubt it worth. Complicates the code too much. However if you're interested but don't know how to do, please let us know, for assistance.
Is the skin working as expected now (except the fade effect)?
User avatar
Nilvarno
Posts: 54
Joined: March 24th, 2019, 5:52 pm

Re: Help setting up a timed image pop up

Post by Nilvarno »

Yes, thanks to your help it's exactly as i wanted it to be, thank you so much :) It's really fun to use rainmeter, you can be creative in a lot of ways, only there is so much to remember always :lol: Just for my curiosity, anyway, with all things rainmeter can do, why is something like a fading meter that hard to implement, even as a plugin?
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help setting up a timed image pop up

Post by balala »

Nilvarno wrote: January 12th, 2022, 11:38 am Just for my curiosity, anyway, with all things rainmeter can do, why is something like a fading meter that hard to implement, even as a plugin?
Don't know why, probably something related to how Rainmeter does work. But am not even sure it is "hard", however you have to add an ActionTimer plugin measure and the appropriate bangs to execute one or the other action when the conditions are met.
Do you want an example?