Space Engineers

Space Engineers

EasyCommands
Merlin of Mines  [developer] 9 Jan, 2022 @ 7:53am
Bugs
Something doesn't seem like it's working right? Let's chat about it and see if we can fix it.
< >
Showing 1-15 of 60 comments
Kitt3ns 21 Jan, 2022 @ 10:16am 
Hi there, I was having trouble getting a timer block to trigger so I created an isolated grid in an empty vanilla to run a test.

I have a large grid platform with the Easy Commands programming block, a timer block, a light, and a solar panel for energy.

The timer block is set to turn on/off the light so I can see if it works or not. If I trigger the timer block manually through the control panel it works as expected and turns on/off the light. However if I try to get the Easy Commands programming block to trigger the timer block I get an exception error.

Here is the code:
----
trigger "EZC Test TB"
wait 2 seconds
trigger "EZC Test TB"
----

Note: EZC Test TB is the name of the timer block and was copy/pasted directly from the control panel into the custom data code.

This is the error I get:

----
Exception Occured During Parsing
Unable to parse command from
command parameters at line
number: 1
----

For kicks i put in the silence command for the timer block to see if that would change anything.

----
silence "EZC Test TB"
wait 2 seconds
silence "EZC Test TB"
----

I got the same exception error as above.

and to rule out the programming block acting up I inputted this code

----
turn off "EZC Test Light"
wait 2 seconds
turn on "EZC Test Light"
----

The script completes and the light turns off and on as expected.

So yeah, not sure why but it doesn't like this timer block. Is this a bug or am I dumb?
Last edited by Kitt3ns; 21 Jan, 2022 @ 10:17am
Merlin of Mines  [developer] 21 Jan, 2022 @ 12:11pm 
Hey @Kitt3ns!

EasyCommands parses each line into a command, and needs to know at parsing time whether the thing in double quotes is a Selector, or just a string.

To determine whether it is a selector or a string, EasyCommands checks whether the given string contains a known Block Type of Block Group Type keyword. If so, it is considered as a possible Selector, vs just a string.

If the given string doesn't contain a known Block Type, you need to tell EasyCommands that the given string is supposed to be a Selector by supplying a Block Type or Block Group Type after the string.


So for the Timer Blocks, instead of

silence "EZC Test TB"

you'd need to specify

silence "EZC Test TB" timer block

Alternatively you can change the name to include a Block Type keyword, like "Timer". This is why "EZC Test Light" is working, since "Light" is a known Block Type.


Check out Selectors for more information:
https://spaceengineers.merlinofmines.com/EasyCommands/selectors

Hope that helps!
Kitt3ns 21 Jan, 2022 @ 12:50pm 
Oh my gosh I knew it was something dumb. :D I remember reading about the block type keyword in the documentation too! Thanks for the help! This script is bonkers amazing and I'm really enjoying being able to use the benefits of scripts without really deep programming experience.
Experementor 24 Jan, 2022 @ 3:40am 
Heya! I think the level parameter for hydrogen tanks is broken (havent tested it with anything else)
The command

print "Hydrogen Tank" level

spits out
Exception Occurred:

LargeHydrogenTank does not have property (unknown symbol - a question mark in a sideways square symbol)
Merlin of Mines  [developer] 24 Jan, 2022 @ 6:31am 
@Experementor

Can you confirm you are using the latest Easy Commands version on that block?

I've added an issue to address the bad output messaging, but I think the property is supported in the latest version (just tried myself):

https://github.com/MerlinofMines/EasyCommands/issues/162
Last edited by Merlin of Mines; 24 Jan, 2022 @ 7:00am
Experementor 25 Jan, 2022 @ 3:29am 
My apologies. As it turns out, I had an outdated version of the script on that block. I updated it and now it works.
Experementor 25 Jan, 2022 @ 3:54am 
Ran into a small problem with send/listen.
Running the latest version of the code on both grids.
On the receiving end I have this:

async call comms

:comms
listen "ReferenceCoords"
wait until false
repeat

On the sending side I have this:

:TransmitReference
set Command to "set global reference to " + ("Remote Control" position) + " as vector"
print Command
send Command to "ReferenceCoords"
repeat

