tModLoader Trouble coding accessories to have the effects of other accessories

F5Astronine

Terrarian
Part of the goal for my mod is to improve quality-of-life in some way, and I'm trying to make an accessory that combines the effects of the Charm of Myths and the Star Veil. I am having trouble finding how I can code this, however, as after examining Terraria's source (mainly Player.cs), there appear to be no bool values in place for the Star Cloak or any of its upgrades.

Here are the initial reload error and coded effects for said accessory if needed (lines 27-30 were copypasted directly from Player.cs):
1665087842434.png

1665087851405.png


If anyone knows what I'm talking about and is able to assist me, please do. I seriously have no idea what I'm doing.
 
Last edited:
find the buffs that are applied when using them and then use player.UpdateEquip or UpdateInventory and apply those buffs through Player.AddBuff
 
find the buffs that are applied when using them and then use player.UpdateEquip or UpdateInventory and apply those buffs through Player.AddBuff
No idea what any of this means, today is my first day working with tModding and with C# altogether. Apologies if I'm wasting your time :sigh:
 
I'm not sure about the buffs part, but the error you're getting indicates that the compiler has no idea what currentItem is. It's not defined in the context of your code.
 
I'm not sure about the buffs part, but the error you're getting indicates that the compiler has no idea what currentItem is. It's not defined in the context of your code.
I'm aware, I just don't know how I can make it recognise a currentItem in already existing Terraria code, or how I can create my own. :confused:
 
Back
Top Bottom