tModLoader Official tModLoader Help Thread

I want to make an item that spawns in all bosses at once, how would I do that?

(I am relatively new to coding so I apologize if the answer is obvious)
 
Last edited:
I want to make an item that spawns in all bosses at once, how would I do that?

(I am relatively new to coding so I apologize if the answer is obvious)
You need to call NPC.NewNPC for every boss
now i'm having trouble finding the discord chat.:redspin:
also, the thing i'm really having trouble is building the pre-made csproj files included in the guide about coding out of tmodloader/coding on mac, which can be find here:https://forums.terraria.org/index.p...der-a-modding-api.23726/page-525#post-1001200
A link to the discord chat you can find in my signature
Mac is a specific situation... we can really help you easier on Discord
 
Hi do you have the knowledge on how to program terraria specifically in the field of "NPCs" because the example mod only shows how to aquire an AI but not create an AI and I do not want to let some old mods "die" cause some user can't explain "how to" in something specifically made to show "how to". Now please make this simple because I already spent 20 minutes searching the forums in total for help.
[doublepost=1548098507,1548098442][/doublepost]

I put this error in its own thread, but it can't hurt to ask here.
This has happened on three worlds so far. After defeating the cultist, every time I open the settings menu, the game crashes. Another issue is that monsters do not display their name and hp when hovered over. This is a very annoying bug, and I would very much appreciate help with it.
Mod list:
Calamity
Thorium
Sacred Tools
Qwerty's bosses and items
Initiate Mod
Intrucial
Fargo's
IMK sushi
IMK sushi old recipies
Magic Storage
Omniswing
Luiafk
Shorter Respawn
AlchemistNPC
VeinMiner
Wing Slot

System Specs
OS: linux mint 19
RAM 8gb
I been having problems with calamity so that may be the case.
The whole thing already crashes when loading a new world.
Better to just throw out the mod fam.
Or uninstall one mod at a time to figure out which one is the culprit.
But calamity might be the issue.
 
ok, most of the challenges have been overcome, but now there's this message:
'Make sure you have exactly 1 class extending mod.'
any ideas what the problem might be???
 
Hi do you have the knowledge on how to program terraria specifically in the field of "NPCs" because the example mod only shows how to aquire an AI but not create an AI and I do not want to let some old mods "die" cause some user can't explain "how to" in something specifically made to show "how to". Now please make this simple because I already spent 20 minutes searching the forums in total for help.
There's a few tutorials out there, but the only ones that I know of are kinda old and for past Terraria APIs. You may find that you need to change some formatting and other aspects, but the actual code should still work.
[Tutorial] Custom Bosses - NPC AI and Server Syncing
Surfpup's tConfig Mod Wiki
The first one is not so much a start-to-finish tutorial but more a 'how to do a specific thing'. The second one's older, but guides you through creating a specific kind of NPC. Hopefully you can find some useful stuff there.

