It is currently March 28th, 2024, 12:06 pm

Animation?????????????????

Get help with creating, editing & fixing problems with skins
Post Reply
JediWarrior
Posts: 60
Joined: June 18th, 2017, 8:22 pm
Location: Liverpool UK

Animation?????????????????

Post by JediWarrior »

hello Again All.

I'm reworking one of Manfort (99vilages) mega refined skins. I'm not good enough yet to write code from scratch so I have to look for meters that do something similar and edit the code and variables etc.
Im trying to get a meter working that should show a world map and then red spots appearing at different locations until it reaches image 20 and then start again. I copied some code of Manforts code that was supposed to control the bar graph on the Top Bar of Neon Space and replaced file names and What I assumed was some kind of multipler according to the number of images to display in the [frameCalc] section. When I run it, some of the frames show and others dont and to be totally honest I'm lost. Ive included the code I'm working on so please if anyone can see an obvious mistake please let me know or if the problem could be elsewhere let me know.. ;-) :confused: :confused: :confused: ;-)

Code: Select all

[gtnw]
Meter=Image
ImageName=#@#\Images/TopBar/gtnwanim/gtnw.png
ImageTint=
x=710
y=14
h=75
w=101
UpdateDivider=10


[gtnwFrameCalc]
measure=Calc
formula=counter % 20-----------[-This is what I assumed was a multiplyer according to the number of frames. It was originally                                                     
substitute=".00000":""                 st to 6]
disabled=0
dynamicVariables=2
UpdateDivider=10

[gtnwstrikes]
meter=Image
ImageTint=
x=0r
y=0r
W=101
H=75
ImageName="#@#\Images/TopBar/gtnwanim/gtnw[gtnwFrameCalc].png"
DynamicVariables=1
Last edited by Brian on September 6th, 2017, 3:47 am, edited 1 time in total.
Reason: Please use [code] tags
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Animation?????????????????

Post by eclectic-tech »

JediWarrior wrote:hello Again All.

I'm reworking one of Manfort (99vilages) mega refined skins. I'm not good enough yet to write code from scratch so I have to look for meters that do something similar and edit the code and variables etc.
Im trying to get a meter working that should show a world map and then red spots appearing at different locations until it reaches image 20 and then start again. I copied some code of Manforts code that was supposed to control the bar graph on the Top Bar of Neon Space and replaced file names and What I assumed was some kind of multipler according to the number of images to display in the [frameCalc] section. When I run it, some of the frames show and others dont and to be totally honest I'm lost. Ive included the code I'm working on so please if anyone can see an obvious mistake please let me know or if the problem could be elsewhere let me know.. ;-) :confused: :confused: :confused: ;-)

Code: Select all

[gtnw]
Meter=Image
ImageName=#@#\Images/TopBar/gtnwanim/gtnw.png
ImageTint=
x=710
y=14
h=75
w=101
UpdateDivider=10


[gtnwFrameCalc]
measure=Calc
formula=counter % 20-----------[-This is what I assumed was a multiplyer according to the number of frames. It was originally                                                     
substitute=".00000":""                 st to 6]
disabled=0
dynamicVariables=2
UpdateDivider=10

[gtnwstrikes]
meter=Image
ImageTint=
x=0r
y=0r
W=101
H=75
ImageName="#@#\Images/TopBar/gtnwanim/gtnw[gtnwFrameCalc].png"
DynamicVariables=1
There are several problems with your code, but I wonder why you are trying to make a square peg fit into a round hole! ;-)

It would help to have your 21 images; the main image you load in [gtnw] and the 20 frames you call in [gtnwstrikes]...

Let's start with your [gtnwFrameCalc] measure. There are reason to use COUNTER as the source of a calc measure, but not for a simple count from 0~19 or 1~20. The COUNTER is a special internal value that starts at zero when the skin is loaded and continues to increase on each update, never resetting, until the skin is unload. For simple counting, it is better to use the Loop measure or a self-incrementing Modulo calc measure.

You also have UpdateDivider=10 on [gtnwFrameCalc] measure, so it will return the current value of COUNTER only every 10 updates; 1, 11, 1, 11, etc.

Remove the update divider from [gtnwFrameCalc] measure, and it will return 0~19 as the value.

That should now show your images if they are in the correct folder and named correctly.

If you don't care where the dots appear, then here is a much simpler example...
Here is an alternate way to show random dots on a map image, using 2 random number calc measures (X, Y) and a solidcolor image meter...
ww2.gif
Uses image: world-sepia-clear.png (save in "#@#\Images\TopBar" folder)
worldmap-sepia-clear.png

Code: Select all

