tModLoader Intrinsics - Bind equipment and buffs to players permanently

trying to use mining potion and builder potion. i tried to use The Ring(literally The Ring) from thorium first None of them have worked so far.
[doublepost=1560748584,1560748520][/doublepost]Would you rather discuss in something like discord? it should be faster.
Well, if the mining potion or builder potion didn't work, let me know. Might need to add support for modded items a bit, now that you mention this.
 
Trying, as in, they didn't work. Sorry, i was a little misleading
Alright, if you want to chat I usually hang out on the tModLoader or Terraria discords (same user name). There's a few things I could have you try when you're available, if you don't mind.
 
I am very happy with your changes so far

Is it possible you could add an alternate form of getting contract tatters such as having them spread across the world in most chest types, having them as part of crates & pots, random chance upon every enemy death, etc instead of having it be tied to a mostly static list on the random NPC? I'd be nice to be able to encounter them naturally as part of a playthrough.

BTW the "intrinsic-create-contract" command doesn't work for items with spaces in their names (even the suggested /intrinsic-create-contract "Solar Wings" "Frostspark Boots"), Not that I need this command but yeah...
upload_2019-6-19_18-11-38.png

Silently Caught Exception: Index was outside the bounds of the array. at HamstarHelpers.Helpers.TmlHelpers.CommandsHelpers.CommandsHelpers.GetQuotedStringFromArgsAt(String[] args, Int32 startPos, Int32& nextArgIdx) at Terraria.ModLoader.ModCompile.<>c.<ActivateExceptionReporting>b__15_0(Object sender, FirstChanceExceptionEventArgs exceptionArgs)
at HamstarHelpers.Helpers.TmlHelpers.CommandsHelpers.CommandsHelpers.GetQuotedStringFromArgsAt(String[] args, Int32 startPos, Int32& nextArgIdx)
at Intrinsics.Commands.CreateContractCommand.Action(CommandCaller caller, String input, String[] args)
at Terraria.ModLoader.CommandManager.HandleCommand(String input, CommandCaller caller)
at Terraria.Main.DoUpdate_HandleChat()
at Terraria.Main.DoUpdate(GameTime gameTime)
at Terraria.Main.Update(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)
at Terraria.WindowsLaunch.Main(String[] args)​
[doublepost=1560932355,1560932180][/doublepost]Having them inherently and finitely tied to the world could be a cool concept because they're permanent on the character, so it could be that one character has to seek out multiple worlds in order to get permanently stronger...
(That being said I'd definitely prefer it being a rare component of every mob drop, or individual blank contracts from travelling merchant, to other ways of obtaining it)
[doublepost=1560932588][/doublepost]BTW "The Ring" from thorium definitely works for me
 
It's probably totally unreasonable because of the algorithmic complexity of checking for full sets or even multiplicities of sets among intrinsics, but I wonder if set bonuses on intrinsic'd armour could be made to work somehow?
 
It's probably totally unreasonable because of the algorithmic complexity of checking for full sets or even multiplicities of sets among intrinsics, but I wonder if set bonuses on intrinsic'd armour could be made to work somehow?
It would take a bit of work, but I can see a way to do it. However, I don't have that kind of time, uncompensated.

Tell me if v1.0.0 solves those command errors.
 
Tell me if v1.0.0 solves those command errors.

Yes, it does solve the errors. Can be used to add multiple intrinsics at once and it all functions as expected.
/intrinsic-create-contract "Solar Wings" "Frostspark Boots"

It also lets me add items that otherwise don't make sense as intrinsics (end up having no effect and aren't visible in the intrinsics list and are not added to a contract when used on a blank contract) such as "Purified Jam" from calamity.
/intrinsic-create-contract "Purified Jam"
 
In the intrinsics display, Consumables with icon animations appear as their spritesheet rather than as animated sprites

upload_2019-6-25_21-25-41.png


Here, "Sadism" from Fargo's Souls has an animated icon with 3 sprites, which occludes the sprite of "Bloodbath Potion" from GRealm
 
Idea: Use something similar to "Ultimate Buffs" from Luiafk to prevent the use of a buff slot by consumable intrinsics allowing for more concurrently active consumable intrinsics.

I don't know the inner workings of how "Ultimate Buffs" works but it does seem to prevent the buff that it induces from being added to the player as a buff slot thus freeing up buff slots, it might be incredibly hardcoded but it might not be too hard to generalise.

I haven't yet encountered a situation where I need all 20 buff slots to be used by intrinsics, but I can certainly see it might be a problem. I know what happens when you have too many buffs that are also continuously being added by an accessory or tile (visual spam and the effects getting toggled rapidly)

