I'm not very experienced in Rainmeter skin making.
Basically, I'm making a skin which would act something like a shimeji, but without climbing. So just a moving character along the bottom of the screen that would do certain actions, such as walking and dancing. I have made all the necessary frames and named them accordingly (dance0.png, dance1.png, etc.) All I need is some code which would select one of five animations to play every 2 seconds. Each animation has a different amount of frames, and needs to loop.
I've tried to make this behaviour in code, but the variables won't change. I have DynamicVariables on. I also haven't figured out how to make the 2 second delay.
If anyone could help me with this, it would be very appreciated!
pixljacket wrote: ↑October 22nd, 2019, 12:02 am
I'm not very experienced in Rainmeter skin making.
Basically, I'm making a skin which would act something like a shimeji, but without climbing. So just a moving character along the bottom of the screen that would do certain actions, such as walking and dancing. I have made all the necessary frames and named them accordingly (dance0.png, dance1.png, etc.) All I need is some code which would select one of five animations to play every 2 seconds. Each animation has a different amount of frames, and needs to loop.
I've tried to make this behaviour in code, but the variables won't change. I have DynamicVariables on. I also haven't figured out how to make the 2 second delay.
If anyone could help me with this, it would be very appreciated!
Try this...
Made a few changes to [Random] measure, moved incorrect !SetVariable bangs to [Random], changed step counters to use themselves instead of "Counter" value, added pause to those new [Step#] measures, corrected imagename to use #@# instead of "@Resources\", corrected imagename "variable/measure".
Added left click to update [Random] for next movement.
pixljacket wrote: ↑October 22nd, 2019, 12:02 am
If anyone could help me with this, it would be very appreciated!
In addition to eclectic-tech's (as usually very good) solution, note that in this code there are a few thing which can't work>
In every of the [Stand], [WalkR], [WalkL], [Yawn] and [Dance] "sections", you've added two bangs, but these bangs don't work, because just simply adding them so is not a solution in Rainmeter, they having to be added one after the other, like this: [!SetVariable action "stand"][!SetVariable number "2"] (bangs of the [Stand] section). But even if they were added this way, still wouldn't work, because calling a such section simply by a [Stand] expression, doesn't work. Maybe there could work if you'd add them as variables, into the [Variables] section, something like this:
[Variables]
Stand=[!SetVariable action "stand"][!SetVariable number "2"]
then you'd call the #Stand# variable: IfAboveAction=#Stand#. But doesn't worth, in my opinion, adding the bangs directly to the appropriate IfAboveAction options is much simpler.
Only one single IfAboveValue / IfAboveAction pair of options are allowed onto a measure. There is not possible to use more. Multiple IfConditions can be used, but even those have to be numbered:
IfAboveValue / IfAboveAction are older options and there is possible to use only one pair per measure.
In the second bangs of the [Stand], [WalkR], [WalkL], [Yawn] and [Dance] sections, you set values for the number variable. Supposing these settings have work, the value of the number variables anyway wouldn't be used into the ImageName option of the [ImageMeter] meter, because you wanted to use it as a measure: ImageName=@Resources\[action][[number]].png. [number] in this construction is a measure, but number has been set as a variable, so you should have to use it as such: ImageName=@Resources\[action][#number#].png.