[gtnw]
Meter=Image
ImageName=#@#Images/TopBar/worldmap-sepia-clear.png
ImageTint=
x=0
y=0
h=75
w=101
UpdateDivider=-1

[mRandomX]
Measure=Calc
Formula=Random
LowBound=10
HighBound=90
dynamicVariables=1

[mRandomY]
Measure=Calc
Formula=Random
LowBound=10
HighBound=65
dynamicVariables=1

[gtnwstrikes]
meter=Image
ImageTint=
x=([mRandomX])
y=([mRandomY])
W=3
H=3
SolidColor=255,0,0
DynamicVariables=1
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Animation?????????????????

Post by SilverAzide »

The code sample is incomplete, so you can't tell what is going on with the rest of the skin, but another reason your skin is might not be displaying properly is that it is missing a !Redraw bang. You'll need this if your animation is faster than your overall refresh rate. Add this bang to an OnUpdateAction on your loop or calc measure to force the skin to redraw.
JediWarrior
Posts: 60
Joined: June 18th, 2017, 8:22 pm
Location: Liverpool UK

Re: Animation?????????????????

Post by JediWarrior »

Hi Everyone, Thanks for the answers I think I've cracked it with your help but now the meter its counting for is displaying the images too fast. Its probably glaringly obvious but , how do I slow it down without the update divider. I wanted about a 3 second pause between each frame. The code I've got for it now seems to be working in the correct order etc its just too fast. Here's what I've got now,

Code: Select all

[gtnw]
Meter=Image
ImageName=#@#\Images/TopBar/gtnwanim/gtnw.png
ImageTint=
x=710
y=14
h=75
w=101
UpdateDivider=10


[gtnwFrameCalc]
measure=Loop
StartValue=0
EndValue=20
Increment=1
LoopCount=0

[gtnwstrikes]
meter=Image
ImageTint=
x=0r
y=0r
W=101
H=75
ImageName="#@#\Images/TopBar/gtnwanim/gtnw[gtnwFrameCalc].png"
DynamicVariables=1

Sorry about the code not being displayed properly but I tried the "code" tab and this is how it came out again. (Sorry Brian)

:oops: :oops: :oops: :thumbup: :bow: :bow:
Last edited by jsmorley on September 6th, 2017, 9:24 pm, edited 1 time in total.
Reason: Edited to add [code][/code] tags.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Animation?????????????????

Post by eclectic-tech »

You could control the speed of animations by making the UPDATE value in the [Rainmeter] section higher or lower; default, if not specified, is 1000 (milliseconds), updates each second. So to have it update once every 3 seconds, try setting it to 3000.

Code: Select all

[Rainmeter]
Update=3000
AccurateText=1
DynamicWindowSize=1
Another way to control the rate of change of the images would be to add an update divider to the [gtnwFrameCalc] section, so it only updates every 3 seconds. (Of course this means you did NOT modify the Update in the [Rainmeter] section) see Update Guide:

Code: Select all

[gtnwFrameCalc]
measure=Loop
StartValue=0
EndValue=20
Increment=1
LoopCount=0
UpdateDivider=3
Why are you dividing the update on your first image? Without knowing what these images are, I can't say for sure, but if that is a background image, I would suggest setting UPDATEDIVIDER=-1, since it never needs to be updated after loading the skin.
JediWarrior
Posts: 60
Joined: June 18th, 2017, 8:22 pm
Location: Liverpool UK

Re: Animation?????????????????

Post by JediWarrior »

Hello again Everyone,, I think I've done it with your help. I didn't want to take the skin update up too high cuz it would affect other meters on the skin, so I worked out a balance between the skin update rate and taking Electic Tech's advice to put an updateDivider in the FrameCalc section. Again Thank You all for help and advice. This really may not be the place to say it but as I said when I became a member I suffer with a really horrible depression that takes my life over too many times. I was really struggling up to a few months back and came close to the unmentionable on a couple of occasions. Then I found Rainmeter and I've always been interested in customization but really didn't have the energy to find out how to. Rainmeter was an easy way to customize and gave me something to think about.And I've met generous people who give advice and expect nothing. I've also met good people on Deviant Art through this site, so really all of you good people thank you for enjoying helping people and making life so much easier for people in my position. :welcome: :bow: :bow: :D :beer: :party: :YESSS:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Animation?????????????????

Post by eclectic-tech »

It's always a balancing act when you add animations! :)

Happy to lend assistance :welcome:
JediWarrior
Posts: 60
Joined: June 18th, 2017, 8:22 pm
Location: Liverpool UK

Re: Animation?????????????????

Post by JediWarrior »

:D :D
Post Reply