It is currently April 19th, 2024, 6:59 am

Choosing a different Image depending on the time

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Choosing a different Image depending on the time

Post by balala »

Vx_Lotus wrote: July 31st, 2019, 5:39 pm Answer to number 1 = this is the test for, the test failed.

**Wait 5 seconds, Close frame sequence #2***

Code: Select all

IFTrueAction=MaxNumber = 5
FormulaCounter= + 1 ;seems to be slowing GiFFrames #1 to 5 second intervols
IFAboveValue=#MaxNumber#
FormulaCounter = % 86 
UpdateDivider=-1
IFTrueAction=!DisableConfig "UmbrellaAdvertisement" "GifFrames.ini"
This piece of code has more issues:
  • What is MaxNumber? Is it a measure? Based on this it should have to be, but later in your code there also is a IFAboveValue=#MaxNumber# and based on this, it should have to be a variable. Although you can use the same name for a measure and a variable, take care not to make a confusion.
  • FormulaCounter= + 1 ;seems to be slowing GiFFrames #1 to 5 second intervols
    • I have no idea what you want to achieve with this. What is FormulaCounter= + 1? Do you want to assign 1 to the FormulaCounter variable? Or what FormulaCounter is? Is it a variable? :confused:
    • Never add the comment of an option into the same line. Unlike the programming languages, Rainmeter (which isn't a programming language) has troubles in such cases. Always add the comment into a new line. Details: https://forum.rainmeter.net/viewtopic.php?f=5&t=27443&p=142422&hilit=comment+out+same+line#p142422
  • FormulaCounter = % 86 - Same as above.
  • IFTrueAction=!DisableConfig "UmbrellaAdvertisement" "GifFrames.ini" - There is no a such bang as !DisableConfig. There is a !DeactivateConfig, as well as !DisableMeasure, but no !DisableConfig. If you wanted to deactivate the skin belonging to the UmbrellaAdvertisement config, the .ini file isn't required. Unlike !ActivateConfig, the !DeactivateConfig bang doesn't require to specify the name of the .ini file, because Rainmeter always knows which skin of the config is loaded and unloads that one, if required.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Choosing a different Image depending on the time

Post by balala »

Vx_Lotus wrote: July 31st, 2019, 6:18 pm ; COMMENT: Measures do not support "ImageName=". This must be in an Image meter.
ImageName=#@#ImagesFrames\SAMPLE - ([ImageNumberCalc]).png <on the contrary - The calculator seems to work inside the measure lol>
Believe eclectic-tech, measure indeed doesn't support an ImageName option. This option has to be used ONLY on Image meter, nowhere else.
And your ImageName=#@#ImagesFrames\SAMPLE - ([ImageNumberCalc]).png option definitely won't work. As said Rainmeter isn't a programming language and as such your possibilities are quite limited, in front of what a programming language can do.

Finally we're spinning around the tail. Please pack the whole config you have so far and upload it here. I'd like to take a look...
User avatar
Vx_Lotus
Posts: 34
Joined: July 30th, 2019, 7:37 am

Re: Choosing a different Image depending on the time

Post by Vx_Lotus »

XD Sure thing. Without the number calc there .. it will not loop. This was done some time ago with another older post by someone else, I was simply trying to apply new mechanics to make a different function for this
I will try to pack the Layout for you =D
and The formula counter+1 was supposed to manipulate a child skin

The formula = %86 is the code used to spit image after image 86 times, the same amount of frames in the file.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Choosing a different Image depending on the time

Post by balala »

Vx_Lotus wrote: July 31st, 2019, 7:10 pm I will try to pack the Layout for you =D
Don't pack the layout, pack the config (the folder within the Skins folder, which contains the skins .ini file).
Vx_Lotus wrote: July 31st, 2019, 7:10 pm The formula counter+1 was supposed to manipulate a child skin
How? :confused:
Vx_Lotus wrote: July 31st, 2019, 7:10 pm The formula = %86 is the code used to spit image after image 86 times, the same amount of frames in the file.
Your option was not Formula=%86, but FormulaCounter = % 86 and just now have I realised what is your intention with it. It probably should have to be: Formula=( Counter % 86 ), which definitely makes sense. The values returned by this formula grow from 0 to 85, then everything starts all over again.
User avatar
Vx_Lotus
Posts: 34
Joined: July 30th, 2019, 7:37 am

Re: Choosing a different Image depending on the time

Post by Vx_Lotus »

Haha, I am trying to clean up the pack- the files were a mess, but now everything is under "TheRedQueen" = just one file. Because of this I had to go through and change a lot of my directories.. but this is good - "IT's not chaotic anymore lol" So you want just the skin that has other skins? or just one of them? *Please explain Formula = (Counter - %86)??? as I stated before the image already uses this to count the images and repeat them.. lol (I THINK it does anyway as the code progresses..) Could play with it and find out. ;) .. Anyway during the relocation of said" called files. I managed to get most of it working again. but at least here you can see how it works kinda.... I still have a long way to go on this project, so thanks for all the help!
File is 166mb and I can't upload it? https://www.dropbox.com/s/m589k7t3lgjgb42/RedQueen%20_1.0.rmskin?dl=0
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Choosing a different Image depending on the time

