Standalone [1.3] tModLoader - A Modding API

Hey! New to modding, and I'm posting here with the hope that somebody can help me with my code. I want my weapon to give the player a buff when they right click with it. The issue is that once the player right clicks with the sword, item.buffType is assigned to the entire item. From that point forward, both the left and right clicks assign the buff. How do I unassign item.buffType for the left click functionality? or maybe there's a better way to go about this?

Here's the relevant code:
C#:
public override bool CanUseItem(Player player){ //right click functionality
            if (player.altFunctionUse == 2){
                item.UseSound = SoundID.Item100;//placeholder
                item.useStyle = ItemUseStyleID.HoldingUp;
                item.useTime = 10;//placeholder
                item.useAnimation = 10;//placeholder
                item.noMelee = true;
                item.buffType = ModContent.BuffType<GhostbladeBuff>();
                item.buffTime = 360;
            }
            else {
                item.UseSound = SoundID.Item1;
                item.useStyle = ItemUseStyleID.SwingThrow;
                item.useTime = 10;
                item.useAnimation = 25;
                item.noMelee = false;
            }
            return base.CanUseItem(player);
        }

UPDATE: I've since resolved this issue on my own. Instead of using item.buffType = ModContent.BuffType<GhostbladeBuff>();, I'm using item.buffType = mod.BuffType"GhostbladeBuff". This allows me to use item.buffType = mod.BuffType""; to unassign the buff, fixing my issue.
 
Hey, is there any rough estimate for when tModLoader will be compatible with version 1.4.0.5, or any estimated progress percentage?
And will there be an announcement some time before it releases?
 
Not yet, but we are working on it.
Wouldn't it be more advisable waiting for v1.4.1 before messing around with the current assemble process and having everything being wasted due to the fact opcodes changing after the client update?
 
Hey, is there any rough estimate for when tModLoader will be compatible with version 1.4.0.5, or any estimated progress percentage?
And will there be an announcement some time before it releases?
I think getting an estimate of when the update will come is not a good idea, It will be bad for everyone if the mod loader devs end up rushing the development because the estimate deadline is getting near.

I say that they can take their time to make it.
 
I'm wondering.
Once you get TML to work with current version of Terraria will it be like the current way TML is handled on Steam?
Or would we have to download it and use it as we did before?
 
What, still here? Hand it over. That thing, your tmodloader 1.4. For my terraria modding.
 
Guys, I know you're sick and tired of all these "When? When?!!" types of questions, but there's something to be said about not keeping thousands of us totally in the dark. I'm sure a lot of folks are scratching their heads trying to schedule their playthroughs around it. So my question is more realistic one. The mod's dev team has quite a few veterans who worked on 1.3 and earlier versions and can theoretically give an educated estimate of the development progress. Compared to 1.2 or 1.3, and VERY roughly speaking (without going into any promises or estimated timelines, or anything like that) how much progress would you say has been done on 1.4? Closer to a quarter, a half? Are there any serious roadblocks right now that make you feel that the development may drag on longer than expected? I tried to guesstimate these things myself from the GitHub commits but it's way too difficult for an outsider. If you can occasionally give us such basic status updates from time to time, I'm sure many will greatly appreciate it. I know I will.
 
I installed TmodLoader off steam today and the mod browser wasn't working and neither was the manual mod browser website, saying that it could not be loaded. Is it a problem with the website or my pc?
 
Um...I tried to manually install the TModLoader from the front page of this thread, and I followed the directions by dropping the files into the Steam folder, and that overwrote some files. Now Terraria crashes at the Character Select screen. How do I uninstall it...?

I should have known this wouldn't work, it's not compatible with the latest version of Terraria yet...

I didn't corrupt anything irreparably, did I?
 
I think I fixed it by verifying Terraria's game files on Steam. That was scary. I'll wait until TModLoader is ready for the latest update before installing it this time...
 
Um...I tried to manually install the TModLoader from the front page of this thread, and I followed the directions by dropping the files into the Steam folder, and that overwrote some files. Now Terraria crashes at the Character Select screen. How do I uninstall it...?

I should have known this wouldn't work, it's not compatible with the latest version of Terraria yet...

I didn't corrupt anything irreparably, did I?

I installed TmodLoader off steam today and the mod browser wasn't working and neither was the manual mod browser website, saying that it could not be loaded. Is it a problem with the website or my pc?

No clue what you both are doing wrong, but the game and the loader works fine:
1598782404996.png
 
o tmodloader está na versão 1.3, não será atualizado para 1.4.0.5? ou é de outra forma?
 
o tmodloader está na versão 1.3, não será atualizado para 1.4.0.5? ou é de outra forma?
Sim amigo, o tModLoader está na versão 1.3.5.3 e está sendo atualizada neste momento para a versão 1.4.0.5.
 
mmmm... tendre que jugar el normal con una ayuda de otro programa y esperare con paciencia que actualizen el tmod
 
Do we know if tmodloader for 1.4 is going to be 64-bit? Playing around with it from Steam and constantly running into memory issues, despite having 32GB DDR4 RAM in my system.
 
Do we know if tmodloader for 1.4 is going to be 64-bit? Playing around with it from Steam and constantly running into memory issues, despite having 32GB DDR4 RAM in my system.
For now it's not on steam yet no, but you could look and see if there is a 64 bit version non steam (because one exists). I think maybe you could just replace the files in the steam install location and it might launch the 64 bit version (not sure on the installation procedure, so this is just a guess)
 
To create a mod, first run tModLoader. Click on the "Mod Sources" button in the main menu, then click on the "Open Sources" button to open the folder which contains your mod sources. In this folder, create another folder for your mod, then put all of your .cs files and .png files in that folder. When you are done, build your mod from the "Mod Sources" menu . If the mod failed to build, the game will show you one compile error, and give you an option to view all compile errors as a text file. If the mod successfully builds you will be returned to the main menu. If the game crashes or a mod fails to load, the game will display the error and also give you the option to view the error as a text file. Mods that crash on loading are automatically disabled. Mods are automatically enabled when they are built.
As a DLC on Steam, there is no mod sources button. How do you do this?
 
My tmodloader keeps crashing when I load calamity I have a 32 bit operator and a 64 bit processor and it's a Dell windows 10 computer a pretty old computer pls help
 
My tmodloader keeps crashing when I load calamity I have a 32 bit operator and a 64 bit processor and it's a Dell windows 10 computer a pretty old computer pls help
Do you mean your operating system 32 bit and your processor is 64? if so you should really upgrade the OS as that is going to be a huge bottleneck for a lot of gaming as 32bit only allows roughly 4gb of ram to be used, Windows 10 uses a lot of memory and modded Terraria especially heavy mods like calamity and Terraria overhaul are pretty ram intensive and you could easily expect to get an out of memory CTD.
 
Back
Top Bottom