Standalone [1.3] tModLoader - A Modding API

silent_ptr

Plantera
Is there ModWorld yet?

EDIT: When I open tModLoader 0.8.2, this happens:

Capture.PNG
 
Last edited:

Marthinus

Terrarian
I repeat once again, when I try to launch the modded terraria.exe 1.3.1 in windows 8 it show an error message "Your app can't run on your pc." ANY HELP???
 

cs89

Terrarian
I have a problem, when I would try to click on the Terraria.exe (which is in the .zip file) from TModloader 0.8.2, the Windows 10 system says that contains infected files and that Windows Defender deletes that compressed file.
I don't know, why the heck that anti-virus do it over and over again.
 

Marcin JOT.PE

Terrarian
Hey I got Some problems
20160626204416_1.jpg

How do i fix Head
Can i fix that between parts its a little space
Can someone Help with writing me so ai i wont ai like wyvern
so that what i have
Code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;


namespace MarcinMod.NPCs.Boss
{
    public class ForestDragon_Head : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "ForestDragon";
            npc.displayName = "Forest Dragon";
            npc.soundHit = 1;
            npc.soundKilled = 1;
            npc.lifeMax = 125;
            npc.damage = 20;
            npc.defense = 17;
            npc.knockBackResist = 0.5f;
            npc.width = 45; //22
            npc.height = 45; //18
            npc.boss = true;
            npc.lavaImmune = true;
            npc.noGravity = true;
            npc.noTileCollide = true;
            Main.npcFrameCount[npc.type] = 1;
            npc.value = Item.buyPrice(0, 0, 1, 45);
            npc.npcSlots = 1f;
            npc.netAlways = true;
        }

        public override bool PreAI()
        {
            if (Main.netMode != 1)
            {
                if (npc.ai[0] == 0)
                {
                    npc.realLife = npc.whoAmI;
                    int latestNPC = npc.whoAmI;

                    int WormLength = 1;
                    for (int i = 0; i < WormLength; ++i)
                    {
                        latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body"), npc.whoAmI, 0, latestNPC);
                        Main.npc[(int)latestNPC].realLife = npc.whoAmI;
                        Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
                    }
                    int WormLength2 = 1;
                    for (int i = 0; i < WormLength2; ++i)
                    {
                        latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Legs"), npc.whoAmI, 0, latestNPC);
                        Main.npc[(int)latestNPC].realLife = npc.whoAmI;
                        Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
                    }
                    int WormLength3 = 4;
                    for (int i = 0; i < WormLength3; ++i)
                    {
                        latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body"), npc.whoAmI, 0, latestNPC);
                        Main.npc[(int)latestNPC].realLife = npc.whoAmI;
                        Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
                    }
                    for (int i = 0; i < WormLength2; ++i)
                    {
                        latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Legs"), npc.whoAmI, 0, latestNPC);
                        Main.npc[(int)latestNPC].realLife = npc.whoAmI;
                        Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
                    }
                    for (int i = 0; i < WormLength; ++i)
                    {
                        latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body2"), npc.whoAmI, 0, latestNPC);
                        Main.npc[(int)latestNPC].realLife = npc.whoAmI;
                        Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
                    }
                    for (int i = 0; i < WormLength; ++i)
                    {
                        latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body3"), npc.whoAmI, 0, latestNPC);
                        Main.npc[(int)latestNPC].realLife = npc.whoAmI;
                        Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
                    }
                    latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Tail"), npc.whoAmI, 0, latestNPC);
                    Main.npc[(int)latestNPC].realLife = npc.whoAmI;
                    Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;

                    npc.ai[0] = 1;
                    npc.netUpdate = true;
                }
            }
            return false;
        }
    }
}
 
Last edited:

Ninjathis

Official Terrarian
I need help downloading the new Tmod 0.8.2.
I had the last one, .0.8.1.2, and it was working just fine. But when I try to update to the new one, my computer detects it has a virus, and it won't let me download it. And even if I bypass the firewall, then the Terraria File, that you use to actually play modded Terraria, doesn't work.

Please help?
 

Daricide

Terrarian
Is it normal that when i use the tmod version of terraria the time in game passes by about 2.5x slower than the normal version of Terraria, and and when i mean time in game i mena the gmae literally is 2.5x slower than the base game, i have a feeling its my pc but i wanna make sure
 

silent_ptr

Plantera
This might be related to the windows defender thing. Are you sure the file is still in the steam folder? If I were you, I'd just have steam verify the game files, then do the tmodloader install again.
Yeah, I figured it out shortly after. I thought Windows Defender was good...
 

silent_ptr

