SEModCommunity / SE-Community-Mod-API

Space Engineers Community Modding API
GNU Lesser General Public License v3.0
60 stars 47 forks source link

BUG: Setting BuildPercent of a Grinder causes crash #118

Open Tyrsis opened 10 years ago

Tyrsis commented 10 years ago

This is not new, as it was happening before patch, but I didn't post it until I fully looked at it.

This only happens with grinders that I've discovered so far, but now I'm testing every cubeblock. I assume it's an actual game bug, and not API. I'm working around it for now, but I figured I'd post it here. Easily tested by setting a grinder cubeblock to buildpercent of 0.1, then setting it back to 1 (can do it in GUI). You get the following error:

http://pastebin.com/XCfYLwqa

Tyrsis commented 10 years ago

Let me update this, as flipping the buildpercent value from 1 to 0.1 then back to 1 doesn't seem to trigger the bug in GUI. If you start the world with the grinder at 0.1 buildpercent, then update it to 1, that will trigger it.

Tyrsis commented 10 years ago

Add to the list of bad blocks to set buildpercent: Interior Turrets, Gatling Turrets and Missile Turrets. Making it happen works in a similar way as above:

http://pastebin.com/m5CdtUc7

chessmaster42 commented 10 years ago

Does this only happen when snapping from bare framework to completed or does it also occur if you do it in increments of 0.25?

Tyrsis commented 10 years ago

In increments. I was actually simulating building happening over time and it would build fine all the way up to when it switches from non-functional to functional. I get around this right now by setting the buildpercent to 100% before adding the object to the scene, then once the object is added to the scene I set the buildpercent back down to 0.01% and increment from there. If I do that, it doesn't cause the crash.

chessmaster42 commented 10 years ago

Can you test on the latest game version with the latest dev build of SEServerExtender? I'm betting it will still behave the same but either way I would like to know.

Tyrsis commented 10 years ago

This is still happening. It's not when the turret goes from non-functional to functional. It appears to happen when the ship is finally powered (from an unpowered state). I can do more testing and find exactly when it's happening. But it's something to do with being built from 0.01% slowly up, and then the reactors coming online.

That being said, setting the BuildPercent to 1 before adding the cubegrid to the scene, then setting it back to 0.01 still works. The problem with this though is if the server goes down during the build process, the ship will be saved in a partially built state, and when the server comes back and building resumes, the turrets / grinders will already be added to the scene (since the ships are loaded from the save instead of via API), causing the crash. So I think the safest thing for me to do right now is just keep turrets and grinders at 100% (which kind of sucks)

fvgoulet commented 9 years ago

Have you tried to add a cubeblock fully built and then decreasing its build state to what you want?