Standalone [1.3] tModLoader - A Modding API

I can't wait for ModPlayer to be added (a GlobalPlayer would also be nice). That way I don't have to take a long roundabout way just to add extra stats like a fire rate multiplier.
 
I can't wait for ModPlayer to be added (a GlobalPlayer would also be nice). That way I don't have to take a long roundabout way just to add extra stats like a fire rate multiplier.
There would be no point in GlobalPlayer, since there's only one type of player. ModPlayer would basically be the same thing as what you'd expect GlobalPlayer to be, except with the additional capabilities of storing information specific to each player.
 
There would be no point in GlobalPlayer, since there's only one type of player. ModPlayer would basically be the same thing as what you'd expect GlobalPlayer to be, except with the additional capabilities of storing information specific to each player.
Well in that case, I LOVE IT!
4555767-85411-horse-head-mask-thumbs-up-gif-d8zv.gif
 
And how do I fix my bunny boss switching direction in the air?

EDIT: Don't worry, I figured it out.
 
Last edited:
My boss always drops lesser healing potions... how do I change that? I want it to be greater healing potions.

Use something like:
Code:
public override void NPCLoot()
{
    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion);
}
On your boss.
 
Use something like:
Code:
public override void NPCLoot()
{
    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion);
}
On your boss.
He still drops the Lesser Healing Potions (15, I believe) and drops only one Greater Healing Potion.
 
He still drops the Lesser Healing Potions (15, I believe) and drops only one Greater Healing Potion.
Hmm, don't really know if you can remove the dropping of lesser Healing Potions this way, then. To spawn more Greater Healing Potions however, just do:
Code:
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion, 10);
Where '10' is the amount you want to spawn...
 
Hmm, don't really know if you can remove the dropping of lesser Healing Potions this way, then. To spawn more Greater Healing Potions however, just do:
Code:
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion, 10);
Where '10' is the amount you want to spawn...
In the ModNPC docs, there is a method called
public virtual void BossLoot(ref string name, ref int potionType)

and one of the parameters is potionType.
Hmm... its virtual...

EDIT: Nevermind. Found out potionType is actually item ID and name can just be the display name.
 
In the ModNPC docs, there is a method called
public virtual void BossLoot(ref string name, ref int potionType)

and one of the parameters is potionType.
Hmm... its virtual...

EDIT: Nevermind. Found out potionType is actually item ID and name can just be the display name.
Ah, you figured it out yourself, gj! ;)

If you still need some help with that, the following will work:
Code:
public override void BossLoot(ref string name, ref int potionType)
{
    potionType = ItemID.SuperHealingPotion;
    base.BossLoot(ref name, ref potionType);
}
 
How to I allow you to get seeds while breaking grass on a weapon, like the blowpipe does. Also, what use style does the blowpipe use.
 
How to I allow you to get seeds while breaking grass on a weapon, like the blowpipe does. Also, what use style does the blowpipe use.
I don't know about your first question, need to look into that... Second, though (these are the default settings for the Blowpipe in the SC):
Code:
this.useStyle = 5;
this.autoReuse = true;
this.useAnimation = 45;
this.useTime = 45;
this.name = "Blowpipe";
this.width = 38;
this.height = 6;
this.shoot = 10;
this.useAmmo = 51;
this.useSound = 63;
this.damage = 9;
this.shootSpeed = 11f;
this.noMelee = true;
this.value = 10000;
this.knockBack = 3.5f;
this.toolTip = "Allows the collection of seeds for ammo";
this.ranged = true;
Where you should replace 'this' with 'projectile' ofc :)
 
Back
Top Bottom