tModLoader Looking for help with 1.4.4.9

reaperbird

Terrarian
Hey y'all :)
I'm new to modding and I'm looking for some resources and tips / code snippets for 1.4.4.9.
More precisely I'm interested in the following things:
- adding a toggle when using a custom item (like torch god's favor; torch swap thing)
- checking if a toggle (next to the inventory) is on when the player takes damage (if it is, run some code)
- adding some kind of listener to the player dying (or something similar) and cancel the death of the player if some condition is met
- adding 2 different musics to a custom boss npc depending on its health

There are already some tutorials, but most of them is either outdated or requires modding experience in 1.3 or is in a different language.

If it's possible, I would like to learn from Duke's AI (or something similar). I'm interested in learning from them about it's sharknado attack.

Any help, directions, resources, guides, code samples are greatly appreciated!
Thanks in advance.
 
So for up to date tutorials and code, look at ExampleMod and the wiki, and make sure you are looking at the stable branch, but also not at the /Old/ folder as that's 1.3 stuff.
TML Wiki
For your first 2 questions, do you mean a custom UI element? The wiki has a UI guide and EM has a few examples.
For question #3, you can override PreKill() on ModPlayer and return false to prevent the player from dying.
For #4, you can set Music = to your song under some logic. EM shows this for a boss IIRC
 
So for up to date tutorials and code, look at ExampleMod and the wiki, and make sure you are looking at the stable branch, but also not at the /Old/ folder as that's 1.3 stuff.
TML Wiki
For your first 2 questions, do you mean a custom UI element? The wiki has a UI guide and EM has a few examples.
For question #3, you can override PreKill() on ModPlayer and return false to prevent the player from dying.
For #4, you can set Music = to your song under some logic. EM shows this for a boss IIRC
Wow, thank you so much!!
Yes, I meant the ui element (plus the code itself that makes torch swap work, if it's somewhere else), but ig the EM also has something similar
 
Back
Top Bottom