Standalone [1.3] tModLoader - A Modding API

Thanks for the quick response!
I wasn't meaning in terms of npcs and quests (sorry should have been more specific) but that it had a very interesting leveling and skill system that I liked, but was completely unbalanced and unfinished. I want to take that and possibly make a more balanced and finished version.

Unfortunately I cannot download terramod currently, so I am going to have to try to make it from scratch.
 
Hey man!
Do you plan on committing your .csproj and .sln project files to github? Would make it easier for people build your code:)
I don't plan on that, but someone made a program for me that can patch the decompiled vanilla code into the tModLoader code, so I'll be comitting that once I'm done with the next update.
 
Looks really cool. If tAPI is truly discontinued then it looks like this will take it's place. Now all we need is an update to GameLauncher and I can get back to playing like I normally do -_-
 
Looks really cool. If tAPI is truly discontinued then it looks like this will take it's place. Now all we need is an update to GameLauncher and I can get back to playing like I normally do -_-
Or you can just create a terrariaBackup shortcut and use it whenever you want to play only vanilla Terraria :D
 
So now I'm getting this (The frames are moving):

gfxgZ4h.png


Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace Tremor.Tiles {
public class BlastFurnace : ModTile
{
    public override void SetDefaults()
    {
        Main.tileSolidTop[Type] = true;
        Main.tileFrameImportant[Type] = true;
        Main.tileNoAttach[Type] = true;
        Main.tileTable[Type] = true;
        Main.tileLavaDeath[Type] = true;
        //TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
        TileObjectData.newTile.CoordinateHeights = new int[]{16};
        //TileObjectData.addTile(Type);
        animationFrameHeight = 52;
        AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable);
        mapColor = new Color(117, 117, 117);
        mapName = "Blast Furnace";
        adjTiles = new int[]{TileID.WorkBenches};
    }

public override void AnimateTile(ref int frame, ref int frameCounter)
{
    frameCounter++;
    if(frameCounter > 8)
    {
        frameCounter = 0;
        frame++;
        frame %= 8;
    }
}

    public override void KillMultiTile(int i, int j, int frameX, int frameY)
    {
        Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("BlastFurnace"));
    }
@bluemagic123 need help.
Also how to make a weapon use mana?

Edit: Got it with mana: it's "item.mana = *number*". But still getting this problem with tiles.
 
Last edited:
You type
Code:
Main.rand.Next(2)
(for example). 2 means 1:2 chance (50%). For example if you need 4% you set it to 25. Got it?
This, but to be more specific. Insert this to your GlobalNPC script.

Code:
public override void NPCLoot(NPC npc)
{
    if (Main.rand.Next(2) == 0) {
        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExampleItem"));
    }
}

This will make it so all NPC's in the game will drop an item 50% of the time. You can also perform an if check on the NPC type if you want to get more specific, all NPC's on the Gamepedia page have their type ID's listed.
 
Last edited:
@bluemagic123 is there a way to make it so if you would get more damage when you kill an enemy? Or maybe if you kill a boss it would do the same? If not is there be a way when you collect a certain item it will increase the damage and show it like it's ammo but really it's bonus damage? Or maybe a way to make it craft it so it has more damage without actually creating another sword? If you could help me on this I'd be really glad and able to create a sword that gets stronger the farther you get in the game and if not then I'd be fine with that too.
 
@bluemagic123 need help.
Also how to make a weapon use mana?

Edit: Got it with mana: it's "item.mana = *number*". But still getting this problem with tiles.
Looking back at your code, it looks like the problem is with these three lines:
Code:
        //TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
        TileObjectData.newTile.CoordinateHeights = new int[]{16};
        //TileObjectData.addTile(Type);
You need to uncomment the commented lines, and comment the uncommented lines.

@bluemagic123 is there a way to make it so if you would get more damage when you kill an enemy? Or maybe if you kill a boss it would do the same? If not is there be a way when you collect a certain item it will increase the damage and show it like it's ammo but really it's bonus damage? Or maybe a way to make it craft it so it has more damage without actually creating another sword? If you could help me on this I'd be really glad and able to create a sword that gets stronger the farther you get in the game and if not then I'd be fine with that too.
If you mean the player gets stronger, that isn't possible yet. If you mean the weapon gets stronger, that is possible (in fact I think someone's already done that).
 
Looking back at your code, it looks like the problem is with these three lines:
Code:
        //TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
        TileObjectData.newTile.CoordinateHeights = new int[]{16};
        //TileObjectData.addTile(Type);
You need to uncomment the commented lines, and comment the uncommented lines.


If you mean the player gets stronger, that isn't possible yet. If you mean the weapon gets stronger, that is possible (in fact I think someone's already done that).
Yeah I mean if the weapon gets stronger.
 
Looking back at your code, it looks like the problem is with these three lines:
Code:
        //TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
        TileObjectData.newTile.CoordinateHeights = new int[]{16};
        //TileObjectData.addTile(Type);
You need to uncomment the commented lines, and comment the uncommented lines.
Now it looks like this (Way better than previous):
FMUEUTF.png
 
16 without means that it's good that we've commented out the coordinate heights.

18 with means that we need to change the animationFrameHeight to include the purple lines. So it looks like there are 3 tiles, so animationFrameHeight should be 54.
 
16 without means that it's good that we've commented out the coordinate heights.

18 with means that we need to change the animationFrameHeight to include the purple lines. So it looks like there are 3 tiles, so animationFrameHeight should be 54.
Yay! It works! Thank you SO much for helping with this! :happy:
 
Back
Top Bottom