Space Engineers

Space Engineers

483 ratings
Easy Automation V2.0
6
9
4
3
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
356.981 KB
30 May, 2016 @ 3:50pm
26 Sep, 2023 @ 1:57am
65 Change Notes ( view )

Subscribe to download
Easy Automation V2.0

Description
Current Version from this subscription = 2.054

Also check out my first Space Engineers Mod:
Easy Access Programmable Block Controls
https://steamproxy.net/sharedfiles/filedetails/?id=2872094732

Timer Block no longer needed as of V2.035

Not compatible with:
- Space Data Center by mooviies

New features since release:

v2.040
- Added ability for Rename statement to use variables like the Write statements do. You can't use Rename if your block name contains a \

V2.041
- Addressed Keen's change to how rotors deal with being out of the set limit range. Rotors should now be functioning correctly and be able to rotate counter clockwise once again.

V2.042
Added the ability to use negative angles with rotors and hinges (to account for using hinges that have negative lower limits) with the Rotate and ShortRotate statements.

v2.043
-Added the ability have EA2 code in the Custom Data field of any block, not just LCD's.
-As a result the "Show Properties" and "Show Actions" statements now require a debug LCD to be shown.
-Multiple LCD's can now be named as the debug LCD and all will show the debug info. This works in the same way that Named Groups work when referencing other blocks.

V 2.044
Added ability for Variables to reference other Variables in text (useful for passing a compiled variable as a run argument for a Programmable block)
Added a Closing round bracket to the list of ending characters for variable v in InsertVars method on line 1694 so it could recognize the end of the variable name that is at the end of enclosing brackets.

v2.045
CustomWrite, CustomWriteNew, CustomWriteLine, and CustomClear now work with all blocks that have a terminal interface, not just LCDs

v2.046
Fixed bug where having a * as the first character in a write statement's write text would confuse the parser into thinking it was the instruction for a Dynamic variable pointer.

V2.047
added a missing bit of logic to combine multi word component names before a != operator into a single token.
- thanks to Survival Ready for the bug find.

V2.048
Math in the Variables code block can now use other variables.
Do not attempt to put the variable into it's own Math function. This will create an infinite loop and will lock up the programming block. If you do, you will need fix your variable code and recompile the programmable block to get it working again.

V2.49
modified how EA handles filled of gas tanks, it now returns a ratio.

V2.050
- Fixed issue where the last character in a value taken from the detailed info would not be included.
- Changed floats to doubles for the ability to do math with larger numbers.
- Added the ability obtain the amount of blocks that have been completed in a projection as well as the percentage a projection is finished.
-To get the number of blocks finished use "Build progress of Projector"
-To get the % of the projection that is finished use "Build progress% of Projector"

V2.051
- Added special case for obtaining the connected status of a connector.

V2.052
-removed an old cast to LCD that was preventing the custom data of all blocks from being used when referencing other CodeBlocks.

V2.053
- Added the ability to select which screen you wish to write to on blocks that have more then one screen (like a cockpit) by appending the number of the screen directly after the write statement like so:

WriteNew2 to MyCockpit = "Text" will write to the second LCD in the cockpit

if you have other blocks in the group that have less screens then what you have marked then the text will display on screen 1 as a default.

v2.054
-Added some error handling to the screen write and fixed bug with how blocks with to few screens would be handled.

Current Version from this subscription = 2.054

Welcome fellow space engineers, to the Easy Automation InGame Script V2.0
Much has changed since the previous version which is why I am releasing this as a new item on the workshop.

The Easy Automation V2.0 script will allow you to:
  • Delay actions to millisecond precision
  • Manipulate the Sliders and Actions of every block
  • Stop an Automation until a desired situation happens and then resume
  • Take a Value from one block and apply it to another
  • Rotate a rotor to a desired angle at a desired speed
  • Create complex logic which will govern how your automation’s react to different situations
  • Have unlimited LCD code size
  • Write and manipulate text on LCD's
  • Write current values of blocks to LCD's (such as a pistons "Current position")
  • Write to the core LCD the actions and properties of a block you may want to manipulate
  • Modify block names (Especially useful when interacting with other tech such as Digi's Control Module)
  • Create and destroy specialized groups as well as use the games built in groups (the built in groups can't be created, destroyed or modified with this system)
  • Run other programs with arguments you define in your program
  • Reset the Easy Automation system in case of a systems failure
  • View debug info of a non functioning automation in the detailed info of the Programming block
  • Assign simple algebra equations to variables
  • Edit the LCD code as the programmable block is running it for run time testing/experimenting.
  • And maybe some other stuff that I can't remember right now, this thing has gotten pretty big!



I have written up a detailed guide for set up and all available functionality here:
http://steamproxy.net/sharedfiles/filedetails/?id=685206874

If you are still having trouble after referring to the guide then ask your questions in the "Questions on Use" discussion below or in the discussion you will find below the guide.

Good luck fellow Spacefarers and happy Engineering!

Feb 2nd 2017 - The Stable and Dev versions of the programmable block are now the same.
Popular Discussions View All (10)
284
27 Jun @ 11:45am
Questions on Use
Coren
155
2 Apr @ 7:59pm
Bug Reports
Coren
6
6 Sep, 2020 @ 9:54pm
Previously working build (as of march 3, 2020) no longer works on current
Const
891 Comments
LukeStrike 24 Oct @ 2:19pm 
Another thing that should be useful, instead of:
if ...
{
<dosomething>
}
else if ...
{
<dothesame>
}
why not to have:
if ...
or if ...
{
<dosomething>
}

to avoid that ton of {}
thus, also:
and if ...

LKS
LukeStrike 24 Oct @ 2:14pm 
Thus to have a more consistent syntax I suggest:
<@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
LukeStrike 24 Oct @ 2:14pm 
Just few ideas ...
- 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
dragonsphotoworks 24 Oct @ 3:09am 
Not sure how much larger this could get and still run in SE :-)
LukeStrike 24 Oct @ 2:52am 
@Coren ... do you think about a v3.0 ?
I"ve a ton of improvement proposals ;)
Ok, forget about that ;)
LKS
LukeStrike 22 Oct @ 2:24pm 
@Coren that's what I'm doing with FontSize but yes you can use other specific components values ;)
LKS
Coren  [author] 22 Oct @ 4:00am 
@LukeStrike
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.
LukeStrike 22 Oct @ 2:10am 
@Coren THANKS !!! :)
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
LukeStrike 22 Oct @ 1:52am 
@Code Digits & @Jack Schitt
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
Jack Schitt 21 Oct @ 6:33pm 
@Code Digits: Variables may be what you're looking for. We can also store full codeblocks either in the same block the code looks for or in another block's custom data and run them from another script (codeblock) by simply calling it with @ or running it with or without an argument .