Need to know alterable properties.

  • Videogamer555
    11th Dec 2011 Member 0 Permalink
    I know that LUA now allows for altering properties of the elements themselves. Now here is a list of properties found in the Wiki as part of the modding tutorial (for VC++ programming).


    Colour: Color in hexadecimal code. Go to http://www.colorpicker.com/ to find the hexadecimal code (at the top) for your color. The hexadecimal code goes AFTER the "0x" prefix, always.


    Advec: How much the particle is accelerated by moving air.


    Airdrag: How much air the particle generates in the direction of travel.


    Airloss: How much the particle slows down moving air (although this won't have as big an effect as a wall). 1 = no effect, 0 = maximum effect.


    Loss: How much velocity the particle loses each frame. 1 = no loss, .5 = half loss.


    Collid: Velocity is multiplied by this when the particle collides with something.


    Grav: How fast the particle falls. A negative number means it floats.


    Diffus: How much the particle "wiggles" around (think GAS).


    Hotair: How much the particle increases the pressure by.


    Fal: How does the particle move? 0 = solid, 1 = powder, 2 = liquid


    Burn: Does it burn? 0 = no, higher numbers = higher "burnage".


    Exp: Does it explode? 0 = no, 1 = when touching fire, 2 = when touching fire or when pressure > 2.5


    Mel: Does it melt? 1 = yes, 0 = no.


    Hrd: How much does acid affect it? 0 = no effect, higher numbers = higher effect.


    M: Does it show up on the menu? 1 = yes, 0 = no.


    Weight: Heavier elements sink beneath lighter ones. 1 = Gas. 2 = Light, 98 = Heavy (liquids 0-49, powder 50-99). 100 = Solid. -1 is Neutrons and Photons.


    Section: The section of the menu it is in. Prefix everything with 'SC_'.


    H: What temperature does it have when created? Temperature is in Kelvin (Kelvin = degrees C + 273.15). R_TEMP+273.15f gives room temperature.


    Unfortunately MANY of these are outdated.
    Coulor is now Color
    Advec (in the tutorial) is now Advection
    H is now Heat
    Burn is now Flammable

    Can someone PLEASE make a complete list (just like in the tutorial) containing of the CURRENT names of ALL of the LUA-editable element properties? Thanks in advance.
  • MasterMind555
    11th Dec 2011 Member 0 Permalink
    @Videogamer555 (View Post)
    It's "Lua", not "LUA"
    BIG difference
  • Videogamer555
    11th Dec 2011 Member 0 Permalink
    Would you like me to repost this but making sure to next time name the thread correctly? I think that would be dumb to have to do to fix a typo.

    However if you have no answer to my question, then please don't reply. I want to hear from the people who programmed TPT or someone else who is familiar with all of the editable variables via the Lua console. If you don't know the answer to the question, then please don't reply. But whatever you do, don't make dumb replies who's ONLY PURPOSE is to be insulting.
  • jacob1
    11th Dec 2011 Developer 0 Permalink
    You can edit these, I put the names used in the comments in the source code and in the wiki in parentheses, but those aren't their real names. Their names were never changed, the wrong names were just put in those.

    name
    color (colour)
    advection (advec)
    airdrag
    airloss
    loss
    collision (collid)
    gravity (grav)
    diffusion (diffus)
    hotair
    falldown (fal)
    flammable (burn)
    explosive (exp)
    metlable (mel) (spelled wrong in source, use metlable, not meltable for now)
    hardness (hrd)
    menu (M)
    enabled (use)
    weight
    menusection (section)
    heat (h)
    hconduct (ins)
    state
    properties
    description

    I was going to update the wiki with more of these properties and what has changed, but I got an error when I hit the save button and forgot to copy what I did. I might update it again sometime soon with the correct names and update some other stuff too.
  • Videogamer555
    11th Dec 2011 Member 0 Permalink

    jacob1:

    You can edit these, I put the names used in the comments in the source code and in the wiki in parentheses, but those aren't their real names. Their names were never changed, the wrong names were just put in those.

    color (colour)
    advection (advec)
    airdrag
    airloss
    loss
    collision (collid)
    gravity
    diffusion (diffus)
    hotair
    falldown (fal)
    flammable (burn)
    explosive (exp)
    meltable (mel)
    hardness (hrd)
    enabled (m)
    weight
    menusection (section)
    heat (h)
    hconduct (ins)
    state
    properties
    description

    I was going to update the wiki with more of these properties and what has changed, but I got an error when I hit the save button and forgot to copy what I did. I might update it again sometime soon with the correct names and update some other stuff too.


    Why is there a property called "properties"? What is that for?

    How do I set the section name for "menusection"? Is it just "explosives" for the explosives menu? Please explain.
    What are the valid sections? Also How do I choose a slot on each menu (like if I wanted to place an element second-from-left item on the explosives menu)?

    Is there also an electricity conducting variable, so I could make wood conductive for example?
  • jacob1
    11th Dec 2011 Developer 0 Permalink
    @Videogamer555 (View Post)
    Properties has some special properties, like if it is conductive. These are the properties:

    TYPE_PART 0x0001 //1 Powders
    TYPE_LIQUID 0x0002 //2 Liquids
    TYPE_SOLID 0x0004 //4 Solids
    TYPE_GAS 0x0008 //8 Gasses (Includes plasma)
    TYPE_ENERGY 0x0010 //16 Energy (Thunder, Light, Neutrons etc.)
    PROP_CONDUCTS 0x0020 //32 Conducts electricity
    PROP_BLACK 0x0040 //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better)
    PROP_NEUTPENETRATE 0x0080 //128 Penetrated by neutrons
    PROP_NEUTABSORB 0x0100 //256 Absorbs neutrons, reflect is default
    PROP_NEUTPASS 0x0200 //512 Neutrons pass through, such as with glass
    PROP_DEADLY 0x0400 //1024 Is deadly for stickman
    PROP_HOT_GLOW 0x0800 //2048 Hot Metal Glow
    PROP_LIFE 0x1000 //4096 Is a GoL type
    PROP_RADIOACTIVE 0x2000 //8192 Radioactive
    PROP_LIFE_DEC 0x4000 //2^14 Life decreases by one every frame if > zero
    PROP_LIFE_KILL 0x8000 //2^15 Kill when life value is <= zero
    PROP_LIFE_KILL_DEC 0x10000 //2^16 Kill when life value is decremented to <= zero

    To make someting conductive set the properties to 0x4020 or 0x4024.
    To set menusection, use a number. Electronics is 1 and Special is 9, don't use walls, gol, or tools, they don't work. There is no way to set where an element appears in the row, it is decided by the element id's in order.
  • Videogamer555
    11th Dec 2011 Member 0 Permalink

    jacob1:

    @Videogamer555 (View Post)
    Properties has some special properties, like if it is conductive. These are the properties:

    TYPE_PART 0x0001 //1 Powders
    TYPE_LIQUID 0x0002 //2 Liquids
    TYPE_SOLID 0x0004 //4 Solids
    TYPE_GAS 0x0008 //8 Gasses (Includes plasma)
    TYPE_ENERGY 0x0010 //16 Energy (Thunder, Light, Neutrons etc.)
    PROP_CONDUCTS 0x0020 //32 Conducts electricity
    PROP_BLACK 0x0040 //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better)
    PROP_NEUTPENETRATE 0x0080 //128 Penetrated by neutrons
    PROP_NEUTABSORB 0x0100 //256 Absorbs neutrons, reflect is default
    PROP_NEUTPASS 0x0200 //512 Neutrons pass through, such as with glass
    PROP_DEADLY 0x0400 //1024 Is deadly for stickman
    PROP_HOT_GLOW 0x0800 //2048 Hot Metal Glow
    PROP_LIFE 0x1000 //4096 Is a GoL type
    PROP_RADIOACTIVE 0x2000 //8192 Radioactive
    PROP_LIFE_DEC 0x4000 //2^14 Life decreases by one every frame if > zero
    PROP_LIFE_KILL 0x8000 //2^15 Kill when life value is <= zero
    PROP_LIFE_KILL_DEC 0x10000 //2^16 Kill when life value is decremented to <= zero

    To make someting conductive set the properties to 0x4020 or 0x4024.
    To set menusection, use a number. Electronics is 1 and Special is 9, don't use walls, gol, or tools, they don't work. There is no way to set where an element appears in the row, it is decided by the element id's in order.


    It seems that they are properties with numbers. like you could combine neutronobsorb and conducts.
    This means the total properties are a bitwise "or" of all possible property states. So just SETTING something to one state, will CLEAR the other states (makng the element behave possibly in unexpected ways, such as setting METL to neutabsorb would make METL no longer conducting). Therefore to set a state I'd need to say:

    CurrentPropertiesOfElement OR NumberThatRepresentsPropertyIWantToSet.

    To clear that setting state I'd need to use:

    CurrentPropertiesOfElement AND NumberThatRepresentsAllPropertiesExceptTheOneIWantToClear.

    Unfortunately I don't know how to use Lua to read the number that represents the current "properties" state. Nor do I know how to perform bitwise operations in Lua.

    Please help.
  • jacob1
    11th Dec 2011 Developer 0 Permalink
    Here is the answer to all your questions in one post:

    @Videogamer555 (View Post)
    To combine them, just add the hex numbers together. If you wanted something to be solid and liquid, do 0x0006. If you wanted something to be deadly and have hot glow, use 0x0C00, because 8+4 = C. If you wanted something to be a solid conductive black radioactive lifedecrease, do 0x6064 to combine them.
    There is no way to read the current properties of an element, just look in the source code. Use tpt.el.xxxx.properties to set and get

    @Videogamer555 (View Post)
    You can't change the name of an element yet. You can only change the properties I already posted. tpt.el.xxxx.name = "asdf"

    @Videogamer555 (View Post)
    There is nothing at all you can do to get to the hidden cracker menus in the beta. Not even a lua command. You could try figuring out how to do it in my mod, but it's secret.

    @Videogamer555 (View Post)
    There are not bitwise commands (I think), but you could try using the existing commands like % to write functions that do the bitwise commands for you.

    Edit 8/9/12: Fixed old info
  • Videogamer555
    11th Dec 2011 Member 0 Permalink

    jacob1:


    @Videogamer555 (View Post)
    To combine them, just add the hex numbers together. If you wanted something to be solid and liquid, do 0x0006. If you wanted something to be deadly and have hot glow, use 0x0C00, because 8+4 = C. If you wanted something to be a solid conductive black radioactive lifedecrease, do 0x6064 to combine them.
    There is no way to read the current properties of an element, just look in the source code.


    If I want to edit PLUT and assign it the property I want to give it, I MAY remove other properties, if I don't ADD them to the property I want to assign before assigning it. How do automatically perform this so I can ADD or SUBTRACT a desired property without affecting the element in unexpected ways, and without having to consult the source code for every element I want to change the properties of.
  • jacob1
    11th Dec 2011 Developer 0 Permalink
    @Videogamer555 (View Post)
    There is no way, you'll have to look at the source code every time. You can probably just guess what the properties of most elements are, I think most are just their state, and the rest are obvious like hotglow or conductive with life decrease