Post by eclectic-tech »

Rather than upload your large rmskin with the edits, I will post my suggestions.

I modified your background image because it had wasted space to the right and bottom that would prevent positioning to the right side or bottom of the screen. Here is the image; save it in your "@Resources\Background" folder as "UmbrellaCorp1353x746.png"
UmbrellaCorp1353x746.png
I edited 4 files: Desktop.ini, RedQueen.ini, NYSequence.ini, and RQControl.ini
Comments are in the code for most changes I made.

Desktop.ini

Code: Select all

[Rainmeter]
Author=@VX_Lotus
; Added positioning when loaded so it is above most skins
OnRefreshAction=[!Move "0" "0"][!ZPos +1]

; Edited your background image and set the width and height to the users screen dimensions
[BackgroundFrame]
Meter=IMAGE
ImageName="#@#Background\UmbrellaCorp1353x746.png"
H=#WorkAreaHeight#
W=#WorkAreaWidth#
LeftMouseUpAction=[!ToggleConfig "TheRedQueen\Minion" "RedQueen.ini"]

; I combined the Feed images into the redqueen and the nysequence skins (see below)
; There is no need for those skins (I deleted those folders Feed1 and Feed2)
;[!ToggleConfig "TheRedQueen\LiveFeed1" "LiveFeed.ini"]
UpdateDivider=-1
RedQueen.ini

Code: Select all

[Rainmeter]
Update=100
; Added controls so sound stops if skin is unloaded
OnCloseAction=[PlayStop]
; Added controls so user can stop the sounds using middle click
MiddleMouseUpAction=[PlayStop]

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfCondition=MeasureOnLoad = 1
IfTrueAction=[Play "#@#Sounds\VLoad"]
UpdateDivider=-1

;wait 3 seconds then load another gif that plays once. or Load and play once emediately after .wav has ended

;sets the value to play once (HOPEFULLY ;O)
;IFAboveAction=[!ActivateConfig "UmbrellaAdvertisement" "GifFrames.ini"]

;Wait for .wav to end after "AH THERE YOU ARE" "Intitialize NewYork Squence" "Activate Biohazard"
;Load T-virus vials displaying CPU core Information (QUEEN DESCRIBES T-VIRUS)
;check to see if all are loaded and proceed
;Load video 2 (Show live feed gun fight) (add fight audio)
;Wait for .wave to end and close live feed video 2 location 1
;"Intruder detected Load Earthquake skin location 2
;"capture if possible, terminate if neccessary"
;Load live feed 2 B.O.W. S.T.A.R.S "INTRUDER SURVIVED" "Target Entering Moscows test invironment"
;Switch live feed 2 location 1 to live feed 3.  "No Itelligence"
;"activate las plagas undead" "Your all going to die down here"
;END RED QUEEN FEED1

; Measure to control when the red queen finishes speaking, and activates the boot sequence.
[ImageNumberLoop]
Measure=Loop
StartValue=1
EndValue=68
LoopCount=1
IfCondition=(ImageNumberLoop=68)
IfTrueAction=[!ActivateConfig "TheRedQueen\UmbrellaAdvertisement" "NYSequence.ini"][!ActivateConfig "TheRedQueen\UmbrellaBoot" "RQControl.ini"]

; Because your images are numbered 1~39, add 1 to the modulo calc. Returns 1 thru 39
[ImageNumberCalc]
Measure=Calc
Formula=(ImageNumberCalc % 39) + 1

[ImageMeter]
Meter=Image
X=5
Y=5
W=200
H=100
LeftMouseUpAction=[!ToggleConfig "TheRedQueen\UmbrellaAdvertisement" "NYSequence.ini"]
; I combined the Feed images into the redqueen and the nysequence skins (see below)
; There is no need for those skins (I deleted those folders Feed1 and Feed2)
;[!ToggleConfig "TheRedQueen\LiveFeed2" "LiveFeed.ini"]
ImageName=#@#RedQueen\REDQUEEN - ([ImageNumberCalc]).png
AntiAlias=1
DynamicVariables=1

