MerlinofMines / EasyCommands

Github Repository for Ingame Scripts built by MerlinofMines. Uses MDK to Deploy to SpaceEngineerse
GNU General Public License v3.0
8 stars 3 forks source link

[Feature Request] Access to Block Integrity / Damage #243

Closed Nibato closed 2 years ago

Nibato commented 2 years ago

Is your feature request related to a problem? Please describe. I'm currently using EasyCommands to weld up some connectors that absolutely must be built before continuing with the script. However, there doesn't seem to be an easy way to check if a block is damaged or fully constructed

Describe the solution you'd like Having some sort of access to BuildIntegrity, MaxIntegrity, and CurrentDamage from IMySlimBlock as additional properties for blocks would be fantastic

Nibato commented 2 years ago

Updated the issue name, apparently I left it blank originally. Sorry about that!

MerlinofMines commented 2 years ago

Interesting request! Looks like we can add this to all existing Terminal Blocks and extending types, which would be nice.

I will likely look at this once I have multi-property support enabled, as I think we'll want to use things like "My Welder" build ratio to represent the build percentage. I'm currently working on that and hope to have it out soon, so stay tuned! Thanks for the request

MerlinofMines commented 2 years ago

Looks like the Integrity & Damage play together in a sort of weird way. I think I will try to obfuscate this from the user as much as possible.

Damage appears to be calculated independently of the build integrity. So to find the true integrity & build ratio of a block, you need to incorporate the two.

True Integrity = (build integrity - currentDamage).

So.. I'm thinking of the following properties: Build Level = build integrity - currentDamage Build Ratio = (build integrity - currentDamage) / max integrity Build Limit = max integrity Build (also Complete, Build+Complete) = (build integrity - currentDamage) == max integrity Damage (also Damage Level) =

I think I'll ignore the in game "damage ratio" property which seems pretty useless, as it returns values between 1 & 2 and doesn't incorporate build integrity.

New Property Words

Build Property Words: build, building, built

Damage Property Words: damage, damaged

Supported syntax:

Is Built (and complete)

when "My Turret" is built when "My Turret" is complete when "My Turret" is finished building when "My Turret" is done being built wait until "My Turret" is built

Build limit

Print "Integrity Limit: " + "My Turret" build limit

Build Level

print "Build Level: " + "My Turret" build level print "Build Height: " + "My Turret" build height

Build Ratio

print "My Turret" build percentage Print "My Turret" build ratio

Damage / Damage Level

if "My Turret" is damaged Print "We need some repairs!" print "Current Damage: " + "My Turret" damage print "Current Damage: " + the "My Turret" damage level

Damage Limit

Print "Damage Limit: " + "My Turret" damage limit

Damage Ratio

print "My Turret" damage ratio print "My Turret" damage percentage