Standalone [1.3] tModLoader - A Modding API

is it currently possible to make a boss spawn other monsters? like the eye of Cthulhu spawning servants of Cthulhu?
Just use the NPC.NewNPC function? You can get all autocomplete functions if you get Visual Studio (or something of the sorts). Believe me, just strolling through all the functions a class contains will help a lot.

EDIT:
Question: Is there already a way to draw textures with ModBuffs? Since the SpriteBatch.Begin method has not been called in the overridable Update function of the ModBuffs. Or won't this be possible untill player hooks have been integrated? ;)
Ty in advance!
 
Last edited:
So how would I use the holdoutoffset function in my weapon? I forgot what it was exactly called but I need it to fix this (Yes I know a diagonal facing bow probably wasn't a good idea but I wanted it that way)
upload_2015-11-8_15-43-1.png
 
How would I program a tile so that it would only work as a crafting station if a specific tile was immediately adjacent to it?

Think Minecraft's mods' multiblock structures, but in Terraria.
For all the recipes that require it, you could add both tiles as requirements.

Just use the NPC.NewNPC function? You can get all autocomplete functions if you get Visual Studio (or something of the sorts). Believe me, just strolling through all the functions a class contains will help a lot.

EDIT:
Question: Is there already a way to draw textures with ModBuffs? Since the SpriteBatch.Begin method has not been called in the overridable Update function of the ModBuffs. Or won't this be possible untill player hooks have been integrated? ;)
Ty in advance!
You won't be able to draw textures on the player until I add PlayerLayer support.

So how would I use the holdoutoffset function in my weapon? I forgot what it was exactly called but I need it to fix this (Yes I know a diagonal facing bow probably wasn't a good idea but I wanted it that way)
View attachment 84138
I'm not entirely sure myself, but for the Sparkling Sphere in the example mod what I did was fiddle around with some numbers.
 
For all the recipes that require it, you could add both tiles as requirements.


You won't be able to draw textures on the player until I add PlayerLayer support.


I'm not entirely sure myself, but for the Sparkling Sphere in the example mod what I did was fiddle around with some numbers.
Ill try it out thx
 
what parameters do I pass to player.AddBuff(); for modbuffs?
In the source code, I see this:
You would basically do it the same way as normal buffs, except to get the ID you'll need to use Mod.BuffType.

how do you make an item only usable at night? e.g. suspicious looking eye
You'll have to override the CanUse hook and return Main.dayTime.

ca somebody help me, im trying to install it but it keeps saying "could not find installation resource file" ?
Just to make sure, you unzipped the folder, right? If you did, is there a Resources folder next to the installer exe, and is there an Install file inside that folder?
 
yeah i found that but i cant open it
The "Install" file isn't supposed to be opened; it just contains information for the installer executable to copy files over to your Terraria directory. Hmm, which platform are you using? That error message you're getting means that the installer isn't able to find the Install file for some reason.

Also I'm not sure if this will help but is it possible that your computer is blocking the "Install" file due to being downloaded from the Internet?
 
Hello BlueMagic. You've done some great work with tModLoader. I think I may have found some bugs. If you click on the mod browser when not connected to the internet, then tModLoader crashes.

And something that may or may not be a bug, if you draw two different dust particles in one hook, they are usually displayed the same as each other. This is an example that I put together quickly. It belongs in a modItem.
Code:
public override void HoldStyle(Player player)

{
    int dust3 = Dust.NewDust(player.position - new Vector2(200, 0), 0, 0, Main.dust[21].type, 0f, 0f, 0, Microsoft.Xna.Framework.Color.White);
    int dust4 = Dust.NewDust(player.position - new Vector2(-200, 0), 0, 0, Main.dust[100].type, 0f, 0f, 0, Microsoft.Xna.Framework.Color.White);
}
Even though I specify two different dust types, only one is drawn for both, and it's not always the same one.

Anyway, thanks.
 
But in modbuff's update method, there is a Player parameter, not an NPC or Entity parameter...
Buff support is still incomplete, and should be officially supported in the next update.

Hello BlueMagic. You've done some great work with tModLoader. I think I may have found some bugs. If you click on the mod browser when not connected to the internet, then tModLoader crashes.

And something that may or may not be a bug, if you draw two different dust particles in one hook, they are usually displayed the same as each other. This is an example that I put together quickly. It belongs in a modItem.
Code:
public override void HoldStyle(Player player)

{
    int dust3 = Dust.NewDust(player.position - new Vector2(200, 0), 0, 0, Main.dust[21].type, 0f, 0f, 0, Microsoft.Xna.Framework.Color.White);
    int dust4 = Dust.NewDust(player.position - new Vector2(-200, 0), 0, 0, Main.dust[100].type, 0f, 0f, 0, Microsoft.Xna.Framework.Color.White);
}
Even though I specify two different dust types, only one is drawn for both, and it's not always the same one.

Anyway, thanks.
So the mod browser just outright crashes, without even showing the error message screen?

Also, for the dust's type, Main.dust[21].type gets the type of the dust in index 21 of the list of dusts in the world. What you want to do is use just 21.
 
Guys can you help me? I got an error when trying to opt out of tmodloader, That says that tmodloader either isnt installed, or i dont have the backup resource file. I have tmodloader installed right now, so would someone of you maybe get me the backup resources? In case that doesnt work, i'll be stuck in modded for a bit. (No real rush on fixing it, i enjoy modded :p )
 
Back
Top Bottom