And it works. It does what it needs to do BUT.
if you change something in custom data of the reciever so it has to do parsing again, instead of just starting out as normal, it will spit out this:

Queued threads: 1
Async threads: 0
message [ReferenceCoords]
Complete.

and nothing works.

Unless I recomplie the block, at which point everything starts to work. Right up until you change something in custom data, at which point it once again spits out the same thing
Merlin of Mines  [developer] 25 Jan, 2022 @ 7:59am 
@Experementor

Thanks for bringing this one to my attention, I think I see what's happening here and it's definitely a bug. I've added an issue to address this:
https://github.com/MerlinofMines/EasyCommands/issues/167
Rümmler 27 Jan, 2022 @ 3:43am 
It's not really a bug, more like an inconsistency (or maybe intended)

If you run
Print "Display names: " + "a Programmable block" display names

the print shows all display names in ", except for Keyboard.
So it is printing >>"Large Display"<< but only >>Keyboard<<

Nothing breaking and more a cosmetical than a functional issue imho.
Aicam 27 Jan, 2022 @ 12:57pm 
That is an interesting side effect of every name but keyboard containing a space.

'"a Programmable block" display names' is internally represented as a list of strings and for some reason its print function wraps anything that contains a space in the end into quotes.
Last edited by Aicam; 27 Jan, 2022 @ 1:00pm
Merlin of Mines  [developer] 27 Jan, 2022 @ 6:00pm 
Rümmler.363VD ✠@

I believe this is one i had done intentionally. When printed using the print command, string values containing a space are wrapped in quotes to clarify that they are part of a single string.

We could change this behavior to always wrap strings by checking whether the input type is String and if so, wrapping. I didn't do it everywhere because I found that having the quotes around every key / value when looking at the map got annoying. I agree with the inconsistency when looking at the values via print.

The quotes are not actually part of the value, and are not present if you use the values directly, however:

print my display names joined "\n"
Merlin of Mines  [developer] 3 Feb, 2022 @ 8:44pm 
@Experementor

I believe I have fixed the bug related to active messages halting your script after updating the script and re-parsing. I was able to re-produce the bug locally and with the fix I couldn't re-pro it any longer. Can you confirm it is fixed for you?

The issue with bad output property messaging is also fixed
Last edited by Merlin of Mines; 3 Feb, 2022 @ 8:45pm
Experementor 3 Feb, 2022 @ 11:41pm 
@Merlin

I believe you are correct. I can't reproduce the bug again either.
I appreciate that very much! thank you!
Which is why I hate to be the nitpicky guy with regards to the encyclopedia page. If these are the sort of issues you'd rather not be brought to your attention at the moment, I will keep them to myself in the future.

Having said that

Door Block Handler page - missing keywords for both the block and the group.
Light Block Handler page - key word for intensity has a typo - it reads "intesity" - I copied it over as is without looking, to avoid making a typo myself and spent some time trying to track down the source of the error.

These are the two I tracked down.

As an apology for nitpicking - allow me to show you what I've used your code for.
(you want to interact with the lcd on the blue structure. Should be self-explanatory enough, I hope ^_^)
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2742135759

P.S. Disregard the missing mod warning - it's just a bunch of unrelated stuff - you want to look at the cryostorage and it's all vanilla
Last edited by Experementor; 3 Feb, 2022 @ 11:48pm
Merlin of Mines  [developer] 4 Feb, 2022 @ 8:04am 
@Experementor I definitely don't mind being told about issues with the docs, as I know there's plenty of outstanding issues. I have just updated the door and light block handler docs to fix the described issues.

The CryoStorage facility is really cool! With your permission I'd like to add it to my EasyCommands examples world (still WIP) so that other folks can benefit from it. Great use of EasyCommands! :)
Last edited by Merlin of Mines; 4 Feb, 2022 @ 8:05am
Experementor 4 Feb, 2022 @ 12:56pm 
You are more than welcome to! I'm glad you like it. I thought you might =)
< >
Showing 1-15 of 60 comments
Per page: 1530 50