Skip to content

Instantly share code, notes, and snippets.

@badosu
Last active March 9, 2024 21:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badosu/f2617db52e7486a7769366642d354a01 to your computer and use it in GitHub Desktop.
Save badosu/f2617db52e7486a7769366642d354a01 to your computer and use it in GitHub Desktop.
Tweak Options Guide

Important

Whenever playing in a public lobby make sure people playing with you actually want to play it modded. Be polite and don't try to force it.

You will be required to boss yourself to be able to set the mod options.

Tweak Units: Basic edits to specific units

{
  armpw = { metalcost = 10 }
}
  • Encode the table representation into base64. You can use https://www.base64encode.org/ for that. For example, using the above table the result is: ewogIGFybXB3ID0geyBtZXRhbGNvc3QgPSAxMCB9Cn0=

  • Boss yourself (!boss), remove the = and the end of the result and set the modoption before game, example: "!bset tweakunits ewogIGFybXB3ID0geyBtZXRhbGNvc3QgPSAxMCB9Cn0"

Notice the result is ewogIGFybXB3ID0geyBtZXRhbGNvc3QgPSAxMCB9Cn0 instead of ewogIGFybXB3ID0geyBtZXRhbGNvc3QgPSAxMCB9Cn0=

Tweak Defs: Much more advanced, allows to change stuff for all units, or group of units in much shorter piece of code.

  • Create a function representing the changes. For example, to change all units metal cost to 10:
for name, ud in pairs(UnitDefs) do
  if ud.metalcost then
    ud.metalcost = 10
  end
end
  • Encode the function representation into base64. You can use https://www.base64encode.org/ for that. For example, using the above function the result is: Zm9yIG5hbWUsIHVkIGluIHBhaXJzKFVuaXREZWZzKSBkbwogIGlmIHVkLm1ldGFsY29zdCB0aGVuCiAgICB1ZC5tZXRhbGNvc3QgPSAxMAogIGVuZAplbmQ=

  • Boss yourself (!boss), remove the = and the end of the result and set the modoption before game, example: "!bset tweakunits Zm9yIG5hbWUsIHVkIGluIHBhaXJzKFVuaXREZWZzKSBkbwogIGlmIHVkLm1ldGFsY29zdCB0aGVuCiAgICB1ZC5tZXRhbGNvc3QgPSAxMAogIGVuZAplbmQ"

Notice the result is Zm9yIG5hbWUsIHVkIGluIHBhaXJzKFVuaXREZWZzKSBkbwogIGlmIHVkLm1ldGFsY29zdCB0aGVuCiAgICB1ZC5tZXRhbGNvc3QgPSAxMAogIGVuZAplbmQ instead of Zm9yIG5hbWUsIHVkIGluIHBhaXJzKFVuaXREZWZzKSBkbwogIGlmIHVkLm1ldGFsY29zdCB0aGVuCiAgICB1ZC5tZXRhbGNvc3QgPSAxMAogIGVuZAplbmQ=

Additional References:

  • Reduce arty dmg by 10%, tweakunits
  • Make t2 more expensive, but stronger tweakdefs
  • Increase energy conversion requirements by 20%. For example, t1 metal maker makes 1 metal for 84 energy tweakdefs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment