Hello, thank you very much for your time, first of all, I now understand what you explained, I was trying to use the variable directly from the Variables.inc file, and that was my mistake, I now understand how it can be solved, in addition to the correction in the options LeftMouseDownAction, I had to apply the same logic on the options like this ButtonCommand=[!SetVariable InclinationAngle[#Planet] "#Angle#"][!WriteKeyValue Variables "InclinationAngle[#Planet]" "#Angle#" "#@#Config \Variables.inc"][!Refresh "@AL\Planets\#Planet#"][!HideMeterGroup Planet] in the variable modification options, so that when changing and accepting the new value it is also available, and is now complete, and working perfectly as expected, thanks to that guide. It is true that no matter how much I read, I have to think a little more as a program and not as mathematics, to understand how to manage the variables, of course, that every time you guide me to solve a problem I become more nourished by these alternatives. The possibilities are many, and it is true that every time I take a step new concerns appear, but I am very happy with everything I have learned here with you.balala wrote: ↑September 27th, 2023, 6:48 pm First in the LeftMouseDownAction options of the [SelectPlanetTierra], [SelectPlanetLuna] (and so on) meters, you have bangs only to write the appropriate values to the [Variables] section of the @Resources\Config\Variables.inc file. A skin never can use a just-written value of a variable unless you're refreshing the skin, or (and usually this is a much better approach) besides the !WriteKeyValue bang you add a !SetVariable bang as well. This way you do two things: you write the value to the appropriate file, to can reuse it in case of a refresh and you get the same value dynamically, for immediate use in the skin.
So, for instance, add the following, red-marked bangs to the LeftMouseDownAction option of the [SelectPlanetLuna] meter: LeftMouseDownAction = [!DisableMeasureGroup Planet][!WriteKeyValue Variables PlanetSelect Luna "#@#\Config\Variables.inc"][!SetVariable PlanetSelect "Luna"][!SetVariable Planet "[#PlanetSelect]"][!SetVariable Size "[#Size[#Planet]]"][!SetVariable Speed "[#Speed[#Planet]]"][!SetVariable Angle "[#InclinationAngle[#Planet]]"][!UpdateMeasureGroup Planet][!EnableMeasureGroup Planet][!ShowMeterGroup Planet].
Note that besides setting the new value for the PlanetSelect variable, I updated with additional !SetVariable bangs the values of the Planet, Size, Speed and Angle variables as well. We have to do this because otherwise you don't get updated the appropriate values of these variables.
Didn't check, but you have to check, to have a DynamicVariables=1 option in every measure and meter, in which you want to use the values of the set variables (Planet, Size, Speed and Angle).
With this addition you still won't see an update of the variables when you click another planet, but this is happening only because the values of the #SizeLuna# and #SizeSol#, #SpeedLuna# and #SpeedSol# (and so on) variables are coinciding, in the @Resources\Config\Variables.inc file. If you set different values for these variables, you'll get the values updated, by adding the above bangs. Obviously I described here what you have to add only to the LeftMouseDownAction option of the [SelectPlanetLuna] meter. You have to add similar bangs to all LeftMouseDownAction options of all similar meters ([SelectPlanetTierra], [SelectPlanetVenus], [SelectPlanetMercurio] and so on).
Additional notes (recommend to take this into account):Please let me know if the above things helped.
- Make sure (absolutely sure) you've added the DynamicVariables=1 option to all meters and measure in which you are using the variables, as described above. On meters and measure on which this option is missing, you don't get updated the variable(s).
- Recommend not to use the LeftMouseDownAction option, unless it has to be used (use it only when you have both, a LeftMouseDownAction and a LeftMouseUpAction options on a meter). Use instead LeftMouseUpAction. You find out why in the Note here.
- The #@# variable contains the backslash, no need to manually add one more. For instance this character is not needed right after the #@# variable, in the ImageName option of the [SelectPlanetMercurio] meter. There the ImageName you've used is this: ImageName = #@#\Images\Mercurio\Mercurio\Mercurio0.png (obviously once again this is just an example, you have such characters in all places where you did use the #@# variable). This option should look this way: ImageName=#@#Images\Mercurio\Mercurio\Mercurio0.png. Finally this is not a mistake, because Rainmeter simply ignores the not-needed characters (you can add even more than one single), however, strictly speaking, it is not needed. You can find out why, in the PS of this post.
I already applied all the corrections that you recommended, and I studied the link you sent me, and all the LeftMouseDownAction options were rectified to LeftMouseUpAction.
And in all the skins I used #@#/ they also looked like this #@#.
I understand what you suggested I study. I already fixed this skin, now I will do it on all that I have made in the same way so that they are rectified as they should be.
The Options DynamicVariables=1 were missing in some measurements as you mentioned, I already reviewed them and wherever these variables are used I already added them. and the most important:
I already tested it and it works correctly, perfectly I would say. I can't stop thanking you for helping me.
And now, putting aside the past problem and not to make an extra publication, I continue right here.
Since you suggested that it be one thing at a time, here's the next one:
Regarding the adjustment of the size of the Balloon in bitmap I am having a small problem, although I read that in the [Rainmeter] section the dynamic variables do not work, there I am controlling the speed and it works perfectly, but I also want the length and width measurements of The skin adjusts according to the size you give the balloon. Since I have to handle the measurements differently, as you see in the code, I created a formula to vary the adjustment value of the variable Size=0.15 up to 2.25, which coincides with the size that I gave to the others, adjusting from 1 to 15 .
Problem:
SkinWidth=(170*#Size#) values are not updated
SkinHeight=(170*#Size#) I already tried manually indicating the value corresponding to the multiplication, that is, 170*1.05, directly and it works fine. It is worth adding that the planet does increase in size correctly according to the calculations, what I cannot get to work is the size of the skin as adjusted in the [Rainmeter] section.
I have attached the test mask to see if we can fix this.
Code: Select all
[Rainmeter]
Update=#Speed#
Author=AlexSoft
SkinWidth=(170*#Size#)
SkinHeight=(170*#Size#)
[Variables]
Planet=Globe
SizePlanet=5
FolderAtm=#@#Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=255,255,255
ColorAtm=255,255,255
Speed=75
InclinationAngle=0
[MeasureSize]
Measure=Calc
Formula=#SizePlanet#
IfCondition=(#CURRENTSECTION# = 1)
IfTrueAction=[!SetVariable Size 0.15]
IfCondition2=(#CURRENTSECTION# = 2)
IfTrueAction2=[!SetVariable Size 0.30]
IfCondition3=(#CURRENTSECTION# = 3)
IfTrueAction3=[!SetVariable Size 0.45]
IfCondition4=(#CURRENTSECTION# = 4)
IfTrueAction4=[!SetVariable Size 0.60]
IfCondition5=(#CURRENTSECTION# = 5)
IfTrueAction5=[!SetVariable Size 0.75]
IfCondition6=(#CURRENTSECTION# = 6)
IfTrueAction6=[!SetVariable Size 0.90]
IfCondition7=(#CURRENTSECTION# = 7)
IfTrueAction7=[!SetVariable Size 1.05]
IfCondition8=(#CURRENTSECTION# = 8)
IfTrueAction8=[!SetVariable Size 1.20]
IfCondition9=(#CURRENTSECTION# = 9)
IfTrueAction9=[!SetVariable Size 1.35]
IfCondition10=(#CURRENTSECTION# = 10)
IfTrueAction10=[!SetVariable Size 1.50]
IfCondition11=(#CURRENTSECTION# = 11)
IfTrueAction11=[!SetVariable Size 1.65]
IfCondition12=(#CURRENTSECTION# = 12)
IfTrueAction12=[!SetVariable Size 1.80]
IfCondition13=(#CURRENTSECTION# = 13)
IfTrueAction13=[!SetVariable Size 1.95]
IfCondition14=(#CURRENTSECTION# = 14)
IfTrueAction14=[!SetVariable Size 2.10]
IfCondition15=(#CURRENTSECTION# = 15)
IfTrueAction15=[!SetVariable Size 2.25]
DynamicVariables=1
[MeasureFrameCalc]
measure=Calc
formula=counter % 120
dynamicVariables=1
[Atm]
Meter=Image
X=1
Y=0
TransformationMatrix=#Size#;0;0;#Size#;0;0
ImageTint=#ColorAtm#
ImageName=#FolderAtm#/atmospher.png
DynamicVariables=1
[MeterGlobe]
Meter=Bitmap
MeasureName=MeasureFrameCalc
X=10
Y=10
ImageTint=#ColorPlanet#
BitmapImage=#@#Images\#Planet#\#Planet#\#Planet#.png
BitmapFrames=120
BitmapExtend=1
TransformationMatrix=(#Size#*Cos(Rad(#InclinationAngle#)));(-1*#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Cos(Rad(#InclinationAngle#)));(#Size#*(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#)))));(#Size#*(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#)))))
DynamicVariables=1