[Frame]
Meter=Image
ImageName="#@#Background\UmbrellaCorp1353x746.png"
W=210
H=110
UpdateDivider=-1

[Meter]
Meter=String
FontColor=255, 255, 255
FontFace=Sogoe UI
FontSize=9
StringAlign=CENTER
StringStyle=BOLD
Text=LIVE FEED
X=50
Y=6
AntiAlias=1

[Meter2]
Meter=String
FontColor=255, 0, 0
FontFace=Sogoe UI
FontSize=9
StringAlign=CENTER
StringStyle=BOLD
Text=RED QUEEN
X=150
Y=6
AntiAlias=1
UpdateDivider=-1
NYSequence.ini

Code: Select all

[Rainmeter]
Update=300
; Added controls so sound stops if skin is unloaded
OnCloseAction=[PlayStop]
; Added controls so user can stop the sounds using middle click
MiddleMouseUpAction=[PlayStop]

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfCondition=MeasureOnLoad = 1
IfTrueAction=[Play "#@#Sounds\RE3main.wav"]
UpdateDivider=-1

;Wait for .wav to end after "AH THERE YOU ARE" "Intitialize NewYork Squence" "Activate Biohazard"
;Load T-virus vials displaying CPU core Information (QUEEN DESCRIBES T-VIRUS)
;check to see if all are loaded and proceed
;Load video 2 (Show live feed gun fight) (add fight audio)
;Wait for .wave to end and close live feed video 2 location 1
;"Intruder detected Load Earthquake skin location 2
;"capture if possible, terminate if neccessary"
;Load live feed 2 B.O.W. S.T.A.R.S "INTRUDER SURVIVED" "Target Entering Moscows test invironment"
;Switch live feed 2 location 1 to live feed 3.  "No Itelligence"
;"activate las plagas undead" "Your all going to die down here"
;END RED QUEEN FEED1

[ImageNumberCalc]
Measure=Calc
Formula=(Counter % 86) + 1

[ImageMeter]
X=5
Y=5
W=200
H=100
Meter=Image
ImageName=#@#NewYork\Sequence - ([ImageNumberCalc]).png
AntiAlias=1
DynamicVariables=1
LeftMouseUpAction=[!ToggleConfig "TheRedQueen\UmbrellaAdvertisement" "NYSequence.ini"]

; I combined the Feed images into the redqueen and the nysequence skins (see below)
; There is no need for those skins (I deleted those folders Feed1 and Feed2)
;[!ToggleConfig "TheRedQueen\LiveFeed2" "LiveFeed.ini"]
;[!ToggleConfig "TheRedQueen\LiveFeed2" "LiveFeed.ini"]

[Frame]
Meter=Image
ImageName="#@#Background\UmbrellaCorp1353x746.png"
W=210
H=110
UpdateDivider=-1

[Meter]
Meter=String
FontColor=255, 255, 255
FontFace=Sogoe UI
FontSize=9
StringAlign=CENTER
StringStyle=BOLD
Text=LIVE FEED
X=50
Y=6
AntiAlias=1

[Meter2]
Meter=String
FontColor=255, 0, 0
FontFace=Sogoe UI
FontSize=9
StringAlign=CENTER
StringStyle=BOLD
Text=NEW YORK
X=150
Y=6
AntiAlias=1
UpdateDivider=-1

RQControl.ini

Code: Select all

[Rainmeter]
Update=120
OnRefreshAction=[!ZPos -1]

; Added a condition check to unload the skin when the animation is finished
[ImageNumberCalc]
Measure=Calc
Formula=(Counter % 500) + 1
IfCondition=(ImageNumberCalc = 500)
IfTrueAction=[!DeactivateConfig "TheRedQueen\UmbrellaAdvertisement"][!ActivateConfig "TheRedQueen\Virus Vials" "vial.ini"][!DeActivateConfig]

; Set the height and width to desktop work area
[ImageMeter] 
W=#WorkAreaWidth#
H=#WorkAreaHeight#
Meter=Image
ImageName=#@#RedQueenSystem\Loading - ([ImageNumberCalc]).png
AntiAlias=1
DynamicVariables=1

I removed the need for your LiveFeed1 & LiveFeed2 since they were simply covers for the animations; I moved the meters to the associated animated skins.

When the "desktop.ini" is loaded, click anywhere to activate the "Minion\RedQueen" config. That will display the queen animation and play the wav sound. When the wav is finished, it will activate the "NYSequnce.ini" and "RQControl.ini". When the "RQControl.ini" finishes it's animation, it will close "NYSequence.ini", activate "Virus Vials\vial.ini", and close itself.