It's also possible that some mods may rely on the buff itself being present in the buff slots for other effects to work, maybe there can be a setting on every consumable intrinsic to swap between using a buff slot or not.
[doublepost=1561463435,1561463229][/doublepost]Question: There are items from mods that have effects when in your inventory only, can these be made into intrinsics?

Examples: PDA (and its components), the boss token things from Calamity, "Money Collector" from Luiafk, "Ultimate Buffs" from Luiafk

I imagine these are not of standard make so would be very hard to implement in general. A solution may be to create a hidden virtual inventory like that from your inventory mod, but it needs to always be active (swapping inventories changes the active inventory which prevents things of this kind from being active)
 
Offhand, I don't know how I can remove buffs without interjecting code specific to each buff. Might be doable, but it's lots of work, and since intrinsics are now toggleable, also a low priority.

I'd like to eventually fix things like passive or informational items, but since these use inventory slots instead of equip slots, they're also a lower priority.

v1.0.0.1 should fix the item animations, by the way. Tell me if it doesn't.
 
Last edited:
Intrinsics are functionally not togglable because they are all activated every time the character is loaded, forgot to mention that.
[doublepost=1561475502,1561475384][/doublepost]Also toggling doesn't solve the problem of if you wanted more than 16 consumable intrinsics at once (4 buffs typically always taken up by banners, pet, light pet, and summon)
[doublepost=1561475815][/doublepost]v1.0.0.1 does fix the lack of animation, but it is rescaled for the size of the spritesheet, not the size of the animated sprite.

upload_2019-6-26_1-16-20.png


Can be seen here that "Sadism" sprite is absolutely tiny, ~1/3 the size it should be, which corresponds to the 3 sprites in the spritesheet.
 
Last edited:
Intrinsics are functionally not togglable because they are all activated every time the character is loaded, forgot to mention that.
[doublepost=1561475502,1561475384][/doublepost]Also toggling doesn't solve the problem of if you wanted more than 16 consumable intrinsics at once (4 buffs typically always taken up by banners, pet, light pet, and summon)
[doublepost=1561475815][/doublepost]v1.0.0.1 does fix the lack of animation, but it is rescaled for the size of the spritesheet, not the size of the animated sprite.

View attachment 223300

Can be seen here that "Sadism" sprite is absolutely tiny, ~1/3 the size it should be, which corresponds to the 3 sprites in the spritesheet.
Ah, thanks for noting that. I'll patch that soon.

It's technically complicated to implement buff-less buffs, so it might take me some doing. Wish I had more time on my hands.
 
How do you remove intrinsics for items that don't have unique names?
I'm guessing I have to find the unique code name for the item, but, I don't know how to do that.

20190626211755_1.jpg
20190626211756_1.jpg

I added the green bottled fairy as an intrinsic without knowing that there was another bottled fairy item
Now I wish to remove it cus the buff is interfering with other buffs (too many buffs, 5% damage is not important)

The removal command doesn't work because the blue Bottled Fairy is the item it is removing, rather than the green Bottled Fairy.
Solution could be to have the command search among only current intrinsics and remove the first match or remove every match.

I'll just leave it how it is for now and manually disable it using the toggle, each session. It's not a big deal.
It won't be an issue once toggled intrinsics become persistent.
 
How do you remove intrinsics for items that don't have unique names?
I'm guessing I have to find the unique code name for the item, but, I don't know how to do that.
For vanilla (base terraria) items, the parameter is "Terraria.123", where 123 is the item id (meteor helmet). For modded items, you'll have to find the mod's internal name, and the modded item's class name, then the format is "<ModInternalName>.<ModdedItemClassName>" (e.g. Stamina.EnergyPotionItem). I don't know how to do that offhand without looking at source code, so I may need to add a function for that.
 
can't seem to create contracts for calamity accessories, I drop the item on the contract but it only picks up the contract
 
Ok found the issue. It apparently doesn't like it if you have autopause enabled, turned it off and it works perfectly with mod and regular items.
 
when I bind items to a contract, while the items dissappear and the contract changes texture as it should, when I use the contract it just dissappears and I don't have the buff I want, it this a common issue? when I hover my cursor over the contract, it says "this contract imparts instrinsics from the following items:" and then it doesn't list any items
 
when I bind items to a contract, while the items dissappear and the contract changes texture as it should, when I use the contract it just dissappears and I don't have the buff I want, it this a common issue? when I hover my cursor over the contract, it says "this contract imparts instrinsics from the following items:" and then it doesn't list any items
Could you try this, and tell me if you're getting any error log outputs? You can find the error logs in Documents/My Games/Terraria/ModLoader/Logs
 
Back
Top Bottom