Standalone [1.3] tModLoader - A Modding API

well :red:, nothing can help me i JUST WANT TO PLAY MY TERRARIA MODS
[doublepost=1466030943,1466030415][/doublepost]ok heres EVERYTHING i have
zy65mv.jpg


some stuff is censored, to avoid pirate of the computer
also here is my whitelist:
242dc1x.jpg
 
Last edited:
Code:
if (NPC.downedBoss1 == true)
            {
                shop.item[nextSlot].SetDefaults(mod.ItemType("ModItem"));
                shop.item[nextSlot].value=value;
                nextSlot++;
            }

downedBoss1 can be replaced with any of these:
downedBoss1
downedBoss2
downedBoss3
downedQueenBee
downedSlimeKing
downedGoblins
downedFrost
downedPirates
downedClown
downedMartians
downedGolemBoss
downedPlantBoss
downedFishron
downedChristmas(IceQueen, Santank, Tree)
downedHalloween(Tree, King)
downedAncientCultist
downedMoonlord
downedMechBossAny
downedMechBoss1
downedMechBoss2
downedMechBoss3
so what would i put if i want it to be a modded boss, the mod name is LordBozo and the Boss is "Ian"
 
well :red:, nothing can help me i JUST WANT TO PLAY MY TERRARIA MODS
[doublepost=1466030943,1466030415][/doublepost]ok heres EVERYTHING i have
zy65mv.jpg


some stuff is censored, to avoid pirate of the computer
also here is my whitelist:
242dc1x.jpg
I'm having the same problems, my windows defender detects the modded terraria exe as a trojan horse. I've tried re-downloading the zip file, but when I extract it, I end up having the same problem.
 
Steam has had a few problems when it comes to the antivirus softwares falsely detecting the exe game files as malware. Mainly because this is a modified terraria, the software will think that something is up.
 
One of the harder, but more global ways is to create a variable in a ModPlayer class like so:
Code:
public class MPlayer : ModPlayer
{
    // Not too good of a naming.
    // This variable should have a value from 0 to 100. 100 being a 100% not to use ammo.
    public int ammoUsage;   

    public override void ResetEffects()
    {
        this.ammoUsage = 0;
    }
}
An then on your accessory do something like:
Code:
public override void UpdateAccessory(Player player)
{
    MPlayer mp = player.GetModPlayer<MPlayer>(mod);
    // Here we give the player a 10% chance not to consume ammo.
    mp.ammoUsage = 10;
}

Then create a class that derives from GlobalItem, override ConsumeAmmo and use the newly made variable in there:
Code:
public class GItem : GlobalItem
{
    public override bool ConsumeAmmo(Item item, Player player)
    {
        MPlayer mp = player.GetModPlayer<MPlayer>(mod);
        if(Main.rand.Next(0, 101) <= mp.ammoUsage)
            return false;
        return true;
    }
}

Something like that. This was programmed from the top of my head, so there might be a few flaws here and there, but I hope you get the general idea.
Didnt work. Hated the mp. Any other ideas people.
 
Code:
if (NPC.downedBoss1 == true)
            {
                shop.item[nextSlot].SetDefaults(mod.ItemType("ModItem"));
                shop.item[nextSlot].value=value;
                nextSlot++;
            }

downedBoss1 can be replaced with any of these:
downedBoss1
downedBoss2
downedBoss3
downedQueenBee
downedSlimeKing
downedGoblins
downedFrost
downedPirates
downedClown
downedMartians
downedGolemBoss
downedPlantBoss
downedFishron
downedChristmas(IceQueen, Santank, Tree)
downedHalloween(Tree, King)
downedAncientCultist
downedMoonlord
downedMechBossAny
downedMechBoss1
downedMechBoss2
downedMechBoss3
how can i do this for a modded boss?
 
What's going on??? I'm definitely not the only one having this issue but no one is answering.

Last week I downloaded tModLoader for the first time, how freakin great is this! I very happily (thankyou) ran it for a week, until...
Went to start Terraria and my Windows Defender deleted tModLoader saying it's a SEVERE THREAT malware.
Why was I able to download this a week ago and play without a problem, now it's a threat and has been throwing up random advertisement websites??
I haven't done anything else on this pc all week except run tModLoader plus the 3 mods I loaded on the first day. Nothing's changed from my end.

