Please help. I'm new to modding for TPT

  • ahahooty6769
    15th September Member 0 Permalink

    I have no idea what to do to create a mod, nor how the actual engine works or programming language. But I have a really important mod idea that I need to make for a project I'm working on and I'd like some technical assistance, pointers, and recommendations.


    The mod will add 4 new elements and change the way spark and some electronics work.

     

    1. Spark will now have a voltage, which will slowly run out over time, the voltage runs out at 10% of the normal rate when travelling through (into) water. When the voltage reaches zero it disappears. When spark splits into multiple paths, the voltage is unaffected. Most sources of electricity produce spark with a voltage of (idk maybe 100) so it can last for a few seconds. Colliding sparks still cancel eachother out like the default game.

    2. Batteries will now only last for a certain period of time (pretty decent but not infinite) before becoming BRMT. This will be tracked by voltage on the battery. When a battery dies, it has a chance to "borrow" some voltage from batteries around it so it doesn't immediately die. (you can make large batteries to store more energy)

     

    Now for the new additions!

     

    1. Energy particle.

    A liquid which has a life value of 2 on creation. When the energy particle is in contact with PSCN it sparks  the PSCN (100 volts for example) and the life goes down by 1. When the life reaches 0 it reverts to regular old distilled water.

     

    2. Producer

    A solider, like Powered Breakable Clone, (powered by PSCN) except it has a life, which has a max of 5 (example) and is increased by 5 when it is powered, when the life reaches 0 it automatically depowers (life counts down until zero) (stops producing the CTYPE element) (NSCN can instantly set the life to 0)

     

    3. Pressure Vessel

    Like PPIP, destructible and created the same way etc. But, similar to the one above, it automatically depowers after a certain amount of time (NSCN can instantly depower)

     

    4. Membrane

    Oxygen and Distilled water enter it when adjacent if it does not already store one. Once both are inside, they are deleted and an energy particle is produced adjacent to the membrane.

     

    5. Turbine (optional, not important for update). Creates power when there is a particle moving through it above a certain speed.

     

    Also please do not refer me to other mods, I just need to know how to start making this exact one. Thank you.

    Edited 2 times by ahahooty6769. Last: 15th September
  • jacob1
    15th September Developer 0 Permalink
    Moved to feedback, since mod announcements aren't allowed but this is actually just a suggestion post.
  • KyleTheCreator
    15th September Member 0 Permalink

    @jacob1 (View Post)

     Fair enough since the guy doesnt even know how to mod even though the post is a mod he needs to make

  • ALumpOfPowderToy
    14th October Member 0 Permalink

    @ahahooty6769 (View Post)

     A bit of a necro, but this post hasn't been answered yet. For modding, you'll probably want to use the Lua API. 

     

    1. Spark will now have a voltage, which will slowly run out over time, the voltage runs out at 10% of the normal rate when travelling through (into) water. When the voltage reaches zero it disappears. When spark splits into multiple paths, the voltage is unaffected. Most sources of electricity produce spark with a voltage of (idk maybe 100) so it can last for a few seconds. Colliding sparks still cancel eachother out like the default game.

     


    AFAIK, the Lua API doesn't give you empirical control over native elements, so you'll have to make your own custom version of spark and battery. I'd reccomend using LIFE for the SPRK type (1 = head (can spread to nearby conductors, turns into tail in one frame), 0 = tail (cannot spread, turns into conductor in one frame)), CTYPE to store the conductor, and TMP to store the voltage. Use TMP2 to store the amps if you're going to add that.

     

    The electronics for your custom spark also need to be modded.

     

     Batteries will now only last for a certain period of time (pretty decent but not infinite) before becoming BRMT. This will be tracked by voltage on the battery. When a battery dies, it has a chance to "borrow" some voltage from batteries around it so it doesn't immediately die. (you can make large batteries to store more energy)


    You can make your custom battery for this. TMP = battery life. Spread life to nearby neighboors each frame or when the battery is about to die. Only decrease battery life when it's sparking.

     

    The rest of the elements shouldn't be too hard. I encourage you to reply if you have any questions.