It is currently June 18th, 2024, 12:54 am

Can anyone help me figure out why variables arent displaying

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7441
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Can anyone help me figure out why variables arent displaying

Post by Yincognito »

LooseAllTheMonies wrote: July 30th, 2021, 7:20 amAlso does the .ini file have to be ordered [RainMeter] [MetaData] [Variables] [Measures] [Meters]? It makes the most sense that way and I don't think I would ever rearrange it but it's an extension of the previous question.
The simple answer to this for beginners is "yes" (so as to avoid them being confused and messing around the skin in a chaotic manner), but the real answer is "partially". I have the exact same question in another thread, where [Variables] is placed first and [Metadata] and [Rainmeter] afterwards (personally I always use this order) and because [Rainmeter] has some actions that need to know the value of some variables, changing the order to what you mentioned leads to unexpected (and undesirable) results. Now, I don't know yet if the user in the other thread is swapping them properly - though I believe he does -, but the right way to put this is that it all boils down to DEPENDENCIES.

In other words, the safest way to think about it is that you'll always put the B after A if B depends on A and its value - first the horses, then the carriage. Meters depend on measures' values, so they come after the measures. If a measure value depends on another measure value, you will put the former after the latter. Sure, you can then do "back-references" and modify a previous measure value through some bang in a later measure's action, but that doesn't change the fact that the former first needs to be "initialized", so to speak, in order to be used by the latter.

There was a discussion a while ago about this order of main skin sections, where the devs (specifically, jsmorley) participated as well, but I can't find it now.

Anyway, for the time being, following death.crafter's advice on this is recommended. It's simpler and good practice. I use a slightly different approach here, but that's just me - I don't expect folks to follow my way over the "official" recommendation and it's not something I'm concerned over. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22639
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Can anyone help me figure out why variables arent displaying

Post by jsmorley »

Exactly right.

Rainmeter doesn't care a lick what order things are in the .ini file.

HOWEVER, be careful about "dependencies".

There is nothing set in concrete about the order that the various built-in [SectionNames] like [Rainmeter], [Variables], [Metadata] and such are in. I find for me it is easier and safer to use an order like:

[Rainmeter]
[Metadata]
[Variables]

[Measures]
[RelatedMeters]
[Measures]
[RelatedMeters]

So while I put meters after the measures they reference, I don't make it a rule to have ALL measures before ALL meters. I kinda keep the measures and meters in related measures >> meters groupings to make it a bit easier to follow.
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: Can anyone help me figure out why variables arent displaying

Post by death.crafter »

jsmorley wrote: July 30th, 2021, 11:52 am Rainmeter doesn't care a lick what order things are in the .ini file.
I wouldn't agree, considering the order of the meters drawn.

And about dependencies, I don't know, because

Code: Select all

[Variables]
I=1

[Measure]
Measure=Calc
Formula=Measure+#I#

[Meter]
Meter=String
MeasureName=Measure
and

Code: Select all

[Meter]
Meter=String
MeasureName=Measure

[Measure]
Measure=Calc
Formula=Measure+#I#

[Variables]
I=1
work pretty much the same way.

If dependencies were considered, first one should start from 1 and second one from 0. But that's not the case.
from the Realm of Death
User avatar
jsmorley
Developer
Posts: 22639
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Can anyone help me figure out why variables arent displaying

Post by jsmorley »

death.crafter wrote: July 30th, 2021, 12:01 pm I wouldn't agree, considering the order of the meters drawn.

And about dependencies, I don't know, because

Code: Select all

[Variables]
I=1

[Measure]
Measure=Calc
Formula=Measure+#I#

[Meter]
Meter=String
MeasureName=Measure
and

Code: Select all

[Meter]
Meter=String
MeasureName=Measure

[Measure]
Measure=Calc
Formula=Measure+#I#

[Variables]
I=1
work pretty much the same way.

If dependencies were considered, first one should start from 1 and second one from 0. But that's not the case.
I should clarify. Rainmeter will obey the order that things are in the .ini file, but how you order things is up to YOU, Rainmeter doesn't enforce any rules about that.

As to dependencies, they can be important, but keep in mind that the update cycle looks like:

Update ALL measures, in the order they are in the .ini
Update ALL meters, in the order they are in the .ini
Redraw the skin

Variables are resolved when they are "used".

So the most common issue with dependencies is when you have a measure that references another measure, or a meter that references another meter, and they are in the wrong order. That can cause one of them to be "one update behind".
User avatar
Yincognito
Rainmeter Sage
Posts: 7441
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Can anyone help me figure out why variables arent displaying

Post by Yincognito »

death.crafter wrote: July 30th, 2021, 12:01 pm If dependencies were considered, first one should start from 1 and second one from 0. But that's not the case.
Bingo! See, that's why I always put [Variables] first. It's clear to me that from a logical POV everything depends on the [Variables] contents, while [Variables] in itself doesn't depend on any other section (unless through "back-references", or if you really want to do it through escaping and similar).

Not a requirement, of course, due to what jsmorley mentioned about variables being resolved when they are used, it just feels more logical to me that way.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16309
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Can anyone help me figure out why variables arent displaying

Post by balala »

Related to the order of meters, note that their order doesn't matter, unless they are relatively positioned, in which case the order becomes extremely important. On the other hand you have to take care about their order if you have to cover partially or totally one meter by another.
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: Can anyone help me figure out why variables arent displaying

Post by death.crafter »

balala wrote: July 30th, 2021, 7:19 pm Related to the order of meters, note that their order doesn't matter
balala wrote: July 30th, 2021, 7:19 pm , unless they are relatively positioned, in which case the order becomes extremely important. On the other hand you have to take care about their order if you have to cover partially or totally one meter by another.
Are you just opposing your own words lmao.

In general "it does matter."
from the Realm of Death
User avatar
Yincognito
Rainmeter Sage
Posts: 7441
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Can anyone help me figure out why variables arent displaying

Post by Yincognito »

balala wrote: July 30th, 2021, 7:19 pm Related to the order of meters, note that their order doesn't matter, unless they are relatively positioned, in which case the order becomes extremely important. On the other hand you have to take care about their order if you have to cover partially or totally one meter by another.
I believe their order matters also when they have relevant OnUpdateAction on them. Sometimes you want some of those actions to happen before or after others. In a nutshell, apart from event driven actions like this one, it's more or less the same idea as for linked / grouped or not layers in Photoshop, or even the way you draw someone's portrait on a piece of paper. Sure you can start with the eyes or the mouth, but drawing the shape of the head first offers a much better reference point for subsequent drawing.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7441
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Can anyone help me figure out why variables arent displaying

Post by Yincognito »

death.crafter wrote: July 30th, 2021, 7:37 pmIn general "it does matter."
I can fly, but I generally don't have an airplane. :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: Can anyone help me figure out why variables arent displaying

Post by death.crafter »

Yincognito wrote: July 30th, 2021, 7:45 pm I can fly, but I generally don't have an airplane. :???:
No.

I generally don't have an airplane, but I can fly. (Rainmeter gives you wings)
Order of meters matter, but they can be ignored if not required.
from the Realm of Death