Console tricks

  • cracker64
    30th Jul 2012 Developer 0 Permalink

    @ThunderSt (View Post)

    To do many commands at once, you can write them to a script file.  Just type the normal commands in a text document and from tpt do the command 'dofile("filename.txt")'  You could also save the file as 'autorun.lua' and it will run automatically.

     

    You can change pressure/temp transition values as well.  This will make it have no high temp transition.

    tpt.eltransition.watr.tempHighValue = 10000
    tpt.eltransition.watr.tempHighType = 0

    To make something have no transition, you use an impossible high/low temp/pressure number.

    All values you can change per element are,

    'presHighValue' 'presHighType' 'presLowValue' 'presLowType' 'tempHighValue' 'tempHighType' 'tempLowValue' 'tempLowType'

     

    Here is an example of making DMND melt into EXOT

    tpt.eltransition.dmnd.tempHighValue = 400

    tpt.eltransition.dmnd.tempHighType = tpt.element('exot')

     

    tpt.element("name") returns the element number of that element, so you don't have to look up its number.

  • ThunderSt
    30th Jul 2012 Member 0 Permalink

    @cracker64 (View Post)

     

    Thanks cracker!

     

    Edit: how do you use tpt.el.element.properties/flammable/explosive ?

  • boxmein
    30th Jul 2012 Former Staff 0 Permalink
    @ThunderSt (View Post)
    tpt.el.element.properties is a tricky one, but I'll explain it. Stick with me on this one.
    So. Open your calculator and set it to Programmer mode. [Image]
    Next thing, open up [This] in a new tab. edit TPT++ users (aka everyone!) look here! alternatively, tptelements has it!
    Then find line 255 and onward, it should look like
    #define TYPE_PART 0x00001 //1 Powders

    Now is where the fun starts.
    Looking at the above example, I turned the comment area green. There's a number right after the two slashes. Remember that number.
    If you want more than one property from the list, read on. If not, skip to the part in red.
    Now, copy / paste all the property numbers to some free textbox, Notepad or anything.

    The properties are all powers of 2 (bit flags, so we can turn on 00000001 and 00000010 separately!) so there's a hard method and an easy method. Both work.

    Harder way (Reliable!):
    Take value 1, punch it into the calculator, click the "Or" button, punch number 2 in, (Repeat until last number is punched in), then press =. You get a total number which is your property code. You may now skip past the red area.

    Easier way (Can do without calculator!):
    Take all your property values, add them up and you'll get the property code. Skip past the red area.

    RED AREA
    Find the row where you have the property you want to give, then get the number from the comment. Slash slash number, remember that. It's your property code. You may now go forward.
    End of red area

    Remember the property code you got from the calculator (For long method) or from the single row?
    Now, get your TPT warm and ready and boot up the awesome console.
    Type tpt.el.inst.properties = 1536
    where the red number is your property code.

    If that isn't detailed enough then I dunno what is.
    Edited 6 times by boxmein. Last: 12th Jul 2015
  • ThunderSt
    31st Jul 2012 Member 0 Permalink

    @boxmein (View Post)

     

    Nice and working. Btw, I included the ''conductive'' property in my autorun.lua script.. and the element ''AWSM'' conducts only once. It's good since it makes the AWSM element be usefull in electronics, but I don't know how to make an element conduct more than just once, neither the conduct speed..

  • jacksonmj
    31st Jul 2012 Developer 0 Permalink
    @ThunderSt (View Post)
    Include PROP_LIFE_DEC to make it conduct more than once. Conduction speed is more difficult to change.
  • ThunderSt
    31st Jul 2012 Member 0 Permalink

    @jacksonmj (View Post)

     

    Ok thanks, now I know how to when I actually want to change (or create, if someone creates a tpt.el.create thing) a conductor.

     

    What about ''conduct to X, but don't conduct to Y'', and the speed?

  • boxmein
    31st Jul 2012 Former Staff 0 Permalink
    @ThunderSt (View Post)
    Conduction speed can't really be regulated to be faster than regular spark without it glitching. Slower, yes, but that you could do with a custom element update function. See a bit before in this thread or the Lua wiki section.
  • ThunderSt
    31st Jul 2012 Member 0 Permalink
    I found on TPT GitHub an intresting thing:
     
    #define FLAG_STAGNANT 1
    #define FLAG_SKIPMOVE 0x2 // skip movement for one frame, only implemented for PHOT
    #define FLAG_MOVABLE 0x4 // if can move
     
    I decided to make an ''anti-bug fix'' in my AWSOMIUM script, make the SPNG move again with console commands :D. Is there any tpt command to change the 'FLAG_MOVABLE' part?
     
  • ultibore
    5th Aug 2012 Member 0 Permalink

    @mniip (View Post)

     

    you should check the lua parts, they are full of usefull commands, here is my favorite page, because it gives all the basics (look  a little lower and note that meltable is corrected in the source code since about 81.3)

     

    https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=11946

     

  • ThunderSt
    5th Aug 2012 Member 0 Permalink

    @ultibore (View Post)

     

    This thread was alearedy dead, and you just bumped it to say there are a lot of usefull commands in another one. We alearedy know the commands, you just bumped for no reason at all.