I have attempted to reinstall but the warnings keep coming.
This is my 5th day without a cigarette, my newly modded Terraria game was keeping me from drowning myself :confused:
 
What's going on??? I'm definitely not the only one having this issue but no one is answering.

Last week I downloaded tModLoader for the first time, how freakin great is this! I very happily (thankyou) ran it for a week, until...
Went to start Terraria and my Windows Defender deleted tModLoader saying it's a SEVERE THREAT malware.
Why was I able to download this a week ago and play without a problem, now it's a threat and has been throwing up random advertisement websites??
I haven't done anything else on this pc all week except run tModLoader plus the 3 mods I loaded on the first day. Nothing's changed from my end.

I have attempted to reinstall but the warnings keep coming.
This is my 5th day without a cigarette, my newly modded Terraria game was keeping me from drowning myself :confused:
revert, dont use the newest build of tmodloadr, use the version one back, 0.8.1.1
 
how can i do this for a modded boss?
what you need to do, in your main file, create a public static bool MODDEDBOSSNAMEDowned = false;
make a save and load of it, u can study examplemod for info on how to do that
and when your boss dies, in the NPCLoot part or wherever you make your bosses gores appear, MODNAME.MODDEDBOSSNAMEDowned = true;

now wherever you want it to effect, like that shop you put if(MODNAME.MODDEDBOSSNAMEDowned) {whatever you like}

FYI MODNAME u put your mod's name there. MODDEDBOSSNAME is your boss' name
 
When I try to use tmodloader, even with all mods disabled, my terraria runs like it is set to half speed...

It literally took me 45 seconds to respawn after dying from a normal enemy.... (So probably 1/3 speed -.-)

Does anyone know if this is because my computer is not good enough, or something else?
 
Last edited:
When I try to build my mod I get this error
Code:
c:\Users\Bryson\Documents\My Games\Terraria\ModLoader\Mod Sources\GunPulse\NPCs\Boss\DragonSlime.cs(44,116) : error CS1026: ) expected
and here is the code for it(I couldn't seem to find whats wrong)
Code:
using System.IO;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace GunPulse.NPCs.Boss
{
    public class DragonSlime : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "Dragon Slime";
            npc.displayName = "Dragon Slime";
            npc.aiStyle = -1;
            npc.lifeMax = 1000;
            npc.damage = 20;
            npc.defense = 200;
            npc.knockBackResist = 100;
            npc.width = 162;
            npc.height = 126;
            animationType = NPCID.Medusa;
            Main.npcFrameCount[npc.type] = 2;
            npc.value = Item.buyPrice(0, 40, 75, 42);
            npc.npcSlots = 1f;
            npc.boss = true;
            npc.lavaImmune = true;
            npc.noGravity = false;
            npc.noTileCollide = true;
            npc.soundHit = 8;
            npc.soundKilled = 14;
            npc.netAlways = true;
        }
        public override void AutoloadHead(ref string headTexture, ref string bossHeadTexture)
        {
            bossHeadTexture = "GunPulse/NPCs/Boss/DragonSlime_Head_Boss";
        }
        public override void BossLoot(ref string name, ref int potionType)
        {
            potionType = ItemID.GreaterHealingPotion;
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonBar");
        }
        public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
        {
            npc.lifeMax = (int)(npc.lifeMax * 0.579f * bossLifeScale);
            npc.damage = (int)(npc.damage * 0.6f);
        }
    }
}
 
When I try to build my mod I get this error
Code:
c:\Users\Bryson\Documents\My Games\Terraria\ModLoader\Mod Sources\GunPulse\NPCs\Boss\DragonSlime.cs(44,116) : error CS1026: ) expected
and here is the code for it(I couldn't seem to find whats wrong)

As the error says, on line 44 you are missing a right parentheses.

Code:
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonBar");
 
As the error says, on line 44 you are missing a right parentheses.

Code:
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonBar");

Oh I see the error
thanks
[doublepost=1466043612,1466043046][/doublepost]When I load my boss into the game it just floats and stays still and when you touch him he dies :|
 
Back
Top Bottom