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 ...
{
<dosomething>
}
else if ...
{
<dothesame>
}
why not to have:
if ...
or if ...
{
<dosomething>
}
to avoid that ton of {}
thus, also:
and if ...
LKS
<@mycomponent> @mycodeblock <args>...
In absence of @mycomponent, the default is the component where the code resides itself
- this should apply also (same syntax thus) to the run argument again for more consitency
- also and very important for me: IF the PB running EA2 has a default argument it executes that argument AT START ... no need to trigger it thru a sensor or whatever ... this is requiered to have some EA2 scripts that work in loop AND start without any external action when the game launches
LKS
- real variables that can be modified, tested etc
- a more consistent syntax fe:
Color of <mylight> = <mycolor>
(aka variables recognized in any place in a statement)
- a more consistent way to put comments:
*something (with no space) can cause troubles you have to put a space ... why ?
and also you cannot write:
something ... *this is a comment
- a better way to pass arguments to code blocks like this:
@mycode{
something *1 = something *2
}
that you can call with:
@mycode <arg1> <arg2>
(instead of having to prefix with the @blockcontainingthecode( stuff ...)
- so change the * in something else for comments or arguments to avoid confusion
I"ve a ton of improvement proposals ;)
Ok, forget about that ;)
LKS
LKS
If you want to store numbers you can use the values in blocks as storage, Like the brightness of a light. Then you just use that value to set other values as you like
Example:
@Variables{
Value = Brightness of StorageLight
}
@StoreValue{
Brightness of StorageLight = 100
}
@SetRotor{
Rotation of MyRotor = Value
}
This is also described at the end of the Variables section of the steam guide.
I've splited my code between 2 PBs and now it "compiles"
I already had those 2 PBs, the first one running EA2 in loop and the second one responsible of single commands so I transfered a part of the second one code who was crashing into the first one lets says as a "library" ... so each code is now +/-300 lines and does not crash.
I must say that the possibility to store code in anything that has a custom data is GREAT ! That means that you can have a huge code stored everywhere (lcds but also and why not in gyrocopes ?) ... infinite libraries/databanks, I like that :)
LKS
Nope, "variables" are in reality CONSTANTS ... you cannot use them to store something.
Ex:
@Variables{
#ColorHunting = 64:106:128
}
I can use #ColorHunting everywhere in my code (so I can easily change it in its declaration) but I cannot set it to another value (snirf)
For "storing values" the only way I've found at this moment is to use the FontSize of anything having at least one display panel.
Ex:
@Variables{
#StateHunting = 0.1
#StateWarning = 0.2
}
...
If FontSize of VY Programmable [XVY] = #StateHunting
{
@_doWarning
FontSize of VY Programmable [XVY] = #StateWarning
}
LKS