tModLoader Official tModLoader Help Thread

Trying to make this code work , but it says that i'm missing a } at 13,46. Even if i put it there or in another place it still says i need more
 
Hi i'm new here , came to ask : How can i detect that a player is wearing a certain armour piece ?
Try "UpdateEquip(Player player)". Found it in the ModItem class reference, scroll down until you see it.

Trying to make this code work , but it says that i'm missing a } at 13,46. Even if i put it there or in another place it still says i need more
You probably need more! It's likely that the code editor program you're using highlights these brackets in pairs, so you can see which brackets have a pair and which ones do not.
Send your code here if you can't figure it out.
 
Thanks for the help , i'll send you the code . Terraria paste - Pastebin.com
I'm pretty sure you can't override from inside other overriden methods: public override void Kill code must be on the same level as public override void ProcessTriggers code.
There's also a stray "/" at line 28 after the calculation :)
It seems you've began writing ProcessTriggers, then the Hotkey check, and then didn't finish it and went straight to Kill(). The "{" after (TutorialMod.ExplodeHotKey.JustPressed) is the bracket that needs a pair. After that, you can begin writing your Kill() code.
here's how I'd do it
 
I'm pretty sure you can't override from inside other overriden methods: public override void Kill code must be on the same level as public override void ProcessTriggers code.
There's also a stray "/" at line 28 after the calculation :)
It seems you've began writing ProcessTriggers, then the Hotkey check, and then didn't finish it and went straight to Kill(). The "{" after (TutorialMod.ExplodeHotKey.JustPressed) is the bracket that needs a pair. After that, you can begin writing your Kill() code.
here's how I'd do it
it says that : CS0115 Tutorialplayer(int) no suitable methode to override
 
it says that : CS0115 Tutorialplayer(int) no suitable methode to override
Where does it say that exactly? Is it in regards to the Kill() method? I've checked just now and the Kill() method does not take in a single int parameter like it does in your code (the timeleft one), instead it takes up several and none of them are ints i believe.
Where did you get this method from? It's possible it's supposed to run elsewhere. If you're sure that this is the place, check the PlayerHooks reference page and search for the kill method, and simply copy the parameters from there.
 
Where does it say that exactly? Is it in regards to the Kill() method? I've checked just now and the Kill() method does not take in a single int parameter like it does in your code (the timeleft one), instead it takes up several and none of them are ints i believe.
Where did you get this method from? It's possible it's supposed to run elsewhere. If you're sure that this is the place, check the PlayerHooks reference page and search for the kill method, and simply copy the parameters from there.
the error is at : 18,29. I'm tryna make a bind that explodes you (a killbind so to speak) , since i don't know exaclty what i'm doing i checked the example mod for instructions for binds and it was in the modplayer. And this methode was taken from a custom explosive , i hoped that if i just took the kill code it'll work
 
the error is at : 18,29. I'm tryna make a bind that explodes you (a killbind so to speak) , since i don't know exaclty what i'm doing i checked the example mod for instructions for binds and it was in the modplayer. And this methode was taken from a custom explosive , i hoped that if i just took the kill code it'll work
The bind does go into the modplayer class, but you'll have to do some extra work with the explosive code, just copying it won't work since the explosive and modplayer classes work very differently.
I'm not sure if Kill is the method you'd want to copy, since it's a hook, which means that instead of killing anything, it's a method that runs when something gets killed. So for modplayer, the kill method will activate when the player dies, and all code that is in the kill method will run when that happens. Same with Hurt(), PreHurt() and PostHurt(), these activate when player takes damage.
You'd probably want to spawn an explosive at the player's position when the player presses the hotkey, but I can't help you with that exactly, sorry :p try spawning a projectile with NewProjectile() from the Projectile Class Documentation's "Methods" paragraph
 
The problem most likely has to do with tmodloader's version, terraria 1.4 requires tmodloader 0.11.7+ version. I've had the exact same problem until I've installed the latest tmodloader version via Steam.

Okay! Is that the x64 bit version or the x32 bit version. The reason for the question is that I would be able to run more mods without worrying about it crashing on the x64 bit version than the x32 bit version.
 
Okay! Is that the x64 bit version or the x32 bit version. The reason for the question is that I would be able to run more mods without worrying about it crashing on the x64 bit version than the x32 bit version.
That depends on your computer actually! Some processors are 64-bit while others are 32-bit. You need to go into your computer's settings window to see info on your processor. My bet is on it being 64-bit though, since you say that it crashes less, and more importantly, that it still works fine :p
 
That depends on your computer actually! Some processors are 64-bit while others are 32-bit. You need to go into your computer's settings window to see info on your processor. My bet is on it being 64-bit though, since you say that it crashes less, and more importantly, that it still works fine :p
It actually doesn't have to do with the computer. The majority of tModLoader installs are 32-bit. There is an unofficial 64-bit version but it is buggy and outdated. For the time being 32-bit is the more stable one.
 
OwO?

edit: this displays when clicking on mod browser... the tmod is from steam latest version...
 

Attachments

  • uwu.png
    uwu.png
    454.5 KB · Views: 177
Back
Top Bottom