ok, most of the challenges have been overcome, but now there's this message:
'Make sure you have exactly 1 class extending mod.'
any ideas what the problem might be???
You must have more than one class declaration that has ': Mod' after it. You should have only one of those in your entire mod. If you don't know what I mean, it's the part that looks like this.
Code:
namespace YourNamespaceName
{
    public class YourClassName : Mod
    {
 
Any of you know how can I make something happen when someone use the right click while a certain weapon is equiped? I want to make a weapon that when you do a right click when it is equiped, it gives a buff or shoots a projectile. I just want to know how to do something when there is a right click.
Sorry for bad english btw.
 
There's a few tutorials out there, but the only ones that I know of are kinda old and for past Terraria APIs. You may find that you need to change some formatting and other aspects, but the actual code should still work.
[Tutorial] Custom Bosses - NPC AI and Server Syncing
Surfpup's tConfig Mod Wiki
The first one is not so much a start-to-finish tutorial but more a 'how to do a specific thing'. The second one's older, but guides you through creating a specific kind of NPC. Hopefully you can find some useful stuff there.


You must have more than one class declaration that has ': Mod' after it. You should have only one of those in your entire mod. If you don't know what I mean, it's the part that looks like this.
Code:
namespace YourNamespaceName
{
    public class YourClassName : Mod
    {
should this work?
Code:
using Terraria.ID;
using Terraria.ModLoader;

namespace crab.Items
{
    public class crab : Mod
    {
 
Last edited:
So I asked this question a while ago, and I eventually figured it out on my own. It was never answered, and now, due to recent events, I've had to uninstall Terraria, along with all of the TModLoader files, and I'm running into the issue again. Here's the information I gave last time:

This message appears whenever I use the installer:

Installation of a provisioning package failed
Please work with the package author to diagnose the issue
Error Code 0x80070057

If I manually install it, nothing happens. It's just normal Terraria.

As far as I've looked, I've never seen this problem with anyone else.
 
Any of you know how can I make something happen when someone use the right click while a certain weapon is equiped? I want to make a weapon that when you do a right click when it is equiped, it gives a buff or shoots a projectile. I just want to know how to do something when there is a right click.
Sorry for bad english btw.
It's fairly simple, use the AltFunctionUse hook to do things when the right mouse button is clicked, however this hook is only called client side so it may cause issues on multiplayer.
 
It's fairly simple, use the AltFunctionUse hook to do things when the right mouse button is clicked, however this hook is only called client side so it may cause issues on multiplayer.
In order to make things work in MP, people just need to remember syncing it by sending network packets. (Netmessage.Send)
Thing like Projectile.NewProjectile do that automatically
 
How do I add a custom item/material to tModLoader because I use example Material but it doesn't accept the Material it just says Example missing tree all of the time.

Heres the error:
c:\Users\User\Documents\My Games\Terraria\ModLoader\Mod Sources\Xendos6Armas\Tiles\ExampleBlock.cs(18,19) : error CS0246: The type or namespace name 'ExampleTree' could not be found (are you missing a using directive or an assembly reference?)

c:\Users\User\Documents\My Games\Terraria\ModLoader\Mod Sources\Xendos6Armas\Tiles\ExampleGlobalTile.cs(16,50) : error CS0246: The type or namespace name 'ExamplePlayer' could not be found (are you missing a using directive or an assembly reference?)

c:\Users\User\Documents\My Games\Terraria\ModLoader\Mod Sources\Xendos6Armas\Tiles\ExampleHerb.cs(73,69) : error CS0234: The type or namespace name 'ExampleHerbSeeds' does not exist in the namespace 'ExampleMod.Items.Placeable' (are you missing an assembly reference?)

c:\Users\User\Documents\My Games\Terraria\ModLoader\Mod Sources\Xendos6Armas\Tiles\TEScoreBoard.cs(43,77) : error CS0246: The type or namespace name 'Projectiles' could not be found (are you missing a using directive or an assembly reference?)

c:\Users\User\Documents\My Games\Terraria\ModLoader\Mod Sources\Xendos6Armas\Tiles\TEScoreBoard.cs(193,70) : error CS0234: The type or namespace name 'ScoreBoard' does not exist in the namespace 'ExampleMod.Items.Placeable' (are you missing an assembly reference?)

c:\Users\User\Documents\My Games\Terraria\ModLoader\Mod Sources\Xendos6Armas\Tiles\VoidMonolith.cs(37,5) : error CS0246: The type or namespace name 'ExamplePlayer' could not be found (are you missing a using directive or an assembly reference?)

c:\Users\User\Documents\My Games\Terraria\ModLoader\Mod Sources\Xendos6Armas\Tiles\VoidMonolith.cs(37,61) : error CS0246: The type or namespace name 'ExamplePlayer' could not be found (are you missing a using directive or an assembly reference?)
 
Hey guys, I managed to get a new mod loaded in game, but I'm having an issue with Visual Studio during live debugging. I can start the game using Visual Studio just fine, and my mod works fine, but I cannot edit anything, even in break mode. I keep getting this error in VS2017 - "changes are not allowed if the assembly has not been loaded".

I have "eac" enabled under the Post-build event command line.

Any of you gurus know why this error occurs?
 
There's a few tutorials out there, but the only ones that I know of are kinda old and for past Terraria APIs. You may find that you need to change some formatting and other aspects, but the actual code should still work.
[Tutorial] Custom Bosses - NPC AI and Server Syncing
Surfpup's tConfig Mod Wiki
The first one is not so much a start-to-finish tutorial but more a 'how to do a specific thing'. The second one's older, but guides you through creating a specific kind of NPC. Hopefully you can find some useful stuff there.


You must have more than one class declaration that has ': Mod' after it. You should have only one of those in your entire mod. If you don't know what I mean, it's the part that looks like this.
Code:
namespace YourNamespaceName
{
    public class YourClassName : Mod
    {
Thanks!
 
So, I had done the following to try and mod MAC;
1.Make a mod skeleton from a simulator.
2.place a csproj generated from this tutorial into my root folder.
https://forums.terraria.org/index.p...der-a-modding-api.23726/page-525#post-1001200
3.changed the AssemblyName in the pre-made csproj to the mod’s one.
4.placed relogicMac.dll into my root folder.
5.build the csproj. Both mono and windows.
6.write noCompile = true in the end of the build.txt

For some reason it says that I need to have 1 and only 1 class, though I’ve never changed the cs files.
 
Back
Top Bottom