It is currently April 24th, 2024, 2:46 am

Need Help with making a shimeji-ee like skin

Get help with creating, editing & fixing problems with skins
pixljacket
Posts: 3
Joined: October 21st, 2019, 9:35 am

Need Help with making a shimeji-ee like skin

Post by pixljacket »

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!

Code: Select all

[Rainmeter]
Update=200
DynamicVariables=1

[Variables]
action=stand
number=2

[Random]
Measure=Calc
Formula=(Random)
LowBound=1
HighBound=5
IfAboveValue=1
IfAboveAction=[Stand]
IfAboveValue=2
IfAboveAction=[WalkR]
IfAboveValue=3
IfAboveAction=[WalkL]
IfAboveValue=4
IfAboveAction=[Yawn]
IfAboveValue=5
IfAboveAction=[Dance]

[Stand]
!SetVariable action "stand"
!SetVariable number "2"

[WalkR]
!SetVariable action "right"
!SetVariable number "4"

[WalkL]
!SetVariable action "left"
!SetVariable number "4"

[Yawn]
!SetVariable action "sprite_"
!SetVariable number "4"

[Dance]
!SetVariable action "dance"
!SetVariable number "8"

[8]
Measure=Calc
Formula=Counter % 8

[4]
Measure=Calc
Formula=Counter % 4

[2]
Measure=Calc
Formula=Counter % 2

[ImageMeter]
Meter=Image
ImageName=@Resources\[action][[number]].png
DynamicVariables=1
W=64
H=64

[actionMeter]
Meter=String
MeasureName=#action#
MeasureName2=#number#
Text=%1 %2


User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Need Help with making a shimeji-ee like skin

Post by eclectic-tech »

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.

Code: Select all

[Rainmeter]
Update=200

[Variables]
action=stand
number=2

[Random]
Measure=Calc
Formula=Random
LowBound=1
HighBound=5
IfCondition=(Random=1)
IfTrueAction=[!SetVariable action "stand"][!SetVariable number "2"]
IfCondition2=(Random=2)
IfTrueAction2=[!SetVariable action "right"][!SetVariable number "4"]
IfCondition3=(Random=3)
IfTrueAction3=[!SetVariable action "left"][!SetVariable number "4"]
IfCondition4=(Random=4)
IfTrueAction4=[!SetVariable action "sprite_"][!SetVariable number "4"]
IfCondition5=(Random=5)
IfTrueAction5=[!SetVariable action "dance"][!SetVariable number "8"]
DynamicVariables=1
UpdateDivider=-1

[Step8]
Measure=Calc
Formula=(Step8+1)%8
IfCondition=#CurrentSection#=7
IfTrueAction=[!PauseMeasure #CurrentSection#][!Delay 2000][!UnpauseMeasure #CurrentSection#]

[Step4]
Measure=Calc
Formula=(Step4+1)%4
IfCondition=#CurrentSection#=3
IfTrueAction=[!PauseMeasure #CurrentSection#][!Delay 2000][!UnpauseMeasure #CurrentSection#]

[Step2]
Measure=Calc
Formula=(Step2+1)%2
IfCondition=#CurrentSection#=1
IfTrueAction=[!PauseMeasure #CurrentSection#][!Delay 2000][!UnpauseMeasure #CurrentSection#]

[ImageMeter]
Meter=Image
ImageName=#@##action#[Step#number#].png
DynamicVariables=1
W=64
H=64
SolidColor=255,255,255,150
LeftMouseUpAction=[!UpdateMeasure Random]

[actionMeter]
Meter=String
Text=#action#[Step#number#]
DynamicVariables=1

Feel free to ask questions.
pixljacket
Posts: 3
Joined: October 21st, 2019, 9:35 am

Re: Need Help with making a shimeji-ee like skin

Post by pixljacket »

This really helped, thank you very much!
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need Help with making a shimeji-ee like skin

Post by balala »

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:

    Code: Select all

    [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:

    Code: Select all

    IfCondition=
    IfTrueAction=
    IfCondition2=
    IfTrueAction2=
    ...
    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.