TConfig How to make a simple item and mod

Discussion in 'Released Mods' started by >:SYNTAX, Dec 15, 2012.

  1. >:SYNTAX Mouse

    this is just a tutorial going into the fine and simple stuff of how to make a Terraria mod.
    [IMG]

    start off with a folder called what ever you want your mod to be called

    [IMG]

    then create these folders in the folder you just created

    Buffs: this is for making custom buffs
    Global:this is for making custom world generators
    Gore:used for custom gore that usualy come from you custom npc
    Item: this is for making custom weapons and items we will be using this filder
    Npc: for making custom npc and enemies
    Projectile: for making custom projectiles and flying stuff
    Tile: for making new tiles and blocks
    Wall: for making new walls


    [IMG]

    now go into the Items folder you have created and make a new text document.


    [IMG]

    rename it Blade.ini, it should chainge the little picture and come up with a warning

    [IMG]

    in the new Blade.ini file type the above

    width: the width of you image in pixles
    height: the height of the image in pixles
    type: this must be set to -1 for custom items to tell the game that it is a mod
    useStyle: how you use the item http://tconfig.wikia.com/wiki/List_of_UseStyles
    useAnimation: how long the animation will last
    useTime:how long the gap between attacks is (just set the same as useAnimation)
    maxStack:how many items can it be stacked to (for weapons just set to 1)
    damage:how much damage your weapon will do
    knockBack: the knockback of the weapon
    scale: how much to scale the weapon up or down to
    useSound: the sound when attacking
    Value: how much it will sell for from platnum to copper PPGGSSCC


    Amount: how much you want to be made from the recipe
    needWater:if you need to be standing near water to craft
    Items: what you nee to make it
    Tiles: what tile you need to be standing near

    [IMG]


    copy your picture across

    [IMG]

    insert the valuse that you want into the .ini file save and then quit

    [IMG]
    go to documents, my games, terraria, modPack (if you dont have a modpack folder then make one)

    [IMG]
    copy your mod folder

    [IMG]

    paste in your ModPack folder


    [IMG]
    Run the mod pack builder that you got from tconfig (my image looks diffrent because i chainged it)
    [IMG]
    you should have the following window pop up press the number coresponding to you mod(1) and press enter


    [IMG]
    next it should look like this(as you add more to you mod it will get longer)
    now just exit it

    [IMG]
    in you mod packs folder 2 more filed will appear (you mod name).obj and
    (your mod name)instaler.exe
    when this happend just run the instaler and press enter when the black window pops up


    [IMG]
    you may get this window poping up the first time its ok just run the installer again and it wont show up again

    [IMG]
    after that start up you tconfig and launch it dont forget to enable you mod in the menu

    if you have any questions just ask


    the files of the tutorial are downloadable to if you having problems just compare it to yours

    Attached Files:

    Cricket, Minifrij, GallantJR and 4 others like this.
  2. FreyModder Giant Worm

    Nicely done tutorial :D
  3. edgarbany Bunny

    Thanks this is very helpful :)
  4. DRONEZ Snatcher

    How would you go about adding a glow effect to a weapon? Furthermore, are you able to change the color of the glow?
  5. W1K T3rr4r1a W1k1

    Simple example.
    Code:
    public void UseItemEffect(Player player, Rectangle rectangle)
    {
    Lighting.addLight((int)(rectangle.X / 16f), (int)(rectangle.Y / 16f), 0.7f, 0.2f, 0.2f);
    }
    The last 3 values (0.7f, 0.2f and 0.2f) are RGB values. Increasing them increases the light and they mix. It is coded to be a red glow (0.7f) while the other two values are in to make a lighter shade of red. You can mix them in any way you like.
    DRONEZ likes this.
  6. DRONEZ Snatcher

    Awesome! Thanks.
  7. Akahashi Green Slime

    Cool tutorial but how can i do the sprite of the weapon and what i must do to make the weapon have that sprite ?
  8. ShadowRyuu06 Green Slime

    how do you make sword keep swinging like the muramasa?
    And by the way great tutorial.
  9. Yoraiz0r The Wizard

    simple example indeed , but note that this will only apply to the top left corner of the item's collision box!
    to get the center of the collision box (and make the light more reallistic looking) you will use this instead...
    Code:
    public void UseItemEffect(Player player, Rectangle rectangle)
    {
    Lighting.addLight((int)(rectangle.X+rectangle.Width/2f)/16, (int)(rectangle.Y+rectangle.Height/2f)/16, 0.7f, 0.2f, 0.2f);
    }
    W1K likes this.
  10. Teach me how to make a custom pets ..
    :) i want to do a step by step tutorial for custom pets .. Thanx
    FreyModder likes this.
  11. W1K T3rr4r1a W1k1

    Teach me how to be a god
    :) i want to do a step by step tutorial for being a god .. Thanx

    In all seriousnes, I guess you should make tutorial about things you actually know how to do well enough, not things other people tell you how to do. But whatever. If you really want to, you can give a look at some of the custom pets examples in my modpack, some of Yorai's or I guess Obsidian's have some of them too.
    FreyModder and Yoraiz0r like this.
  12. guyguyga Slimed Zombie

    Hello. What's the Public Void for holding an item. Although I have succeeded in making the gun, I cannot make it glow while being held. Everything works except the item does not generate light unless shooting shotgun pellets. I KNOW that it is because I'm using the wrong public void (AI as of now) for it, but I cannot find the void for holding items.

    So far, my .cs file is this:
    Code:
    public void UseStyle(Player P) {
        float HalfPi = (float)(Math.PI / 2f);
        P.itemRotation -= 0.05f * P.direction;
        P.itemLocation.X -= P.direction * (P.width / 2) * (1f - (float)Math.Abs(P.itemRotation) / HalfPi);
    }
    (Holding it like a breathing rod. This changes the direction of the gun.)
     
    public void AI()
    {
    Lighting.addLight((int)(rectangle.X / 16f), (int)(rectangle.Y / 16f), 0.7f, 0.2f, 0.2f);
    }
    (Also have a terribly long shotgun pellet imitating code that makes up the rest of the .cs file)
    
  13. Paranσid [Insert Title Here]

    Not sure if I'm high or something right now, but try this:

    Code:
    public void UseStyle(Player P) {
        float HalfPi = (float)(Math.PI / 2f);
        P.itemRotation -= 0.05f * P.direction;
        P.itemLocation.X -= P.direction * (P.width / 2) * (1f - (float)Math.Abs(P.itemRotation) / HalfPi);
        Lighting.addLight((int)(P.itemLocation.X), (int)(P.itemLocation.Y), 0.7f, 0.2f, 0.2f);
    }
    
    Yeah I think I'm high.
    If it doesn't work, and no one else helps, try the tConfig thread.

    Edit; Or maybe that weed was really fucking powerful (Y'know, if the first don't work):

    Code:
    public void HoldStyle(Player P) {
        Lighting.addLight((int)(P.itemLocation.X), (int)(P.itemLocation.Y), 0.7f, 0.2f, 0.2f);
    }
    
    Double edit: I believe the latter will work.
  14. guyguyga Slimed Zombie

    It didn't work. The item doesn't show unless i shoot it. I was kind of hoping that it would be held like a flashlight(Like being held permanently as long as the slot was selected) but still shoot when i clicked the trigger. Think of it as a shooting light source. Thanks for trying, though. :)
  15. Paranσid [Insert Title Here]

    Ah, I was also trying to make the item show up when held in my project too. Problem is, holdStyle=1 is off center from the player. I'm sure you can code it to be in the correct position but I am far too lazy (and I'll probably fail). Good luck!

Share This Page