Construct's Armory

Construct's Armory

30M Downloads

Add Armor Traits for Modifications

Rendman opened this issue ยท 4 comments

commented

Hello,

Sorry for the support request via issue, but I'm having some difficulty adding a trait to modify armor pieces. Maybe I'm not understanding the requirements correctly.

I'm trying to add a trait that can be applied to armor pieces (not added to materials.) So, in the case below I would want to create custom behavior when a torch is added to an armor piece:

#loader contenttweaker
#modloaded tconstruct contenttweaker conarm

import mods.contenttweaker.conarm.ArmorTrait;

val myTrait = mods.contenttweaker.conarm.ArmorTraitBuilder.create("kindlich_test");
myTrait.maxLevel = 100;
myTrait.countPerLevel = 20;
myTrait.addItem(<item:minecraft:torch:0>);
myTrait.localizedName = "Rad Shielding";
myTrait.localizedDescription = "This is fun! Sadly, it doesn't do anything... \u2639";
myTrait.register();

This is the log file:
[PREINITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit]] [PREINITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [preinit] [PREINITIALIZATION][CLIENT][INFO] [preinit | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: NerdCraftPrequel.zs} as we are currently loading with a different loader [PREINITIALIZATION][CLIENT][INFO] Completed script loading in: 1ms [PREINITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit], [contenttweaker]] [PREINITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [contenttweaker] [PREINITIALIZATION][CLIENT][INFO] [contenttweaker | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: NerdCraftPrequel.zs} as we are currently loading with a different loader [PREINITIALIZATION][CLIENT][INFO] Completed script loading in: 1ms [INITIALIZATION][CLIENT][INFO] CraftTweaker: Building registry [INITIALIZATION][CLIENT][INFO] CraftTweaker: Successfully built item registry [INITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit], [contenttweaker], [recipeevent | crafttweaker]] [INITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [crafttweaker | recipeevent] [INITIALIZATION][CLIENT][INFO] [crafttweaker | SIDE_CLIENT]: Loading Script: {[0:crafttweaker]: NerdCraftPrequel.zs} [INITIALIZATION][CLIENT][INFO] Completed script loading in: 154ms [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:wyvern_shovel> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:draconic_shovel> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:wyvern_pick> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:draconic_pick> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:wyvern_sword> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:draconic_sword> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:wyvern_axe> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:draconic_axe> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:draconic_hoe> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:wyvern_bow> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <draconicevolution:draconic_bow> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <forestry:broken_bronze_shovel> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <forestry:bronze_shovel> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <forestry:kit_shovel> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <forestry:broken_bronze_pickaxe> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <forestry:bronze_pickaxe> [AVAILABLE][CLIENT][INFO] Hiding item in JEI: <forestry:kit_pickaxe>

What am I missing in order to get the trait registered and usable as a modifier for armor items?

Thanks

commented

There's actually a bug with this that will be fixed in the next update.

commented

Closed in 8dbafe9

commented

Hey, that worked great! Thanks!

One quick questions, is it possible to add an the trait to the in game book? I don't think I see any script methods to do so...

commented

I don't think so. While the traits work procedurally, the modifiers work a bit differently. It's rather hard-coded. I'm not sure it's even possible to implement a hook for it.