Space Engineers

Space Engineers

DragonsKin's Mech Leg Driver
Enderspoons 1 Jan, 2018 @ 11:44am
Code Error: System.NullReferenceException
This bug seems to appear regardless of how I input the tags, and I set them up exactly to the letter as dictated in the instructions, so I assume it must be a bug with the code.

Full bug:
"
System.NullReferenceException:
Object reference not set to an instance of an object.
at Program.ParseConfig(IMyProgrammableBlockpb)
at Program.Main(String args, UpdateType updateType)
"

Happy New Year!
< >
Showing 1-11 of 11 comments
drag0nsKin  [developer] 1 Jan, 2018 @ 11:11pm 
Thanks! I'll look into this asap. Mind giving me the setup you are working with? I just need the parts, name, and config of one leg of your build. Sorry for the problems, I hope we can get to the bottom of this soon!:steamfacepalm:
drag0nsKin  [developer] 1 Jan, 2018 @ 11:23pm 
Ah, I missed a component in the instructions. I will add it right after this...sorry for the mishap.

The programming block should be named "Leg Driver" (w/o quotes of course). The script wasn't able to determine which block to check the configuration for :steamhappy:
Enderspoons 2 Jan, 2018 @ 7:51am 
Ah. Thank you.
As for my configuration, I more or less built it exactly as described
(Bipedal, Left/Right tags, rotors correctly aligned, pistons included. ankles facing inwards.
Enderspoons 2 Jan, 2018 @ 8:18am 
Hang on, it's thrown a new one.

It appears that it gets as far as the feet gear when testing the arguments (Tested on both legs, both are tagged and named) and then throws this:

"
System.Exception: There was an error setting parameters provided.
*Be sure to include the tag (ex. [Left]) on all Leg components. All component tags of each Leg (hip,extension,ankle,feet) should match.*

at Program.walkHandler(UpdateType updateType)
at Program.Main(String args, UpdateType updateType)
"
Advice would be greatly appreciated.
drag0nsKin  [developer] 2 Jan, 2018 @ 10:52am 
I can/will look more into this after work. First thought though is that it couldn't find one of these: a "Hip Rotor [Left]", "Ankle Rotor [Left]", "Leg Piston [Left]", or "Feet Gear [Left]" (Left leg example). Each leg would require at least one of each. It looks like it would have got through the config portion though and if it did your programming block should have some fields in CustomData. If so you could try to change run_when_incomplete to true and see which part it isn't finding (the one that doesnt function appropriately) when you run it to try and narrow down the problem.
drag0nsKin  [developer] 2 Jan, 2018 @ 7:18pm 
This is intriguing. So as you can likely tell from the message, it is a custom fail point. The trigger for that specific message is the script failing to find one of the leg components. This appears to be another mistake I my end in documentation. It has been updated, but had you naming your Landing Gear something like "Feet Gear [Right]". The naming on those should instead be something like "Foot Gear [Right]" (notice the singular term). The non-plural form seemed more appropriate so I went with that in a final revision of the script and forgot to update the docs :steamfacepalm: #programmingwoes.
Enderspoons 2 Jan, 2018 @ 7:42pm 
That is really helpful to know, thank you!
If no more problems crop up when I reconfig my mech out tomorrow, that might do it. If not, I'll let you know.

And by the way, I like Foot over Feet, since each landing gear is techincally one or part of one foot.
Last edited by Enderspoons; 2 Jan, 2018 @ 7:43pm
Enderspoons 4 Jan, 2018 @ 3:12pm 
I can confirm, renaming them to Foot Gear has completely rectified the problem. Thank you.
All I need to do is reconfig the legs so I don't get a hop-mo-tron...
drag0nsKin  [developer] 4 Jan, 2018 @ 3:28pm 
Sweet! Thanks for doing that, I honestly really appreciate you coming back to say it worked:steamhappy:. One recommendation I didn't place in docs was to turn upward thrusters (downward facing) off while walking. Heavier mechs might need some on, but I have been able to run without them.
Last edited by drag0nsKin; 4 Jan, 2018 @ 3:29pm
Enderspoons 4 Jan, 2018 @ 5:00pm 
Nice to see that I helped!

Oh, and here's the result. It's a little unstable, and liable to fall on its face whilst walking across sloped terrain, but it works nonetheless: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1257785854
Last edited by Enderspoons; 4 Jan, 2018 @ 5:07pm
drag0nsKin  [developer] 4 Jan, 2018 @ 7:53pm 
Nice! Looks great :steamhappy:! For the tilting issue, may I suggest adjusting the gyroscope_tilt_offset variable in the Leg Driver's CustomData? A negative value indicates a forward tilt, if you are getting too much of that you could try a postive value and get some backwards tilt. Does require a forward-facing gyroscope named "Balance Gyroscope" with override enabled.
Last edited by drag0nsKin; 4 Jan, 2018 @ 8:01pm
< >
Showing 1-11 of 11 comments
Per page: 1530 50