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
I believe you should be able to get the custom data of an LCD screen by fetching the Terminal Block type for your block name.
set myData to "My LCD Screen" terminal block data
print "My Data: \n" + myData
I was wondering if there's any way at all to pull text from custom data of an LCD screen. I'm trying to make more or less a dialogue tree thing and I want to store the possible texts in the displays themselves - in Custom Data - but so far couldn't find a way to access it. Help would be very appreciated
"Eureka'd" upon what should be a more elegant solution, but being able to pull the waypoint info from the various AI blocks using EasyCommands would be great if possible.
Mahalos!
Been playing with how it can be used with the AI blocks and such, and have hit a wall.
How can you get the info of the "waypoints" that are made in the AI Recorder block?
My various attempts yields all the various info for the block, EXCEPT for the waypoint info.
Need some form of conditional check of what order the waypoints are in so that the path may be reversed to facilitate auto-docking.
I have the AI Rec/AI Flight working so that my craft can dock, and even so the path is automatically reversed for UN-docking with various other EZComms/timer block actions being made during the process.
But, suppose I pilot the craft out myself instead of having the AI un-dock me, and later wish to auto-DOCK, the AI Recorder flight path will still be set to the UN-dock path.
Perhaps something like the DOCK path could be set as a global variable in EZComms, while the reversed UNDOCK path is another that could be recalled when needed.
Mahalo
Glad you figured it out. I would call out that you *can* name your blocks whatever you want, but in some cases you may need to tell EasyCommands what kind of block to look for in your Selector.
By default, EasyCommands looks at the last block type name in your name to infer the block type, if you haven't specified one. So "Piston Drill" would be looking for a Drill, whereas "Drill Piston" would be looking for a piston.
If needed, you can clarify to EasyCommands what block type to look for by specifying it after the block name.
Here's some examples:
#This would look for a drill
set "Piston Drill" height to 5
#This would look for a piston
set "Drill Piston" height to 5
#This would look for a piston
set "Piston Drill" piston height to 5
#This would look for a drill
turn on "Drill Piston" drill
See Selectors for more information:
https://spaceengineers.merlinofmines.com/EasyCommands/selectors
Hope that helps!
I'm having a problem with pistons, or version of the mod.
if i paste old blueprint(circa2022) i can set piston speed by:
set the "Elevator Piston" velocity to 2
or
set "Elevator Piston" speed to 2
but when i load current version to programming block neither does work, same goes for checking piston current position or reversing them..
As i was typing this i found the problem, Do not name you pistons like: "Piston Drill", Piston Dril" works flawlesly
Unfortunately the Welder block doesn't provide support to detect if it has unfinished blocks in range, so EasyCommands can't detect this.
You can definitely determine if a connector is locked and/or a merge block is merged. Check out the block handlers for these for examples:
https://spaceengineers.merlinofmines.com/EasyCommands/blockHandlers/connector
https://spaceengineers.merlinofmines.com/EasyCommands/blockHandlers/merge
You can do this via:
set "Button Panel" display[0] images to ["Danger", "Offline"]
print "Button Panel" display[0] images joined "\n"
set "Button Panel" display[0] interval to 1.5
or, by name:
#Print Display names
print "Button Panel" display names
#Set the button images
set "Button Panel" display["Numpad 2"] images to ["Danger", "Offline"]
#Set the button image change interval
set "Button Panel" display["Numpad 2"] interval to 0.5
https://spaceengineers.merlinofmines.com/EasyCommands/blockHandlers/display
If one is not listed, you can figure this out by adding the image you want to your text panel and then print the images using the command I mentioned, and that'll get you the image name.
Hope that helps!
You can set the ImageChangeInterval using "interval". Looks like I don't have this documented.
#Sets the interval to 1.5 seconds
set "My Display Panel" display interval to 1.5
You can set the images using "images" (this one is documented)
Here's an example:
print "Current Images: "
print "Text Panel" display images joined "\n"
# Set the images
set "Text Panel" display images to ["Danger", "Offline"]
# Set the display interval
set "Text Panel" display interval to 1.5
1) Using a sci-fi button panel (the one with screens) I want to set the "ImageChangeInterval" for one screen but I cannot figure out how to do it. As the display block does not inherit from the terminal block, it seems that the syntax might be different?! Could you help me out here?
2) Also, with the display blocks, there is an option to define the image rotation. Here, again, I was unable to understand how to set that with "EasyCommands"
Cheers and thanks in advance!
To some extent, yes. Check out
Controlling Unsupported Block Types [spaceengineers.merlinofmines.com]
There isn't a built-in property for this, but you can set it using the in-game property using the following:
set isSharingInertiaTensor to "My Hinge" hinge "ShareInertiaTensor" property
print "Sharing Inertia Tensor: " + isSharingInertiaTensor
print "Setting Share Inertia Tensor to true"
set "My Hinge" hinge "ShareInertiaTensor" property to true
print "New Property Value: " + "My Hinge" hinge "ShareInertiaTensor" property
You can get the list of block property names using:
print "My Hinge" hinge properties joined "\n"
Cheers!
I cannot seem to find any documentation in the guides or within these comments/discussions regarding functions accessible through experimental mode, specifically the "Share Inertia Tensor" function.
when "My Camera" camera is triggered
There isn't a built in way, but you can do this yourself using a loop:
for each i in 0..10
increase "My Wheel" suspension height by 1
wait 0.1
Glad you're enjoying the script. IIRC cameras will detect grids and voxels. Unfortunately you can't distinguish between currently, but I don't think that'd be an issue for your use case.
I also have a small question: Is the camera block handler only triggered by grids or by voxels, too?
I have always wanted to do something like a proximity sensor. I know that there are a few out there but people mostly use this in the 500-5000 m range to detect enemys. My idea is to use the raycast feature for close proximity feedback (like in your car showing the distance when parking). I would use this for landing with large ships in tight spaces (instead of going in to 3rd person view).
Definitely sounds doable. You can use a Projector's Ratio property to get whether the projector is 0% or 100% built.
You can rotate a rotor either to a specific angle, or in your case, just reverse it.
And you can turn on/off welders/grinders pretty easily.
Feel free to add more detail on what you're trying to accomplish in the Scripting Questions discussion, and I can help out further.
Here's a rough script to get you started, though I'm not quite sure what conditional checks you are looking for or in what order. I'm not sure you need the projector ratio (could just look for the existence of batteries in Battery Group 1, and you may be able to default to the ratio (should return 0 if none found and comparing against a number).
https://pastebin.com/Awvgd1Du
I didn't test it so it may have some parsing errors, but should get you started. Let me know if that helps! I didn't end up needing the projector ratio, but maybe I misunderstood the requirements.
I've done my best to expose all available properties from the vanilla blocks either directly or indirectly through the "properties", "actions", and "detailed Info" of all blocks. You can definitely do things like read a hydrogen tank's fill percentage.
There are limits though, the script can only detect and react to things that are exposed to the Scripting API. Unfortunately that does not include "enemy ship comes within 1km", but you can have a turret or sensor wired up and detect when those blocks have a target, which gets you close. Again, happy to discuss specifics in the Scripting Questions discussion.
Ya, I could probably get a world created, others have asked for this as well. I'll give this some serious consideration.
Cheers!
Skimming through your website it looks like you've got everything I was hoping covered! I didn't see it explicitly mentioned but I assume its possible to read
advanced block properties (e.g. hydrogen tank filled percentage)? Also is it possible to trigger events on enemy spotted (e.g if enemy ships come within 1km, close all gates) and similar functions for the new Event Controller?
My only suggestion would be to create a world demonstrating some scripts like Coren did if possible. I know you have the examples page, but those are quite advanced and is better actually seeing it live in game all fully set up. Anyways many thanks for creating this amazing script :D
I think you'll find EasyCommands up to the task for just about whatever you want to do: Conditions, functions, threads, block commands, text & LCD support, Collections, inventory management, item production, Cross-Grid scripting, keyboard & mouse input, and more.
I also think you'll find the syntax to be cleaner, but maybe I'm biased. Check it out and see if it does what you need! I'm also happy to answer questions in the Scripting Questions discussion.
Check out spaceengineers.merlinofmines.com/EasyCommands for all the available functionality.
Cheers!
You can use the Display Block Handler to set the text of an LCD:
https://spaceengineers.merlinofmines.com/EasyCommands/blockHandlers/display
set "My LCD" display text to "Some Value"
You can continually check a condition by spinning off a separate thread which then replays.
https://spaceengineers.merlinofmines.com/EasyCommands/threads#asynchronous-threads
Here's an example script that I think does what you're looking for:
https://pastebin.com/DyJZZfxd
Let me know if that helps!
Then I can just make a light block light up or off whether it's connected or not.
At the moment I need to re-run the command block everytime to check if it's connected.
Did I miss it or there's no such thing?
I'm trying to display "connected" if the ship's connector is locked and "Disconnected" if it's not.
There's also a couple small life improvements including "helm" keyword for cockpits and battery input/output limit support.
Check it out and let me know if I've broken anything. Cheers!
As always, please let me know if you notice anything broken.
v1.5.0 fixes that annoying issue where the for loop would not complete immediately and execute for "0". Let me know what you think :).
This latest release adds multi-word properties, which enables things like
if "My Connector" is ready to connect
set "My Light" color to green
Importantly, this release changes the default property aggregation from "SUM" to a special default aggregation. This new aggregation will give you a list of the block properties for non-numeric properties, and returns an empty list instead of 0 when there are no blocks. This should make more sense for most non-numeric properties.
I also added a few sought after features such as
* Grid Block Handler
* Build/Damage information for all terminal blocks
* "Ready to Connect" support for connectors & magnets
And a few other life improvements & bug fixes.
As usual, please holler if anything is broken!
Happy Scripting
I get the same error locally until I fixed the name of the cockpit it was looking for on my listener ship, and then it works.
Queued Threads: 1
Async Threads: 1
[Message] follow
Exception Occured:
Cannot perform operation: plus on
types: number, vector
*sigh* sorry :/
Just tried it out myself. The issue is likely that it's looking for your program to be called "Test Program" and since it isn't finding it, a selector index of 0 is causing the exception. This happened for me locally as well.
Remove that line and it should work for you. I should update the example.
Here's a script that compiled for me locally:
https://pastebin.com/9XdQNbae
1) I pasted in a workshop ship and made sure the cockpit was named Fighter Cockpit
2) Added a missing antenna and programmable block
3) Copied the ship twice more to be the followers. Not added scripts yet
4) Added the Sender script to the PB of lead ship and it just throws up the following before i even
add the other listener scripts
Queued Threads: 1
Async Threads: 0
[Main] sendCommand
Command: setLocation
79.8681433162037:-61.5472103524662:-
57.0774588447639
100
Exception Occurred:
Offset and length were out of bounds for
the array or count is greater than the
number of elements from index to the
end of the source collection
I wanna pull my hair out... Why won't this work for me? :((
I've been using empty list to represent null. The issue here is that aggregations by default use sum and if you don't find any blocks you get "0", which is definitely not correct.
I'm going to re-do the default aggregation mode so that for string types (and maybe others), as well as for some properties like names, text & media, the default aggregation will use lists.
The result will be that "the names of all doors that are open" will result in an empty list when none are found, vs 0. This will (1) shortcircuit the for loop and (2) enable you to check whether it is empty simply by saying "if x is empty"