Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
If you have trouble using Wallpaper Engine's user properties in your code though, it would be best if you could paste what you got so far and what you are trying to achieve exactly.
How does var work?
In CSS, it is a string that gets pasted into where ever I want and parsed after insertion, in which it inserts a hex color with a space at the end breaking the ability to add alpha channels without very elaborate CSS coding.
Right now, I put the var into the position script of one element. Would I be able to use that variable in other scripts in other elements?
I have also read about let, but what let refers to is unknown to me. (let's go!)
They don’t just store them as strings however, but moreso it depends on what you put into them. (Strings, numbers, objects..)
You cannot use them to transfer your variable to another script. For that to work you instead add your value to an object WE offers you.
shared.thingIwantToShare = 42;
This way you can call 42 from any other script using:
shared.thingIwantToShare;
(thingIwantToShare may be any name you want)
Let is basically the same as var, however it is only valid within a scope, for example a loop. The variable doesn’t exist outside of this block.
If that is confusing to you, search for examples linked above in the tutorials.
If you need any specific help on WE related code, the discord might have people willing to help.
The first one is:
if(engine.userProperties.dropdown = 0 || engine.userProperties.dropdown = 1)
and the second is:
if(engine.userProperties.dropdown = 0 || engine.userProperties.dropdown = 2)
"else if" is not a solution to such a problem, since it will only allow 1 of many entries to work.
Where do I put the shared script?
The thingIwantToShare; is is a math equation.
I'd also like to know how I can add if()'s within the value defining code?
As the syntax is now, it tells me that this is not possible?
it's ==, not = for the if statements.
== means you compare something.
= means you assign a variable.
Shared you put where you have a variable that needs to be shared with other scripts.
I dont know what you mean with the last one.
I previously was taught that there is no difference between = and == and was told to better use == in all cases.
And since the SceneScript uses mostly =...
But then again somewhere I saw someone use ===.
What does === mean? And does even more ='s exist or is it already overkill? xD
In BBTag, I can use {if;<statement>[;<comparator>;<2nd statement>];<true>[;<false>]} without limitation.
To assign a variable, I use {set;<scope><namespace>;<value>}
When I combine them, I would more likely put the if inside than outside to save space like
{void;{exec;import_utils}}{set;@example{userid};{if;{func.!?;{args;0}};==;true;{args;0};help}}
In the example code above, I injected my tag with external code that has usefull functions, and since it's prone to lots of breaks, I avoid it using void around it, then I set a variable with the scope personal with the name "example" and the executing user's id, and the content of it first looks whether the provided argument exists using the function "!?" which only dispenses true or false as strings, (if it dispenses them as boolean, I wouldn't even need comparator and 2nd statement) and if the user added arguments, then it is only the first argument that is set as the value of this variable, if there is no argument, then the variable value is the string "help"
Sidenote: the tag breaks if an argument at a specific position {args;0} is called and nothing returns, and it can't test for nothing.
My question was whether if can be used inside value.x = <here?>;
variable = condition ? value if condition is true : value if condition is false
Something like this:
Edit: answer to you last question, depending on the language the usage of ='s might change but in all languages i've seen it's as Rhy told you... then, === is a strict equality (search this on internet for a more in depth explanation), meaning if the two arguments are exactly the same thing it returns true if not false... for example, 2 == '2' will return true because the both reppresent the same value of 2, while 2 === '2' will return false because one is a number the other is a string... and 3 is the max number of ='s
The code provided shows that I use 2 if()'s outside one another.
(like 2 horizontal wires and 2 vertical wires touching each other at 4 points)
Is it possible to change font and get the dimensions of the element?