Difference between revisions of "Using The Console"

From The Powder Toy
Jump to: navigation, search
m (All this edit did is add a bit to the ctype section. I'm not an admin or anything, i only knew how to make molten ice and molten diamond.)
(Rollback previous edit (introduces multiple errors and doesn't add anything new))
 
(63 intermediate revisions by 41 users not shown)
Line 1: Line 1:
 +
{{Languages|Using The Console}}
 
The Powder Toy now uses the [[ Lua]] console, which lets you do more than the old console. If you just want to do simple things, this console has easier and shorter commands.
 
The Powder Toy now uses the [[ Lua]] console, which lets you do more than the old console. If you just want to do simple things, this console has easier and shorter commands.
  
 
====  Using console  ====
 
====  Using console  ====
'''''As of 49.1 the commands now require a ! in front of them, and are also LUA enabled(LUA Scripts)'''''
+
'''''As of 49.1 the commands now require a ! in front of them, and are also Lua enabled(Lua Scripts)'''''
  
 
The console in Powder Toy is essentially a window that you can bring up that allows you to directly trigger commands coded into TPT. Because of its closeness to the code itself, you can do interesting things with it that wouldn't ordinarily be possible with just pointing and clicking, or even elaborate hacking.
 
The console in Powder Toy is essentially a window that you can bring up that allows you to directly trigger commands coded into TPT. Because of its closeness to the code itself, you can do interesting things with it that wouldn't ordinarily be possible with just pointing and clicking, or even elaborate hacking.
  
Opening the console is easy. You press the ~ key (on some keyboards it's ` or ¬) (with or without pressing shift, it's immediately left of the 1 key, above Tab on most keyboards) and the game will pause, bringing down a black window that you can type into.
+
Opening the console is easy. You press the ~ key (on some keyboards it's ` or ¬ or ^/° on QWERTZ-keyboards) (with or without pressing shift, it's immediately left of the 1 key, above Tab on most keyboards) and the game will pause, bringing down a black window that you can type into. You can also click the button written "C" on the right-top corner of the screen(6th top to down button), when you hover your mouse over it it will show "Show Console(~)".
 
 
[http://img97.imageshack.us/img97/6811/tildekey1.jpg| View the key here]
 
  
 
Compared to most consoles, Powder Toy's is actually fairly intuitive and easy to mess with, but you'll still probably have to try a few times to memorize the order of words to type in.
 
Compared to most consoles, Powder Toy's is actually fairly intuitive and easy to mess with, but you'll still probably have to try a few times to memorize the order of words to type in.
Line 14: Line 13:
 
The most relevant, or at least the most immediately cool and useful command that most people will want to know is the Set command. The syntax goes like this:
 
The most relevant, or at least the most immediately cool and useful command that most people will want to know is the Set command. The syntax goes like this:
  
'''!Set [What variable to set] [the identity of the particle/s to be set] [the value it changes to]'''
+
'''!set [What variable to set] [the identity of the particle/s to be set] [the value it changes to]'''
 
 
  
 
In other words, say I want to change particle #25 into metal. I would type:
 
In other words, say I want to change particle #25 into metal. I would type:
  
'''!Set type 25 metl'''
+
'''!set type 25 metl'''
  
 
More relevantly, you can use the keyword "All" or even an element name in place of that number. So the command:
 
More relevantly, you can use the keyword "All" or even an element name in place of that number. So the command:
  
'''!Set type all metl'''
+
'''!set type all metl'''
  
Would turn every particle in the save to metal. :D
+
Would turn every particle in the save to metal.
  
'''!Set type metl watr'''
+
'''!set type metl watr'''
  
 
...Would turn every particle of metal in the save to water. And so on.
 
...Would turn every particle of metal in the save to water. And so on.
  
'''!Set type metl none'''
+
'''!set type metl 0'''
  
 
Would remove all metal particles from the save.
 
Would remove all metal particles from the save.
Line 38: Line 36:
  
 
* Type: This sets a particle's identity. You can use this to change what an element is.
 
* Type: This sets a particle's identity. You can use this to change what an element is.
* Temp: This sets a particle's temperature. You can use it to melt a whole save all at once. >:O (please note: the temp is read as Kelvin which you get by adding 273.15 to Celsius)
+
* Temp: This sets a particle's temperature. You can use it to melt a whole save all at once. (please note: the temp is read as Kelvin which you get by adding 273.15 to Celsius)
* Ctype: This sets the temporary state of an element. This has many uses, making lava that freezes into NEUT for example. To do this, draw on some lava then go to console and type "!set ctype lava neut" (without the quotes of course) and then hit enter. Then draw something at room temp below it, and unpause it. When the lava hits the cooler object it will freeze into neut.Ctype is also used to choose what element CLNE and its variants will create.Extra Info:One interesting thing is turning ICE ctype to LAVA or vice versa, then since LAVA saves ice´s parameters and ICE saves LAVA's, you can make LAVA that freezes into ICE that melts into LAVA that...you know what i mean.
+
* Ctype: This sets the temporary state of an element. This has many uses, making lava that freezes into NEUT for example. To do this, draw on some lava then go to console and type "!set ctype lava neut" (without the quotes) and then hit enter. Then draw something at room temp below it, and unpause it. When the lava hits the cooler object it will freeze into neut. Ctype is also used to choose what element CLNE and its variants will create.
  
 
* Life: This sets a particle's life expectancy. This variable however is used for many varied things, like the timing of spark and the colors of fire.
 
* Life: This sets a particle's life expectancy. This variable however is used for many varied things, like the timing of spark and the colors of fire.
 
* X, Y, VX, VY: These set the X and Y positions of particles in the field. VX and VY respectively set their velocities.
 
* X, Y, VX, VY: These set the X and Y positions of particles in the field. VX and VY respectively set their velocities.
 
* Tmp: This is used for varying things, like the colors of Quartz.
 
* Tmp: This is used for varying things, like the colors of Quartz.
+
* Tmp2: Like a second Tmp, used for less things.
 
+
* tmp3, tmp4, and flags are rarely used.
 
The !Quit command is a straight forward one; it closes the powder toy straight away.
 
The !Quit command is a straight forward one; it closes the powder toy straight away.
  
 
+
'''!Quit'''
  
 
The Create command is also pretty straight-forward. By typing the elements name and the coordinates you want it at, you can create a particle of any element. For example:
 
The Create command is also pretty straight-forward. By typing the elements name and the coordinates you want it at, you can create a particle of any element. For example:
  
'''!Create METL 200,100'''
+
'''!create METL 200,100'''
  
 
This will create a pixel of METL (metal) at point (200,100) on TPT's grid.
 
This will create a pixel of METL (metal) at point (200,100) on TPT's grid.
Line 62: Line 60:
 
This deletes the particle you just created.
 
This deletes the particle you just created.
  
The !Load command loads a specific save number. This loads save number 500000:
+
The !load command loads a specific save number. This loads save number 500000:
  
'''!Load 500000'''
+
'''!load 500000'''
  
 
The !bubble command creates a bubble of soap at a specific point. It is hard to create them without this.
 
The !bubble command creates a bubble of soap at a specific point. It is hard to create them without this.
  
 
'''!bubble 100,100'''
 
'''!bubble 100,100'''
 +
 +
The !reset command can do a lot of things. !reset velocity sets the velocity of all particles to 0. !reset pressure resets the pressure map, like pressing the = key. !reset sparks gets rid of all sparks on the screen and sets their type to their ctype. !reset temp sets all particles back to their default temperature they have when you draw them.
  
 
This wiki page does not cover the other commands yet. The page of the console essentially describes how to use it, and with these examples, take and figure it out.
 
This wiki page does not cover the other commands yet. The page of the console essentially describes how to use it, and with these examples, take and figure it out.
  
The !reset command can do a lot of things. !reset velocity sets the velocity of all particles to 0. !reset pressure resets the pressure map, like pressing the = key. !reset sparks gets rid of all sparks on the screen and sets their type to their ctype. !reset temp sets all particles back to their default temperature they have when you draw them.
+
Some other commands:
 +
 
 +
'''!reset'''
  
 
The if command can only be used in scripts. It checks if a particle at index i is the type j
 
The if command can only be used in scripts. It checks if a particle at index i is the type j
Line 85: Line 87:
 
When you have done that, open the console in the Powder Toy and type in
 
When you have done that, open the console in the Powder Toy and type in
  
file "filename" you might need or not need the quotes, i'm not sure. It also might say scripts are not enabled.
+
'dofile("''your filename here''")'. It might say scripts are not enabled.
  
the script will be done once, and you can use any normal commands, if, else, endif, and end. Running scripts with Lua gives you a lot more options for what to do, and lets you run it every frame
+
The script will be done once, and you can use any normal commands, if, else, endif, and end. Running scripts with Lua gives you a lot more options for what to do, and lets you run it every frame.
  
====  Hints and tips on using tmp, life, and ctype  ====
+
===  Hints and tips on using tmp, life, tmp2, and ctype  ===
Admins/TPT-devs please fill in this section with which particle types are effected by the "tmp", "life", and "ctype" variables, and what those effects are with each particle type that uses them. Please also give some example code.
 
  
 
=====  ctype  =====
 
=====  ctype  =====
* Clone (BCLN, PCLN, CLNE): ctype is the element being generated by the clone. For example, you can make all the clne on the screen generate neutrons with the console/script command "!set ctype clne neut"
+
* Clone (BCLN, PCLN, CLNE, PBCN): ctype is the element being generated by the clone. For example, you can make all the clne on the screen generate neutrons with the console/script command "!set ctype clne neut"
 
* State changes (ICE, LAVA): ctype is the element to melt/freeze into. For example, you can make lava freeze into bomb like this "!set ctype lava bomb". That actually gets some interesting results.  
 
* State changes (ICE, LAVA): ctype is the element to melt/freeze into. For example, you can make lava freeze into bomb like this "!set ctype lava bomb". That actually gets some interesting results.  
 
* SPRK: ctype is the element covered by the spark.
 
* SPRK: ctype is the element covered by the spark.
 
* Color (PHOT, FILT, FWRK, GLOW, BRAY): ctype is used to store various bits of information about color. There is currently no simple way to change this with console.  
 
* Color (PHOT, FILT, FWRK, GLOW, BRAY): ctype is used to store various bits of information about color. There is currently no simple way to change this with console.  
 
* PIPE: Ctype distinguishes the different types of pipe (red/green/blue/unallocated). There is currently no simple way to change this with console (but experiment with setting ctype to none, dust, watr, oil, fire). For more information on pipe, see [[Using PIPE element]].
 
* PIPE: Ctype distinguishes the different types of pipe (red/green/blue/unallocated). There is currently no simple way to change this with console (but experiment with setting ctype to none, dust, watr, oil, fire). For more information on pipe, see [[Using PIPE element]].
* QRTZ: QRTZ growth uses ctype. For example, the natural way is to pour SLTW on it. The SLTW changes the ctype to DUST. "set ctype qrtz sprk" will cause rapid, unnatural growth. This can also be achieved by sparking QRTZ manually.
+
* QRTZ: QRTZ growth uses ctype. For example, the natural way is to pour SLTW on it. The SLTW changes the ctype to DUST. "!set ctype qrtz sprk" will cause rapid, unnatural growth. This used to be caused by sparking QRTZ manually.
* WIRE: The different types of WIRE(Electron head, tail, wire) are distinguished by it's ctype. Try experimenting with ctypes DUST, WATR and none.
+
* WWLD: The different types of WWLD(Electron head, tail, wire) are distinguished by its ctype. Try experimenting with ctypes DUST, WATR and none.
* Using ctype, you can make molten ice and molten diamond with this code: for molten ice, put ice then type " !set ctype ice lava " then type " !set temp ice 500 " and the ice in the world will become molten ice. Molten diamond occurs when you place lava then
+
* Life: ctype changes the type of life it is.
use " !set ctype lava dmnd ". This goes along with the above mentioned state changes.
+
* Using ctype, you can make molten ice and molten diamond with this code: for molten ice, put ice then type " !set ctype ice lava " then type " !set temp ice 500 " and the ice in the world will become molten ice. Molten diamond occurs when you place lava then use " !set ctype lava dmnd ". This goes along with the above mentioned state changes.
 +
 
 
=====  tmp  =====
 
=====  tmp  =====
Tmp is a value used for various element properties.  Only a few elements actually use it, so if you try setting it and nothing happens... Then that's exactly right, only specific elements use it.  If you don't know how it is used for an element, you're better off not messing with it.  '''NOTE: this is NOT temperature (which is called 'temp')'''.
+
Tmp is a value used for various element properties.  Only a few elements use it. '''NOTE: this is NOT temperature (which is called 'temp')'''.
 +
Tmp can also change the channels of WIFI (but the "temp" or temperature value control the tmp value and it has no sense to change the tmp from the console).
 
* PIPE: the type of the element currently contained in the pipe. Use '!set tmp pipe 0' to remove all particles from all pipes.
 
* PIPE: the type of the element currently contained in the pipe. Use '!set tmp pipe 0' to remove all particles from all pipes.
 +
* CRAY: the length of the beam. Use !set tmp cray 0 to set it to default.
 +
* DRAY: how many particles to copy (default is 0, or until blank space). Use !set tmp dray 0 to set it to default.
 +
* FILT: tmp changes the operator on FILT:
 +
0: "set" mode (default): FILT's spectrum is copied into PHOT particles that pass through it
 +
 +
1: "and" mode: A bitwise and is performed on PHOT's and FILT's spectrums and the result is stored in the PHOT particle, any wavelengths not present in FILT will be removed from PHOT.
 +
 +
2: "or" mode: Performs a bitwise or: all wavelengths present in FILT are "enabled" in PHOT, if not already.
 +
 +
3: "sub" mode: Performs a bitwise and-not: all wavelengths present in FILT are subtracted from PHOT.
 +
 +
4: "red shift" mode: The wavelengths of a photon are red-shifted. The distance of the shift is calculated from the temperature in a way similar to its non-ctype mode of operation. Tmp value is ignored.
 +
 +
5: "blue shift" mode: Like "red shift", but the shifting direction is opposite, wavelengths are moved towards the blue end.
 +
 +
6: "nop" mode: No spectrum changes are performed. Useful if you want to cross beams of PHOT and ARAY without mangling the spectrum.
 +
 +
7: "xor" mode: Performs a bitwise xor: all wavelengths present in FILT are "flipped" in PHOT's spectrum, that is, if some color was on, it turns off, and vice versa.
 +
 +
8: "not" mode: Performs a bitwise not: all wavelengths of PHOT are flipped. Note that FILT's spectrum is ignored.
 +
 +
9: "QRTZ scattering" mode: Randomizes photons' velocity and randomly changes their color, just like QRTZ.
 +
 +
Changing the tmp value of SING can allow the manual change of the amount of matter it has consumed, useful for making bombs.
 +
 +
Anything else is the same as nop mode, but it is recommended to use 6 for nop in case new modes are added.
 +
Use !set tmp filt <operator number>.
  
 
=====  life  =====
 
=====  life  =====
Line 111: Line 141:
  
 
E.G.:
 
E.G.:
* DEUT has a property that says it can multiply itself based on its temperature. You may use life to make it obey this property but at the same time make it use it vastly more. As in, 99999 life deut makes it expand across the whole screen provided lag doesn't get to it first!
+
* DEUT has a property that says it can multiply itself based on its temperature. It is possible to use life to make it obey this property but at the same time make it use it vastly more. As in, 99999 life DEUT (which cannot actually save, maximum save-able life of DEUT is 65535) makes it expand across the whole screen.
* Another closely studied use of the life variable is what it does to ACID. Acid is corosive, no? It has a set life value of 75 that cannot be raised without editing the game engine. The more particles acid corrodes away the lesser its life value becomes. If set below fifty any particle can destroy acid. These are just a few of the countless things that can be done with my favorite, the life variable.
+
* Another closely studied use of the life variable is what it does to ACID. Acid is corrosive. It has a set life value of 75 that cannot be raised without editing the game engine. The more particles acid corrodes away the lesser its life value becomes. If set below fifty any particle can destroy acid.
 
* Switches, like SWCH, HSWC, PCLN, and PUMP, also use life to turn on and off.
 
* Switches, like SWCH, HSWC, PCLN, and PUMP, also use life to turn on and off.
 
* Portals use life to generate their effects. This is one of the only times life goes into negative naturally.
 
* Portals use life to generate their effects. This is one of the only times life goes into negative naturally.
 
* Stickman's health can be changed by editing his life.
 
* Stickman's health can be changed by editing his life.
* SPRK uses not only ctype, but life as well. SPRK on most metals has a life of 4. On INST it has a life of 1. This shows how long the spark will remain on the material. The material afterward then uses life to calculate when it can be sparked again.
+
* SPRK uses not only ctype, but life as well. SPRK on most metals has a life of 4. This shows how long the spark will remain on the material. The material afterward then uses life to calculate when it can be sparked again.
 +
* Coal uses life to slowly burn. It starts with a life of 110. Contact with fire decreases life, and when life reaches 0, it is replaced with a particle of fire,
  
==== Basic "moving solids"  ====
+
===== tmp2 =====
Many people ask for them, but no. Movable solid objects such as balls, strings, and gears will not be coming without a complete rewrite of the Powder Toy Program. So to keep the masses satisfied, here's how to make a basic moving solid ball.
+
tmp2 is similar to tmp, except it is less used due to it being a secondary property.
  
=====  Only SPNG works! =====
+
E.G:
Currently, SPNG is the best working solid for this. Others, like GOO and BCLN work to a small extent, and most elements don't work at all.
+
* QRTZ/PQRT: tmp2 changes the colour of them. Use !set tmp2 qrtz <number between 0 and 10>
 +
* VIRS/VIRG/VRSS: Used to set the element being infected. Use !set tmp2 virs <element id or name>
 +
* CRAY: Used for types of life.
 +
* DRAY: Used for spacing between original and duplicate. Use !set tmp2 dray <spacing>
 +
* PIPE/STOR: Used for types of life (but not possible to do normally)
  
===== Making it work  =====
+
===== Complex Console Commands =====
Make a large ball (or cube) of SPNG in the rough middle of the screen. This will be the solid that will move. Go into console. Write the following:
 
  
''!set vx spng -1'' to make it go left
+
There are many console commands that can be used to manipulate things such as gravity for elements. Here are some examples.
 +
tpt.el.metl.gravity=5 changes all METL particles in the save to have a gravity of five and therefore travel downward.
 +
tpt.el.gas.diffusion=10 changes the diffusion (or how far the particles spread apart) to a higher level.
 +
These are just a few examples of the hundreds of the complex commands unknown to many TPT users.
  
or
 
  
''!set vy spng -1'' to make it go up
+
[https://web.archive.org/web/20201023090302/https://www.boxmein.net/tpt/tptelements/reference/lua-reference.html#tree https://www.boxmein.net/tpt/tptelements/reference/lua-reference.html#tree (archived)]
  
Any other directions or speeds won't work.
+
==== Video Tutorial ====
  
A better moving solid is included in Jacob1's mod, which you can get on the forums. It is a bouncing ball that moves around and also rotates. Anythig more complicated is extremely hard to do.
+
Video tutorial for console commands on Youtube: https://youtu.be/1rVk9jzyjUI

Latest revision as of 20:39, 9 November 2024

Language: English  • Deutsch • 中文

The Powder Toy now uses the Lua console, which lets you do more than the old console. If you just want to do simple things, this console has easier and shorter commands.

Using console

As of 49.1 the commands now require a ! in front of them, and are also Lua enabled(Lua Scripts)

The console in Powder Toy is essentially a window that you can bring up that allows you to directly trigger commands coded into TPT. Because of its closeness to the code itself, you can do interesting things with it that wouldn't ordinarily be possible with just pointing and clicking, or even elaborate hacking.

Opening the console is easy. You press the ~ key (on some keyboards it's ` or ¬ or ^/° on QWERTZ-keyboards) (with or without pressing shift, it's immediately left of the 1 key, above Tab on most keyboards) and the game will pause, bringing down a black window that you can type into. You can also click the button written "C" on the right-top corner of the screen(6th top to down button), when you hover your mouse over it it will show "Show Console(~)".

Compared to most consoles, Powder Toy's is actually fairly intuitive and easy to mess with, but you'll still probably have to try a few times to memorize the order of words to type in.

The most relevant, or at least the most immediately cool and useful command that most people will want to know is the Set command. The syntax goes like this:

!set [What variable to set] [the identity of the particle/s to be set] [the value it changes to]

In other words, say I want to change particle #25 into metal. I would type:

!set type 25 metl

More relevantly, you can use the keyword "All" or even an element name in place of that number. So the command:

!set type all metl

Would turn every particle in the save to metal.

!set type metl watr

...Would turn every particle of metal in the save to water. And so on.

!set type metl 0

Would remove all metal particles from the save.

The word "Type" is also interchangeable. The following keywords can be used as well:

  • Type: This sets a particle's identity. You can use this to change what an element is.
  • Temp: This sets a particle's temperature. You can use it to melt a whole save all at once. (please note: the temp is read as Kelvin which you get by adding 273.15 to Celsius)
  • Ctype: This sets the temporary state of an element. This has many uses, making lava that freezes into NEUT for example. To do this, draw on some lava then go to console and type "!set ctype lava neut" (without the quotes) and then hit enter. Then draw something at room temp below it, and unpause it. When the lava hits the cooler object it will freeze into neut. Ctype is also used to choose what element CLNE and its variants will create.
  • Life: This sets a particle's life expectancy. This variable however is used for many varied things, like the timing of spark and the colors of fire.
  • X, Y, VX, VY: These set the X and Y positions of particles in the field. VX and VY respectively set their velocities.
  • Tmp: This is used for varying things, like the colors of Quartz.
  • Tmp2: Like a second Tmp, used for less things.
  • tmp3, tmp4, and flags are rarely used.

The !Quit command is a straight forward one; it closes the powder toy straight away.

!Quit

The Create command is also pretty straight-forward. By typing the elements name and the coordinates you want it at, you can create a particle of any element. For example:

!create METL 200,100

This will create a pixel of METL (metal) at point (200,100) on TPT's grid.

The !delete/!kill commands are also similar, they delete a particle at a point:

!delete 200,100

This deletes the particle you just created.

The !load command loads a specific save number. This loads save number 500000:

!load 500000

The !bubble command creates a bubble of soap at a specific point. It is hard to create them without this.

!bubble 100,100

The !reset command can do a lot of things. !reset velocity sets the velocity of all particles to 0. !reset pressure resets the pressure map, like pressing the = key. !reset sparks gets rid of all sparks on the screen and sets their type to their ctype. !reset temp sets all particles back to their default temperature they have when you draw them.

This wiki page does not cover the other commands yet. The page of the console essentially describes how to use it, and with these examples, take and figure it out.

Some other commands:

!reset

The if command can only be used in scripts. It checks if a particle at index i is the type j

!if type 1,dmnd

This would check if parts[1].type is diamond and return 1 if true, 0 if not.

Running scripts

You can run console commands stored in a file by creating a text document and writing a script.

When you have done that, open the console in the Powder Toy and type in

'dofile("your filename here")'. It might say scripts are not enabled.

The script will be done once, and you can use any normal commands, if, else, endif, and end. Running scripts with Lua gives you a lot more options for what to do, and lets you run it every frame.

Hints and tips on using tmp, life, tmp2, and ctype

ctype
  • Clone (BCLN, PCLN, CLNE, PBCN): ctype is the element being generated by the clone. For example, you can make all the clne on the screen generate neutrons with the console/script command "!set ctype clne neut"
  • State changes (ICE, LAVA): ctype is the element to melt/freeze into. For example, you can make lava freeze into bomb like this "!set ctype lava bomb". That actually gets some interesting results.
  • SPRK: ctype is the element covered by the spark.
  • Color (PHOT, FILT, FWRK, GLOW, BRAY): ctype is used to store various bits of information about color. There is currently no simple way to change this with console.
  • PIPE: Ctype distinguishes the different types of pipe (red/green/blue/unallocated). There is currently no simple way to change this with console (but experiment with setting ctype to none, dust, watr, oil, fire). For more information on pipe, see Using PIPE element.
  • QRTZ: QRTZ growth uses ctype. For example, the natural way is to pour SLTW on it. The SLTW changes the ctype to DUST. "!set ctype qrtz sprk" will cause rapid, unnatural growth. This used to be caused by sparking QRTZ manually.
  • WWLD: The different types of WWLD(Electron head, tail, wire) are distinguished by its ctype. Try experimenting with ctypes DUST, WATR and none.
  • Life: ctype changes the type of life it is.
  • Using ctype, you can make molten ice and molten diamond with this code: for molten ice, put ice then type " !set ctype ice lava " then type " !set temp ice 500 " and the ice in the world will become molten ice. Molten diamond occurs when you place lava then use " !set ctype lava dmnd ". This goes along with the above mentioned state changes.
tmp

Tmp is a value used for various element properties. Only a few elements use it. NOTE: this is NOT temperature (which is called 'temp'). Tmp can also change the channels of WIFI (but the "temp" or temperature value control the tmp value and it has no sense to change the tmp from the console).

  • PIPE: the type of the element currently contained in the pipe. Use '!set tmp pipe 0' to remove all particles from all pipes.
  • CRAY: the length of the beam. Use !set tmp cray 0 to set it to default.
  • DRAY: how many particles to copy (default is 0, or until blank space). Use !set tmp dray 0 to set it to default.
  • FILT: tmp changes the operator on FILT:

0: "set" mode (default): FILT's spectrum is copied into PHOT particles that pass through it

1: "and" mode: A bitwise and is performed on PHOT's and FILT's spectrums and the result is stored in the PHOT particle, any wavelengths not present in FILT will be removed from PHOT.

2: "or" mode: Performs a bitwise or: all wavelengths present in FILT are "enabled" in PHOT, if not already.

3: "sub" mode: Performs a bitwise and-not: all wavelengths present in FILT are subtracted from PHOT.

4: "red shift" mode: The wavelengths of a photon are red-shifted. The distance of the shift is calculated from the temperature in a way similar to its non-ctype mode of operation. Tmp value is ignored.

5: "blue shift" mode: Like "red shift", but the shifting direction is opposite, wavelengths are moved towards the blue end.

6: "nop" mode: No spectrum changes are performed. Useful if you want to cross beams of PHOT and ARAY without mangling the spectrum.

7: "xor" mode: Performs a bitwise xor: all wavelengths present in FILT are "flipped" in PHOT's spectrum, that is, if some color was on, it turns off, and vice versa.

8: "not" mode: Performs a bitwise not: all wavelengths of PHOT are flipped. Note that FILT's spectrum is ignored.

9: "QRTZ scattering" mode: Randomizes photons' velocity and randomly changes their color, just like QRTZ.

Changing the tmp value of SING can allow the manual change of the amount of matter it has consumed, useful for making bombs.

Anything else is the same as nop mode, but it is recommended to use 6 for nop in case new modes are added. Use !set tmp filt <operator number>.

life

Use this with with fire or plasma to make it have more or less time until it burns out. For example, "!set life fire 1000" to make it last for a VERY long time (even to the point it is unrealistically still glowing even after its temperature has cooled to room temperature, same with plasma). Use with fuse to make it be in the already burning state by reducing this number to something really low like 1 (command for that is "!set life fuse 1"). You can use it to basically put any element into a state that uses the same special property but use it either much more, better, longer, shorter, worse, or less.

E.G.:

  • DEUT has a property that says it can multiply itself based on its temperature. It is possible to use life to make it obey this property but at the same time make it use it vastly more. As in, 99999 life DEUT (which cannot actually save, maximum save-able life of DEUT is 65535) makes it expand across the whole screen.
  • Another closely studied use of the life variable is what it does to ACID. Acid is corrosive. It has a set life value of 75 that cannot be raised without editing the game engine. The more particles acid corrodes away the lesser its life value becomes. If set below fifty any particle can destroy acid.
  • Switches, like SWCH, HSWC, PCLN, and PUMP, also use life to turn on and off.
  • Portals use life to generate their effects. This is one of the only times life goes into negative naturally.
  • Stickman's health can be changed by editing his life.
  • SPRK uses not only ctype, but life as well. SPRK on most metals has a life of 4. This shows how long the spark will remain on the material. The material afterward then uses life to calculate when it can be sparked again.
  • Coal uses life to slowly burn. It starts with a life of 110. Contact with fire decreases life, and when life reaches 0, it is replaced with a particle of fire,
tmp2

tmp2 is similar to tmp, except it is less used due to it being a secondary property.

E.G:

  • QRTZ/PQRT: tmp2 changes the colour of them. Use !set tmp2 qrtz <number between 0 and 10>
  • VIRS/VIRG/VRSS: Used to set the element being infected. Use !set tmp2 virs <element id or name>
  • CRAY: Used for types of life.
  • DRAY: Used for spacing between original and duplicate. Use !set tmp2 dray <spacing>
  • PIPE/STOR: Used for types of life (but not possible to do normally)
Complex Console Commands

There are many console commands that can be used to manipulate things such as gravity for elements. Here are some examples. tpt.el.metl.gravity=5 changes all METL particles in the save to have a gravity of five and therefore travel downward. tpt.el.gas.diffusion=10 changes the diffusion (or how far the particles spread apart) to a higher level. These are just a few examples of the hundreds of the complex commands unknown to many TPT users.


https://www.boxmein.net/tpt/tptelements/reference/lua-reference.html#tree (archived)

Video Tutorial

Video tutorial for console commands on Youtube: https://youtu.be/1rVk9jzyjUI