Standalone [1.3] tModLoader - A Modding API

well ima keep v0.4 until all my mods update to v0.5
 
Is Player.Bottom.X relative to the on screen position because my code doesn't seem to be working.
It outputs Hi!, but it doesn't destroy the tiles(anywhere I could see).
Code:
//Chat input void
        if (command == "elevator")
        {
            WorldCommand(args);
        }
//
    private void WorldCommand(string[] args)
    {
        Player player = Main.player[Main.myPlayer];
        for (int i = 0; i < 500; i++)
        {
            for (int j = 0; j < 5; j++)
            {
                WorldGen.KillTile((int)player.position.X + j - 1, (int)player.position.Y + i);//Doesn't work
                WorldGen.KillWall((int)player.position.X + j - 1, (int)player.position.Y + i);//Doesn't work
                Main.NewText("Hi!");//Is outputted when I use the command
            }
        }
    }
Edit: It doesn't work when I use player.Bottom.X/Y either
 
Its not working
ITS NOT WORKING
OHGODITSNOTWORKING
IHAVEDIED
 
Launch it again, and then rebuild your mods.
 
it wont even install is the problem, When i try to install it, it takes the terraria.exe, makes it so it cant load and spams crash logs.
 
Do you mean patch.bat won't work? Are you using a mac?
 
No, windows 10.
 
Do you mean patch.bat won't work or you're not using a mac?
 
It just wont work, and I'm not on a mac.
 
I would try a fresh copy of terraria and of tmodloader.
 
I tried, still broken.
 
Hey @bluemagic123 whenever I build the dependent mod I always get this.

Could not load file or assembly 'BadUtils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at DependentMod.Items.DependentModItem.SetDefaults(Item item)
at Terraria.ModLoader.ItemLoader.SetupItem(Item item)
at Terraria.Item.SetDefaults(Int32 Type, Boolean noMatCheck)
at Terraria.Recipe.SetupRecipes()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

I know it doesn't do much but I would like to try it out.
 
Is Player.Bottom.X relative to the on screen position because my code doesn't seem to be working.
It outputs Hi!, but it doesn't destroy the tiles(anywhere I could see).
Code:
//Chat input void
        if (command == "elevator")
        {
            WorldCommand(args);
        }
//
    private void WorldCommand(string[] args)
    {
        Player player = Main.player[Main.myPlayer];
        for (int i = 0; i < 500; i++)
        {
            for (int j = 0; j < 5; j++)
            {
                WorldGen.KillTile((int)player.position.X + j - 1, (int)player.position.Y + i);//Doesn't work
                WorldGen.KillWall((int)player.position.X + j - 1, (int)player.position.Y + i);//Doesn't work
                Main.NewText("Hi!");//Is outputted when I use the command
            }
        }
    }
Edit: It doesn't work when I use player.Bottom.X/Y either
The problem is that you're using an entity position for tile coordinates. You need to divide the coordinates by 16 to work with tiles.

it wont even install is the problem, When i try to install it, it takes the terraria.exe, makes it so it cant load and spams crash logs.
It might help if you post those crash logs :P

Hey @bluemagic123 whenever I build the dependent mod I always get this.

Could not load file or assembly 'BadUtils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at DependentMod.Items.DependentModItem.SetDefaults(Item item)
at Terraria.ModLoader.ItemLoader.SetupItem(Item item)
at Terraria.Item.SetDefaults(Int32 Type, Boolean noMatCheck)
at Terraria.Recipe.SetupRecipes()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

I know it doesn't do much but I would like to try it out.
Just to make sure, the BadUtils.dll is in the dllReferences folder in the ModLoader folder, right?
 
The problem is that you're using an entity position for tile coordinates. You need to divide the coordinates by 16 to work with tiles.


It might help if you post those crash logs :p


Just to make sure, the BadUtils.dll is in the dllReferences folder in the ModLoader folder, right?
Yup.
 
Hm. Given that it says it can't find the file itself, it isn't a problem with actually loading it. I'm not really sure what else the problem might be.
 
Hm. Given that it says it can't find the file itself, it isn't a problem with actually loading it. I'm not really sure what else the problem might be.
Ok that's weird... thanks anyway.
 
I get that while playing with mods that use the dllReferences folder, and have found that if you put the dll file into the terraria folder it solves it.(hope this helps identify the problem)
 
I get that while playing with mods that use the dllReferences folder, and have found that if you put the dll file into the terraria folder it solves it.(hope this helps identify the problem)
TY it fixed it and I hope it does help solve that problem.
 
I've noticed a potential bug/problem.
If you don't put an argument after a command, and a command requires an argument, it can crash the game
Fix:
Code:
if (args.Length != 0) {/* your code*/}//set args.Lenght equal to the amount of arguments you want
 
Back
Top Bottom