Complex Console Commands

  • godhydra
    20th Apr 2016 Member 0 Permalink

    I've been recently screwing around with tpt.el commands, making random elements and stuff, and I've been wondering about how many there are. I've already got explosive, flammable, name, description, gravity, falldown, diffusion, weight, color, hardness, loss, and meltable. (I found these just scouring through the tpt saves)

     

    Is there any other commands?

  • jacob1
    20th Apr 2016 Developer 1 Permalink
    boxmein creative a massive reference of the entire lua api. You can see the stuff about tpt.el here: https://www.boxmein.net/tpt/tptelements/reference/lua-reference.html#tpt.el

    tpt.el is one of the things that was never documented in the official wiki. You can read more about each property here: https://powdertoy.co.uk/Wiki/W/Element_Properties.html
  • godhydra
    20th Apr 2016 Member 0 Permalink

    So if I want to change wood into a liquid, do I type tpt.el.wood.state=liquid? Or do I type tpt.el.wood.properties=type_liquid? I dunno. Can I have an example of how to use the properties and the state commands? (Just one each.)

  • boxmein
    21st Apr 2016 Former Staff 0 Permalink
    @godhydra (View Post)
    The tree is most useful if you have a slight understanding of TPT internals. It serves mostly as a reference, not a tutorial, but I've included some explanatory text in the tree itself.

    How you'd set WOOD to a liquid is this:
    1) Look up tpt.el properties, discover there's a "state" that has to be some sort of number.
    2) Either guess the numbers or Ctrl+F "element states" - notice there's all the element states already exposed as constant values as a property of the "elements" object.
    3) Assign the state value:
    tpt.el.wood.state = elements.ST_LIQUID
  • jacob1
    21st Apr 2016 Developer 0 Permalink
    @boxmein (View Post)
    Oh, but we removed .State in 91.0 so that is a bad example. All the state stuff returns 0 now, and you can "set" it but it has no effect. I recommend removing .State from your reference everywhere.

    Right now you might do:
    tpt.el.wood.properties = bit.band(bit.bnot(0x0000001F), tpt.el.wood.properties) + elem.TYPE_LIQUID
    tpt.el.wood.falldown = 2

    The first line clears any existing state properties and adds the liquid one, the second one changes it to use the liquid movement code (we don't have variables for this yet).

    Then ... it still doesn't work because the air code is making it solid. You might have to copy some more properties from water:
    tpt.el.wood.loss = tpt.el.watr.loss
    tpt.el.wood.airloss = tpt.el.watr.airloss
    tpt.el.wood.airdrag = tpt.el.watr.airdrag
    tpt.el.wood.gravity = tpt.el.watr.gravity

    Untested because my mod crashed as I was typing it ??? So maybe you need more
  • godhydra
    22nd Apr 2016 Member 0 Permalink

    Alright, thanks.

  • boiiplay
    23rd Sep 2021 Banned 0 Permalink
    This post is hidden because the user is banned
  • plutonium68
    18th Feb 2022 Member 0 Permalink

    I've noticed that i can change energy particles' colors with tpt.el. commands, but why can i do that with non-energy particles?

Locked by LBPHacker: necro