Space Engineers

Space Engineers

94 ratings
Advanced Walker Script v2 Tutorial
By Queen Bee
This guide should teach you these things:
- the physical requirements of your mechs
- setting up to make first movements
- tweaks to make your mech walk reliably
- additional features
   
Award
Favorite
Favorited
Unfavorite
Example World and Mechs
Here is a quick mech showcasing the script with vanilla parts
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2822698942

Here is a vanilla mech, more fleshed out
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2826168517

Here is a modded mech
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2794347877

I will always release the scripts on my discord and on new Mechs that i publish
you can also get it here now
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2686110637
Physical Requirements
- At least 6 Actuators in total (Rotors/Hinges) for the hips, knees and feet (red),
you can have multiple Actuators per Joint

- Enough freedom of movement:
for example the knees should be able to fully extend and bend for at least 90 degrees
(the script does not support double knee or digitigrade setups)

- Gyro Assistance (GA) setups (green):
place a rotor or two in the (lower) torso of your mech facing up/down with inertia tensor enabled (experimental game setting) then place a gyroscope on top and enable override

- Torso Twist rotor (blue), not mandatory but recommended

- a Remote Control on the (lower) torso, facing forward (for balancing) (removed from Feb. 2025)

- a ShipController of any kind anywhere on the torso (here a cockpit)

- The Torsos center of mass should be above the Hip Rotors / Torso Twist

- a camera between the legs looking down with the top facing forward (removed from Feb. 2025)


The Mech in the picture has its knees bent backwards, so it will be a "chicken walker"
First Script Setup
  1. Load the Script into a Programmable Block and recomplie it
  2. Open the Custom Data of the Programmable Block

  3. Make sure the cockpitname matches up with the Block that you are controlling the Mech with
  4. The referencename is the name of the Remote Control in the (lower) torso
  5. The camera is used to detect the ground below the mech (feature removed Feb. 2025)
  6. mechname will display with the paperdoll screen - set to whatever you want
  7. scriptnumber can be used to have multiple scripts running side by side for using multiple sets of legs (e.g. setting it to "1" will change the Actuator Tags to HR1+ and so on)
  8. If autohalt is false the mech will keep going when the player has dampeners disabled and exits the cockpit (also works for Remote Controls) - its not recommended as the Mech can tip over more easily without player input

  9. statsusecockpitscreen:
    • if true a screen in the cockpit will be used to display the current angle of the torso twist rotor, while "statsoutputscreennumber" defines the number of the screen as there are usually multiple (numbered 0 to 3)
    • if false a screen with the "statslcdname" will be picked

  10. integrityusecockpitscreen:
    • if true a screen in the cockpit will be used to display the paperdoll that represents various functional blocks of the mech, while again "integrityoutputscreennumber" defines the number of the screen as there are usually multiple (numbered 0 to 3)
    • if false a screen with the "integritylcdname" will be picked, the size of the paperdoll can be changed with "integrityscale"

  11. kneesforward determines the direction the knees are facing, either forward or backward

  12. Now Its time to give Tags to the Actuators:
    • HR+ for the Right Hip
    • HL- for the Left Hip
    • KR+/- and KL+/- for the knees
    • SR+/- and SL+/- for strafing (from Feb. 2025)
    • FRP+/- and FLP+/- for the feet, +/- depending on how they are mounted (you instantly see where it moves and change it around)
    • TT+/- for the Torso Twist Rotor
    • GA+/- for Gyro Assistance rotors (as explained in the beginning)
Recompile the script if youve placed a new rotor or give it some limits yourself
Leg Tweaking
  1. thighlength and calflength (yellow):
    • if the lengths of the thighs and calves are the same then they are also the same
    • if one is longer than the other then set it so that the values represent the proportional difference

      do not set them lower/higher than 1.5-3, they are not real distances!

  2. standingheight determines how tall the mech is standing up by default (value should be between 0.65 and 0.9)
  3. positive standinglean pushes your mechs lower torso forward, this can help if your center of mass is shifted forward or backward, lower is always better
  4. hipoffset (green) for when the Actuators are not in line
  5. kneeofset (green) for when the Actuators are not in line, this time its also turned -90 degrees so in total that comes to -80
    4 and 5 are crucial to making it walk well, 2 degrees can make a big difference
  6. set footpitchoffset to -90 or +90 if its mounted in a different way - setting it very low can also make your mech look up or down a little by default
tweaks in the editor:
after above shown tweaks:

