Standalone [1.3] tModLoader - A Modding API

Is there a way to control the intensity of the light produced with the tile method public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)?
 
How can we make an OnHit area of effect around the player, something like the inferno potion in the vanilla game?
Oh, and can we access the vanilla items codes?
And how can we create more damage types(like melee, ranged) for e.g. a new "heal" that would heal based on accessories that gives you bonus to your "heal"(like bonus melee or ranged dmg in the vanilla)?
 
Last edited:
Ah ok, that's a good suggestion. I did try checking the owner of a tombstone, when my character died the owner of the projectile was id 0, which I assumed is me, the player. But when I had a friend join quickly to try it out, his owner id was 255 which kind of raised some flags. I'm guessing id 255 is nobody? Is there any reason a tombstone would be id 255 for a network player, and 0 for me?

If I can figure this out the only other thing I need to figure out is how to get the player id when that player right clicks on the tombstone. The right click global function doesn't look like it takes that in as an argument though :/
Yes, the final index (255) of the player array is some kind of fail-safe that I don't fully understand, while 0 is the index of the first player to join a server.

Hm, my guess is that because the tombstone isn't a harmful projectile, the game doesn't bother to sync the owner ID between clients, so the .owner is correct only on the client of the player who died, and 255 for everyone else. I wonder what the .owner of a tombstone is on the client? You can use Console.WriteLine(); to output a value stored on the server in the server's console window.

As for your other problem, the only solution that I can think of would be to somehow store the tile coordinates of your last tombstone in your ModPlayer class, then, whenever a tombstone is right-clicked, use public virtual void RightClick(int i, int j, int type) to compare your 'last death' coordinates to the tombstone's coordinates. The tricky part is working out what the 'last death' coordinates should be...'o_O
 
Yes, the final index (255) of the player array is some kind of fail-safe that I don't fully understand, while 0 is the index of the first player to join a server.

Hm, my guess is that because the tombstone isn't a harmful projectile, the game doesn't bother to sync the owner ID between clients, so the .owner is correct only on the client of the player who died, and 255 for everyone else. I wonder what the .owner of a tombstone is on the client? You can use Console.WriteLine(); to output a value stored on the server in the server's console window.

As for your other problem, the only solution that I can think of would be to somehow store the tile coordinates of your last tombstone in your ModPlayer class, then, whenever a tombstone is right-clicked, use public virtual void RightClick(int i, int j, int type) to compare your 'last death' coordinates to the tombstone's coordinates. The tricky part is working out what the 'last death' coordinates should be...'o_O

Ah ok I thought so. The issue here is trying to figure out which player clicked on the tombstone (Either to apply the affect to that player, or at least verify that it is the right player)

RightClick(...) doesn't take in the player as an argument, but there must be some way to do it, some tiles provide buffs to the player that clicked it right? So this has to be possible
 
Last edited:
it is saying that my steam works.nativemethods.steamapi_restartappifnecessary,
terraria.social.steam.coresocialmodule.initialize(),
terraria.social.socialapi.initialize,
terraria.program.launchgame
[doublepost=1463857161,1463856758][/doublepost]hope you have a answer :brain:

p.s brain of cuthulu is my favorite boss if you cant tell:brain::brain::brain::brain::brain::brain:
 
is there a tool that i can use to make separate terraria versions? im playing the latest tmodloader and i see the new update is coming today/tomorrow is there a way to get 2 separate versions so i can keep playing 1.3.0.8
 
It says then put all of your .cs files and .png files in that folder. So... what files are we talking about, game files? some files that i don't know? Help would be appreciated.
 
Help, I am having an issue.
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace SpiritMod.Items.Spirit.Tiles
{
    public class SpiritTable : 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.Style1x2);
            TileObjectData.newTile.CoordinateHeights = new int[]{ 18 };
            TileObjectData.addTile(Type);
            AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable);
            AddMapEntry(new Color(30, 144, 255), "Spirit Table");
            disableSmartCursor = true;
        }

        public override void NumDust(int i, int j, bool fail, ref int num)
        {
            num = fail ? 1 : 3;
        }
        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("SpiritTable"));
        }
    }
}
SpiritTable.png

I am using this sprite with this code and all sorts of crap is happening. Whenever is use the "placement preview" feature all solid blocks disappear. Also, the table doesnt show up right. This is a major issue and I need help as soon as I can
 
I need some major help. Here is my code and here is my tile:
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace SpiritMod.Items.Spirit.Tiles
{
    public class SpiritTable : 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[]{ 18 };
            TileObjectData.addTile(Type);
            AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable);
            AddMapEntry(new Color(30, 144, 255), "Spirit Table");
            disableSmartCursor = true;
        }

        public override void NumDust(int i, int j, bool fail, ref int num)
        {
            num = fail ? 1 : 3;
        }
        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("SpiritTable"));
        }
    }
}
SpiritTable.png

(notice the little bits coming off the bottom)
Capture 2016-05-21 22_37_49.png
 
I need some major help. Here is my code and here is my tile:
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace SpiritMod.Items.Spirit.Tiles
{
    public class SpiritTable : 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[]{ 18 };
            TileObjectData.addTile(Type);
            AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable);
            AddMapEntry(new Color(30, 144, 255), "Spirit Table");
            disableSmartCursor = true;
        }

        public override void NumDust(int i, int j, bool fail, ref int num)
        {
            num = fail ? 1 : 3;
        }
        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("SpiritTable"));
        }
    }
}
View attachment 112014
(notice the little bits coming off the bottom)
View attachment 112015
I can't really see what's going on, but you should fix the coordinate heights and read the guide in my signature
[doublepost=1463893134,1463893072][/doublepost]
is there a tool that i can use to make separate terraria versions? im playing the latest tmodloader and i see the new update is coming today/tomorrow is there a way to get 2 separate versions so i can keep playing 1.3.0.8
You can just copy the Terraria folder in the steam folder. No one knows how many files have changed, so a full copy might be useful.
 
Back
Top Bottom