Plantera
I'm working on a chainsaw. How do I make it so it turns to face the cursor?
Code:

Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace TerraXMod.Items.Tools
{
    public class OrigineticChainsaw : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Originetic Chainsaw";
            item.damage = 27;
            item.melee = true;
            item.width = 56;
            item.height = 22;
            item.toolTip = "'A revving chainsaw prepared to cut through the strongest of trees'";
            item.useTime = 15;
            item.useAnimation = 30;
            item.axe = 18;
            item.useStyle = 5;
            item.knockBack = 3;
            item.value = Item.buyPrice(0, 2, 0, 0);
            item.rare = 3;
            item.useSound = 22;
            item.autoReuse = true;
            item.useTurn = true;
        }
       
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "OrigineticBar", 28);
            //recipe.AddTile(99);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
 

silent_ptr

Plantera
Alright, so I'm making a chainsaw. This happens:

~omitted~

Please help. I've been working on this one item for 20 minutes now.

EDIT: Flipped proj sprite, now this happens:

Terraria 27-06-2016 12-43-56 PM-491.png
 

Attachments

  • Terraria 27-06-2016 12-24-32 PM-670.png
    Terraria 27-06-2016 12-24-32 PM-670.png
    64.9 KB · Views: 222
Last edited:

Solo-Ion

Dungeon Spirit
Firstly, and most importantly, I Thank You LOADS for the help with the homing projectile doing the entirety of the homing projectile for me. It FINALLY works in a satisfactory manor :)

secondly,
ARKHALIS
I've set the type and ai to 595 and 75 respectively, but it still won't appear :( is there something in my code making it invisible, or is there something I still need to do to make it appear properly

also, I'd rather not look into the vanilla code unless it's really REALLY necessary. aka nobody anywhere on this forum knows how to do such and such thing and there are no tutorials, which would be a tragedy indeed.

also, sorry if I annoy you with my constant questions. That would not happen to be one of my goals when asking them

also, are there any tutorials on basic custom boss ai stuff that you know of? I'd like to check out things of that sort before I ask on here

also, I say 'also' too much
You're very welcome.

Now, the Arkhalis has the following properties.
this.name = "Arkhalis";
this.width = 14;
this.height = 38;
this.useAnimation = 25;
this.useTime = 15;
this.useStyle = 5;
this.rare = 2;
this.noUseGraphic = true;
this.channel = true;
this.noMelee = true;
this.damage = 20;
this.knockBack = 4f;
this.autoReuse = false;
this.noMelee = true;
this.melee = true;
this.shoot = 595;
this.shootSpeed = 15f;
this.value = 40000;
Some things you won't need to worry being exact about such as value and animationTime, but you definately need projectile.channel to be true, and useStyle should be the same as above also.

It took me just a few moments to find this information with code I decompiled earlier. As far as I know, it's against forum rules to say how to decompile Terraria, but it's not too hard to work out how to do. And you can save the code so that you don't need to decompile it every time.

I don't know much about boss AI at all, or where some tutorials may be, but the example mod is a good place to look first. I'd suggest you start with some simpler enemy AI before trying a boss, though.

As for that other monster list of things you'd like to do, I don't know how to do most of those things and I'd need to sit down for several hours to work out the rest. I'm happy to give some help, but time spent helping other people is time not spent on my own mod.
 

gardenapple

Steampunker
How would I use a modded tile as the required tile for a recipe?
recipe.AddTile(mod, "YourTileName");
I'm working on a chainsaw. How do I make it so it turns to face the cursor?
Chainsaws and drills are a little complicated. They actually count as projectiles.
A good example of their code is the Molten Drill from ExampleMod. Here's the link to its item class and the projectile class.
The most important part in the item code is this:
Code:
item.channel = true;
item.noUseGraphic = true;
item.noMelee = true
...
item.useStyle = 5;
...
item.useSound = 23;
...
item.autoReuse = true;
item.shoot = mod.ProjectileType("MoltenDrill");
item.shootSpeed = 40f;
Also you have to be careful with the textures. The item texture should look like this:
MoltenDrill.png

And the projectile texture should look like this:
MoltenDrill.png
 
Last edited:

Venatus

Terrarian
I cant figure out how to get the coding required to make a clone of the Clockwork Assault Rifle.
Help would be immensely appreciated!
 

Iriazul

Terrarian
I cant figure out how to get the coding required to make a clone of the Clockwork Assault Rifle.
Help would be immensely appreciated!
For that you'll want to look into the useTime and animationTime variables of your item. Normally these two would equals the same, but to take that rifle as an example: it has a useTime of 4 and a useAnimation of 12. Meaning that the item is used 3 times during one animation (since 12/4=3). Hope you understand that :)
 

Fortune

Skeletron Prime
Theres a error for version 0.8.2 within multiplayer, when playing on a server with my friend we both seem to be petrified on eachother's screen although we're not. This goes on and off constantly, a few seconds petrified, another few not, sorry if this has already been noted.
 
Top Bottom