Look at the code changes and let us know if this is close to what you wanted in sequencing.

This is about as far as I can to take you. This is far too ambitious for me... Good luck with your project.
You do not have the required permissions to view the files attached to this post.
User avatar
Vx_Lotus
Posts: 34
Joined: July 30th, 2019, 7:37 am

Re: Choosing a different Image depending on the time

Post by Vx_Lotus »

HOLY CRAP! thanks! Was going to try to leave a msg to you on Deviant. I saw your resident evil post and was impressed. I will download after i'm done with these edits. I was looking for that loop drop. You saved me hours of research lol (though I will eventually have to go back through it so I have a better understanding of how it works exactly. I thought about the skins for user preference... or just for display so I just left them in there. Maybe swap ideas sometime? I would like to have the ultimate Umbrella corp mod. What did you think of it when it started talking to you? "Give you any Ideas?" It took me a while to edit the footage and edit the audio to get them trimmed and its still not perfect but it's interesting to say the least. "Rainmeter is more powerful than its given credit." PS: Was also thinking of adding a hover over for the back ground to make it click through without having to re-adjust its settings. However; we can definitely work with this. Again, Thank you!
Added a way to hide and bring back outer ring quickly;
:REDQUEENFEED:

Code: Select all

LeftMouseDoubleClickAction=[!ToggleConfig "TheRedQueen" "Desktop.ini"]
;Perfect Sequencer OMG THANKS! So pleased..
;Changed number of counts in the loop (Adtertisement) to (Control), and resized control to fit.... somewhere else (EVERYTHINGWORKS!!)

Code: Select all

[ImageNumberLoop] 
Measure=Loop
StartValue=1
EndValue=500
LoopCount=3  
IfCondition=(ImageNumberLoop=500) 
IfTrueAction=[!DeactivateConfig][!ActivateConfig "TheRedQueen\UmbrellaBoot" "RQControl.ini"]

;A minute/second timer also work like this?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Choosing a different Image depending on the time

Post by eclectic-tech »

Vx_Lotus wrote: August 1st, 2019, 7:33 am HOLY CRAP! thanks!
...
Added a way to hide and bring back outer ring quickly;
:REDQUEENFEED:

Code: Select all

LeftMouseDoubleClickAction=[!ToggleConfig "TheRedQueen" "Desktop.ini"]
;Perfect Sequencer OMG THANKS! So pleased..
;Changed number of counts in the loop (Adtertisement) to (Control), and resized control to fit.... somewhere else (EVERYTHINGWORKS!!)

Code: Select all

[ImageNumberLoop] 
Measure=Loop
StartValue=1
EndValue=500
LoopCount=3  
IfCondition=(ImageNumberLoop=500) 
IfTrueAction=[!DeactivateConfig][!ActivateConfig "TheRedQueen\UmbrellaBoot" "RQControl.ini"]

;A minute/second timer also work like this?
I didn't think you ever wanted to unload the desktop frame, it appeared to me to be a constant feature with other skins being displayed inside the invisible center, but double-click is an option to hide it.

Changing the LoopCount will not change the IfCondition action to Deactivate the skin the first time the loop reaches 500; the loop count will never be more than once. Not sure which skin you changed, but if it was RQControl.ini, then what you are doing is simply unloading and then loading the skin in an endless loop; RQControl.ini takes a lot of CPU cycles and if I run it constantly, it used 80%+ of my CPU all the time! :thumbdown:

A minute/second timer uses actual time to calculate things, the Loop measure is similar, but uses skin update rates to determine how quickly a loop is "counted". At the default skin update rate of 1000ms, both the Time and Loop measures update each second AS LONG AS EVERYTHING CAN BE DONE BY RAINMETER IN 1 SECOND; that is why time critical calculations should use time measures and not loops.

Thanks for looking at my Umbrella suite; I did that several years ago and haven't changed much recently. :great:

Sound playing every time a skin is accessed can be very annoying after hearing it a few times, that is why I added a middle mouse click to stop all sounds as an option for end users. I also added a sound stoppage if the skin is unloaded; once you use [Play] bang to start a wav file in Rainmeter, the wav will continue to play until done, or if it is interrupted by another [Play] bang, or [PlayStop] bang is used. Unloading the skin without using OnCloseAction=[PlayStop] will not stop the current wav sound.

I am willing to point you toward features in Rainmeter to solve issues you encounter here on the forum. If you want to swap ideas about your suite, I would recommend sending me a note through DA, since they may not be pertinent to general Rainmeter issues.

Regards, E.T.