Your mech should now have a good looking standing stance, when crouching the feet should only move vertically, and when going forward or backward the foot that is on the ground should move in a straight line - if that s good then you can continue
Walking Cycle Tweaking
  1. rotorlimits is not only for legs but it sets the limits of all used Actuators including Torso Twist, excluding GA rotors
    You should now be able to copy it onto the ground
  2. stepspeed should be increased if the mech tips too far to the side when taking steps, decreased when it takes steps before the foot is actually on the ground, making it trip
  3. maxspeed is what you experience when holding full throttle, it should be decreased when increasing stepspeed and then slowly increased when you feel confident with the animation
  4. accelerationlean makes the mech lean into the acceleration/deceleration, its stronger at low speeds
  5. accelerationmodifier determines how fast the speed value changes, a higher value will make your mech accelerate and decelerate faster, it should be handled with care
You can expect to reach speeds of 7 to 12 m/s depending on how well balanced the mech is and how much time you spend on tweaking the script
Additional Features
  1. Paperdoll integrity representation:
    • the doll will automatically track your legs
    • there are currently 7 custom groups that can be tracked by using tags in the groups name:
      "-RUA" for the Right Upper Arm Blocks
      "-RLA" for the RIght Lower Arm
      for the left arm vice versa
      "-LTF", "-CTF", "-RTF" for three torso section respectively

      there are no groups for representing the rear at the moment as the script only tracks functional, so to say internal blocks
  2. Jump Jets:
      (removed from Feb. 2025)
    • all thrusters are disabled by default, when you input upward movement (space usually) they will all be turned on
    • subgrid thrusters will be set to 100% of thrust if "overridethrust" is set to true (default), it can be disabled to control subgrid thrusters via additional scripts or when you need a certain amount of thrust and dont want it to be messed with

  3. Anti Roll Assist:
      (removed from Feb. 2025)
    • to counter falling over to the side you can now add this, it will activate when the mech is tilted more than 5 degrees
    • tag the gyro with RA
    • tag the rotor with RA+/- (RA- in this configuration)
    • enable inertia tensor on the rotor

  4. Aiming:
      (removed from Feb. 2025)
    • TTM+/- marks the joint you want to aim left and right with, TTM2+/- for the joint to sync with it
    • ME+/- marks the joint you want to aim up and down with, ME2+/- for the joint to sync with it
    • its a bit tricky to set up at the moment
    • when set up right, the arms should move by your mouse and the torso should follow to meet up with them (within arc limits)

  5. Importing/Exporting Values:
    • All values that control walking are now stored in the programmable blocks own Custom Data (can be turned off)
    • changing values there will directly be imported to the script

  6. Run with Argument:
    • walk to simulate toggling W
    • halt to simulate releasing W
    • sync and offsync to force the script to a certain step, do this to two Scritps to sync their leg movement initially
    • crouch to toggle crouch (speed can be adjusted to keep it from jumping)
80 Comments
Queen Bee  [author] 17 Apr @ 3:22pm 
use AI blocks to aim the legs and you can run the script with "walk" to autowalk forward
OMEGA 17 Apr @ 1:39pm 
is it possible to somehow give the mech ai so that it moves on its own? if so is it possible to give it commands?
Queen Bee  [author] 28 Nov, 2024 @ 9:11pm 
Search for scriptnumber in the custom data, there you can add the number (or whatever you feel like)
Civilized_Man 28 Nov, 2024 @ 4:56pm 
scriptnumber can be used to have multiple scripts running side by side for using multiple sets of legs (e.g. setting it to "1" will change the Actuator Tags to HR1+ and so on) ??? How do you do this it isn't in the guide anywhere
Queen Bee  [author] 26 Oct, 2024 @ 10:41pm 
Yes its in the customdata
Mac and Cheese 26 Oct, 2024 @ 10:52am 
is it possible to disable the thrusters getting turned off when not holding space bar?
Mischief_Master 6 Oct, 2024 @ 12:08pm 
Took me hours to tweak it right and it still sucks, i built it just like your pictures in this guide and it walks like a paraplegic baby
Queen Bee  [author] 19 Aug, 2024 @ 2:33am 
skill issue
Civilized_Man 3 Aug, 2024 @ 7:51pm 
Having an issue where if I build a mech then it leans forward no matter the setting or flips violently on its back. have gotten close to a level mech then it simply claged out and blew up a hole the size of the og red ship in the planet where it was standing and twirled around ripping itself apart until nothing was left aside from the cockpit which is still spinning and kills me instantly if I get to close to it. Might be my own doing but it could be a bug in the script somewhere. copy pasted mechs from the workshop have no issues. So likely something I'm doing wrong which the guide does not cover???
Gamedude102334 18 Jul, 2024 @ 11:53am 
idk for sure but i think the script is broken or something, ive spent a week wrestling it and trying to get it working but it just wont work, itll make the legs do a little wiggle every now and then but thats the closest thing to working it does