Standalone [1.3] tModLoader - A Modding API

Yeah, I know that multiplayer can be an order of magnitude more difficult than singleplayer. I had a :redmunch:of a time with one of my items and multiplayer. I can't give you any specific help because my problem was completely different, but I can give you some general advice. You can use Main.NewText(/*stuff*/); to see what's happening on a client and Console.WriteLine(/*stuff*/); to see the same thing in the console window of your server.

For example, you could try the following inside your onPickup's first if statement:
Code:
Main.NewText("onPickup, Durability: " + ((IchorKnife)item2.modItem).durability);
Console.WriteLine("onPickup, Durability: " + ((IchorKnife)item2.modItem).durability);
K, thx and I gotta try. But I did meet with lots of bugs recently and abruptly... Guess it has something to do with multiplayer itself. Maybe I should more expect the next update (but blue is busy with honework anyways).
 
How can you add an Particle/dust effect on an tile?
so that the Dust/Particle comes if you Break the Tile?
 
Ok,im got an new Problem C:
How do you let the Tile be detected as ore?
SO that the Spelunker Potion etc shows the Tile
 
next is how i make a item give this effect (potion)
also i dont know how the eating (consumable) item code looks like
i can make items work like crates rightclick open

Code:
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using PotionsPlus.Buffs;
using PotionsPlus.Items.Placeable;

namespace PotionsPlus.Items
{
    public class AdamantitePotion : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Adamantite Potion";
            item.useSound = 3;
            item.useStyle = 2;
            item.useTurn = true;
            item.useAnimation = 17;
            item.useTime = 17;
            item.maxStack = 30;
            item.consumable = true;
            item.width = 20;
            item.height = 28;
            item.toolTip = "Provides Increased Damage";
            item.value = 1000;
            item.rare = 1;
            item.buffType = mod.BuffType("AdamantitePotion");
            item.buffTime = 30000;
            return;
        }

In the (AdamantitePotion) you Put your Buff Name
item.buffTime = 30000; is ,yes,the Buff time C:
30000 are ca 8 Minutes
 
This is really cool, but I'm encountering a problem. I cannot find out how to access my old characters and worlds. May you please help me with that?
 
This is really cool, but I'm encountering a problem. I cannot find out how to access my old characters and worlds. May you please help me with that?

Go to C:\Users\lukas\Documents\My Games\Terraria\Players
Copy all Files and Folders there

then go to C:\Users\lukas\Documents\My Games\Terraria\ModLoader\Players
and paste all Files where

With Worlds its near these Same

Go to C:\Users\lukas\Documents\My Games\Terraria\Worlds
Copy all files

then to C:\Users\lukas\Documents\My Games\Terraria\ModLoader\Worlds
and paste the Files
 
"line breaks in constant"
thats the error with urs

also how do i put this into the code

player.HasBuff(BuffID.Sunflower) >= 0

this is vanilla

I meant "BuffType" (double quotation marks at beginning and end, somehow got messed up).

player.HasBuff(mod.BuffType("BuffName"))


This should work.
 
i need it to be tested if player has do this

something like that


if (player.HasBuff(BuffID.Sunflower) >= 0)
{
doing something
}

So you want to make an Effect that comes if you have an Buff?
why not Putting the Effect direct on the Buff?

Example

Potion
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using PotionsPlus.Buffs;
using PotionsPlus.Items.Placeable;

namespace PotionsPlus.Items
{
    public class AdamantitePotion : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Adamantite Potion";
            item.useSound = 3;
            item.useStyle = 2;
            item.useTurn = true;
            item.useAnimation = 17;
            item.useTime = 17;
            item.maxStack = 30;
            item.consumable = true;
            item.width = 20;
            item.height = 28;
            item.toolTip = "Provides Increased Damage";
            item.value = 1000;
            item.rare = 1;
            item.buffType = mod.BuffType("AdamantitePotion");
            item.buffTime = 30000;
            return;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.BottledWater, 1);
            recipe.AddIngredient(null, "PotionCrystal", 1);
            recipe.AddIngredient(ItemID.AdamantiteOre, 1);
            recipe.AddTile(TileID.Bottles);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace PotionsPlus.Buffs
{
    public class AdamantitePotion : ModBuff
    {
        public override void SetDefaults()
        {
            Main.buffNoTimeDisplay[Type] = false;
            Main.buffName[this.Type] = "Adamantite Potion";
            Main.buffTip[this.Type] = "Increased Damage";
        }
        public override void Update(Player player, ref int buffIndex)
        {
            player.meleeDamage += 0.20f;
            player.rangedDamage += 0.20f;
            player.thrownDamage += 0.20f;
            player.bulletDamage += 0.20f;
            player.arrowDamage += 0.20f;
            player.rocketDamage += 0.20f;
            player.magicDamage += 0.20f;
            player.minionDamage += 0.20f;
        }
    }
}
 

well this is all well and good but all i need is a buff i can testfor

as what i need it for cant be in the effect

this case better crit change to one sword (custom crit system used)

so i need the if() to testfor buff then add extra crit
 
Back
Top Bottom