tModLoader SOLVED: Is it possible to make channeled weapons stay held out as they're channeled?

scottsimply

Terrarian
I have some weapons that involve charging up by holding down click. Is there any way to make the item continue to be held in front of the player without utilizing Item.autoUse? Here's the relevant code (probably won't help, but it's there I suppose).

Fixed it! Honestly it's pretty obvious, but there really isn't clear documentation on a lot of attributes/fields in the code, so it just took a lot of trial and error. Anyway, the solution is a little interesting.

My projectile handles the charging on a "helper" projectile. This projectile is invisible and intangible; it really only exists to manage the timer. It determines whether the player is charging by looking at the Player.channel attribute. While checking if the player is channeling, we can sneak in Player.itemTime and Player.itemAnimation. These are the attributes that set the held item's use time, and setting these will keep the item held out.

tbh, someone should make docs on tmodloader. i'd be down to help (though i have no CSS/HTML experience)
 
Last edited:
Back
Top Bottom