Space Engineers

Space Engineers

Wico Cargo Percentage Control and Report [OBSOLETE]
19 Comments
Wicorel  [author] 18 Oct, 2015 @ 9:44am 
Fixed. Missing space in names.
Animal 18 Oct, 2015 @ 8:49am 
The Drill space update is amazing. hadn't realized just mow much space was in them, but my timers aren't triggering anymore
grifter 21 Jul, 2015 @ 11:01pm 
thanks for the quick update
and gratfull that it is very easy to aply
grifter 9 Jul, 2015 @ 9:04am 
thanks Wicorel
i dont know what to change i will likly need help with it but i dont mind changing it if you show me
or add it to the script if you think others mite use it
Wicorel  [author] 9 Jul, 2015 @ 7:34am 
No, it isn't it is already gathering drill data. I based the percentage on cargo space so that there would be still enough room to take stone out of drills/cargo and into ejectors/connectors.

If you are capable of modifying the script, go ahead. Or do you want me to make an option for drill cargo space?
grifter 9 Jul, 2015 @ 7:08am 
Hi Wicorel

is it hard to get this scipt to look in drill cargo space as well
my new ship is 90% stored in the drills
Animal 22 Jun, 2015 @ 10:19am 
I've got two backup reactors thanks to symmetry, which helps soak up the power interuption.

for the time being i've just put another timer on as a one-shot to start the disconnect timer rather than just trigger it, to allow for offloading time
Wicorel  [author] 22 Jun, 2015 @ 9:23am 
I have a single backup reactor on my my miner. But you're right. I should allow for battery only powered ships.
Animal 22 Jun, 2015 @ 6:32am 
All Containers even connected ones would explain why this thing keeps failing to offload its cargo

It senses that the station it's connected to is not below 10% and via the timers i've set, switches over to battery management to decide whether or not to disconnect, rather than seeing that its containers are full and waiting till ofloaded to check
Animal 22 Jun, 2015 @ 4:02am 
A pretty minor detail, but regarding #5 of that list: Make sure to switch the batteries to discharge about a second before disconnection. I made that mistake on my drone, which is timer based. If i didnt flip the batteries before unlocking the connector it would just sit there, because power got interupted during the unlocking process and it couldnt complete the timer
Wicorel  [author] 21 Jun, 2015 @ 5:01pm 
Right now the script adds all containers, even connected ones.

I will either update this script or make another one for drone use that
1) uses local containers/batteries only
2) does cargo and battery in one script
3) will turn off thrusters (local group) when connected
4) turn back on thrusters (local group) when disconnected
4) set batteries to charge when connected
5) set batteires to discharge when disconnected

I have all this in my mk3 miner script, but it is exposed seperately.

Animal 21 Jun, 2015 @ 11:07am 
After experimenting with the battery script, i think something like this would be far more flexible/powerful especially if it detects whether it's docked or not
Animal 21 Jun, 2015 @ 4:05am 
I saw you posted a couple battery ones, though there was no description to go with them so i had no idea what i was dealing with.

One that works like the cargo system would be amazing, allowing my drones to abort if power starts getting low, and restart their run when fully charged.

A zero trigger would be awesome for making sure a drone doesn't leave base with much of a previous run's load on board, but i'm sure I can work with Below 10%
Wicorel  [author] 20 Jun, 2015 @ 11:01pm 
There currently is no "Below 0" triggered; it stops at 10.

I posted the battery script from my mk2 miner. It triggers a timer at 20% battery.

Did you want something that works more like the cargo one?

And did you need to Cargo to zero % trigger?
Animal 20 Jun, 2015 @ 9:56pm 
What expression should be used to activate a timer when cargo reaches 0%? Below?

Would it be possible to get a similar script for batteries instead of cargo percentage?
KillaCyte 5 Apr, 2015 @ 1:57pm 
Thanks a lot! I've got it working now. It's pretty simple to work with now that I understand it.
Wicorel  [author] 4 Apr, 2015 @ 6:10pm 
So to stop and then restart mining, you'll need at least two timers: One to stop and another to start again if cargo drops (because of stone removal).

I use a third to keep the 'cargo high' timer from getting ran every time while the cargo is still high.

So 'Cargo Above 80' is what stops the mining. It also turns itself off so it will be triggered again.
'Cargo Below 70' would resume mining.
'Cargo Below 80' turns 'Cargo Above 80' back on so it can be re-triggered.

Your 'reset' mechanism should turn 'Cargo Above 80' back on.

Cargo pct depends on the number of cargo modules and how much ore is collected on each 'run'. You want to set it just high enough to prevent starting a run where the ore would be wasted..

Survival with 1x inventory is the hardest because the cargo space is much more limited, but the ore collection amount is (pretty much) the same.


Wicorel  [author] 4 Apr, 2015 @ 4:58pm 
The code was meant for use in my miners, but it can be standalone.

You'll need to create timer blocks with the name set to the cargo capacity you want to be triggered.

Note that the code triggers the timers on each run. See my miners for examples of use.

From the description above:
The timer blocks are automatically triggers at the specified percentage in the name. The percentages are every automated ten, so 0, 10, 20, etc. through 100. Blocks are triggered for being above or below a specified percentage. So, “Cargo Above 80” will be triggered when the cargo percentage goes above (or at) 80%. “Cargo Below 80” will be triggered when the cargo percentage goes below 80%.

In the example above, "Cargo Above 80" is the name of the timer block to be triggered.

If you have a ship you want me to look at, go ahead and give a link.
KillaCyte 4 Apr, 2015 @ 11:27am 
Hello! Is this code standalone, or is it fairly tied into your own designs(pre-naming blocks and such)? I'm having trouble figuring out how to use this script, where/how to assign it values, etc. For example, you say that the script currently works off of 80% cargo capacity, but I'll be darned if I can find any preset values in the code.