It is currently October 19th, 2020, 3:51 pm

Variable X/Y

Help with creating, editing & fixing problems with skins
conifer
Posts: 9
Joined: August 10th, 2010, 6:53 am

Variable X/Y

Post by conifer »

I'm trying to make a variable X/Y value for my skin but I don't see what I'm doing wrong.

Code: Select all

Internetspeed=100000

[mNetworkDl]
Measure=NetIn

[mNetworkDl2]
Measure=Calc
Formula=mNetworkDl/1000
DynamicVariable=1

[mDlY]
Meter=String
Measure=Calc
Formula=(mNetworkDl/#InternetSpeed#)

[Dl]
Meter=STRING
MeasureName=mNetworkDl2
X=150
Y=mDlY
FontColour=#TextColour#
FontSize=#TextHeight#
FontFace=#TextName#
AntiAlias=1
AutoScale=1
StringAlign=Center
NumOfDecimals=0
What it's doing is writing out the internet download in kb but moving it up and down according to the value. This is just the portion of the code that I'm working on but it should be independently working.
User avatar
JpsCrazy
Posts: 690
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Variable X/Y

Post by JpsCrazy »

[mDIY] is a meter AND a measure. Take out the meter=string.
conifer
Posts: 9
Joined: August 10th, 2010, 6:53 am

Re: Variable X/Y

Post by conifer »

JpsCrazy wrote:[mDIY] is a meter AND a measure. Take out the meter=string.
Tried it, doesn't work.
User avatar
JpsCrazy
Posts: 690
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Variable X/Y

Post by JpsCrazy »

Post the whole code?

You may need to add DynamicVariables=1 to the meter with the Y that's a measure, and possibly to measures.
conifer
Posts: 9
Joined: August 10th, 2010, 6:53 am

Re: Variable X/Y

Post by conifer »

JpsCrazy wrote:Post the whole code?

You may need to add DynamicVariables=1 to the meter with the Y that's a measure, and possibly to measures.
http://pastebin.com/Z2xScN09
It's pretty big, and thanks for looking/helping me out.
Most of it is useless to the situation at hand but the variables are on line5 and net measures are on line65.
The new part I'm adding is at the bottom (line611).
User avatar
JpsCrazy
Posts: 690
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Variable X/Y

Post by JpsCrazy »

I don't know if this is the case, but your formula [mDlY] may be off.
See, it's Formula=mNetworkDl/#InternetSpeed#. And mNetworkDl I've never seen above 1000. While InternetSpeed is 650000. So. It's supposed to move a fraction of a pixel. Even if it was happening, you wouldn't notice.
You may need to adjust #InternetSpeed# or the formula to move it.

*Edit* Lies. Just noticed the k after the value occaisonally. Sorry, I'm a bit tired. Nonetheless, it may be the problem.
conifer
Posts: 9
Joined: August 10th, 2010, 6:53 am

Re: Variable X/Y

Post by conifer »

Ok, I've tried a couple other things and I think I found the problem.
For some reason, I can't set the Y value as the output of another meter.
I tried it with various calc formulas, as mudance as (50*1 for example) and the Y value stays at zero.
Maybe someone can tell me how you can set the y value as the output of a meter. Alternately, I can set the Y value to a variable but then I don't know how to set the variable to equal the output of a meter.

(my formula was wrong but that was fixed)
Last edited by conifer on August 12th, 2010, 5:50 am, edited 1 time in total.
User avatar
Varelse
Posts: 65
Joined: April 22nd, 2009, 7:46 pm

Re: Variable X/Y

Post by Varelse »

You need to use DynamicVariables

Code: Select all

Internetspeed=100000

[mNetworkDl]
Measure=NetIn

[mNetworkDl2]
Measure=Calc
Formula=mNetworkDl/1000
DynamicVariable=1

[mDlY]
Meter=String
Measure=Calc
Formula=(mNetworkDl/#InternetSpeed#)

[Dl]
Meter=STRING
MeasureName=mNetworkDl2
X=150
Y=[mDlY]
FontColour=#TextColour#
FontSize=#TextHeight#
FontFace=#TextName#
AntiAlias=1
AutoScale=1
StringAlign=Center
NumOfDecimals=0
DynamicVariables=1
conifer
Posts: 9
Joined: August 10th, 2010, 6:53 am

Re: Variable X/Y

Post by conifer »

Varelse wrote:You need to use DynamicVariables
You, sir, are a gentleman and a scholar.

Edit: I'm working on this anyways but suppose I wanted to make it so that if the output from mDlY 200 or more, the Y value in Dl equaled 'x' numer, say 250 regardless of any equation. How?
This is the fixed version:

Code: Select all

[mDlY]
Meter=String
Measure=Calc
Formula=(mNetworkDl/#InternetSpeed#)*200
IfAboveValue=200
IfAboveAction=0
DynamicVariables=1

[Dl]
Meter=STRING
MeasureName=mNetworkDl2
X=150
Y=(190-[mDlY])
FontColour=#TextColour#
FontSize=#TextHeight#
FontFace=#TextName#
AntiAlias=1
AutoScale=1
StringAlign=Center
NumOfDecimals=0
DynamicVariables=1
Everything is already defined/working, just not sure what to put in ifaboveaction= or y=
User avatar
Varelse
Posts: 65
Joined: April 22nd, 2009, 7:46 pm

Re: Variable X/Y

Post by Varelse »

First, [mDIY] is a measure not a meter, so you don't need Meter=String. Secondly, you only need DynamicVariables on meters or measures that are affected by the changing variables. Thus, [mDIY] doesn't need DynamicVariables=1 on it. Get rid of the IfAbove keys. They aren't doing anything and you don't need them.

Code: Select all

[mDlY]
Measure=Calc
Formula=(mNetworkDl/#InternetSpeed#)*200 > 200 ?  250 : (mNetworkDl/#InternetSpeed#)*200
This says if (mNetworkDl/#InternetSpeed#)*200 is above 200, then return 250. If it is less than 200, return (mNetworkDl/#InternetSpeed#)*200. It's a if then statement. I'm not entirely certain that the formula works since it's untested, but that is the right format.

Code: Select all

[Dl]
Meter=STRING
MeasureName=mNetworkDl2
X=150
Y=(190-[mDlY])
FontColour=#TextColour#
FontSize=#TextHeight#
FontFace=#TextName#
AntiAlias=1
AutoScale=1
StringAlign=Center
NumOfDecimals=0
DynamicVariables=1