Space Engineers

Space Engineers

DragonsKin's Mech Leg Driver
Enderspoons 2018 年 1 月 1 日 上午 11:44
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!
< >
正在显示第 1 - 11 条,共 11 条留言
drag0nsKin  [开发者] 2018 年 1 月 1 日 下午 11:11 
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  [开发者] 2018 年 1 月 1 日 下午 11:23 
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 2018 年 1 月 2 日 上午 7:51 
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 2018 年 1 月 2 日 上午 8:18 
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  [开发者] 2018 年 1 月 2 日 上午 10:52 
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  [开发者] 2018 年 1 月 2 日 下午 7:18 
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 2018 年 1 月 2 日 下午 7:42 
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.
最后由 Enderspoons 编辑于; 2018 年 1 月 2 日 下午 7:43
Enderspoons 2018 年 1 月 4 日 下午 3:12 
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  [开发者] 2018 年 1 月 4 日 下午 3:28 
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.
最后由 drag0nsKin 编辑于; 2018 年 1 月 4 日 下午 3:29
Enderspoons 2018 年 1 月 4 日 下午 5:00 
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: http://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1257785854
最后由 Enderspoons 编辑于; 2018 年 1 月 4 日 下午 5:07
drag0nsKin  [开发者] 2018 年 1 月 4 日 下午 7:53 
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.
最后由 drag0nsKin 编辑于; 2018 年 1 月 4 日 下午 8:01
< >
正在显示第 1 - 11 条,共 11 条留言
每页显示数: 1530 50