WASTED
"stuffed" and "medicated" context tags. How do consumables respect them?
I've already figured out the existence of the context tags, and that they are ultimately responsible for preventing certain items from being consumed/used while they are present. I am not sure if this is due to something like a condition present on all of the items that adds the item immediately after consuming it if the tags are present (a roundabout solution I thought up), or something else entirely.
Last edited by king bore haha; Jul 6, 2017 @ 8:20pm
< >
Showing 1-4 of 4 comments
Mr. Podunkian Jul 6, 2017 @ 9:00pm 
BaseItem has a field called usageRestrictions which is a list of ItemUseRestriction's, which prevents certain items from being used while certain context tags exist.

Your best bet at this point would probably be to copy them from another item, because IIRC they aren't exposed to the modding API yet. Beyond that, I think you're correct in thinking that there's a condition that gets added when the item is used (but like all things, I might not be remembering correctly, since it's been awhile since I've rooted around in the game's guts)
king bore haha Jul 6, 2017 @ 9:07pm 
Originally posted by Mr. Podunkian:
BaseItem has a field called usageRestrictions which is a list of ItemUseRestriction's, which prevents certain items from being used while certain context tags exist.

Your best bet at this point would probably be to copy them from another item, because IIRC they aren't exposed to the modding API yet. Beyond that, I think you're correct in thinking that there's a condition that gets added when the item is used (but like all things, I might not be remembering correctly, since it's been awhile since I've rooted around in the game's guts)

Ah, of course! I forgot all about usageRestrictions. Did a quick test, and copying over the usageRestrictions from an item for that respects the "stuffed" context tag (tater) blocked the consumption of the modded item. Perfect. I still have to create some sort of basic condition to grant/expire the context tag on a timer, but I was assuming that was the case anyway. Thanks again.
Last edited by king bore haha; Jul 6, 2017 @ 9:19pm
Mr. Podunkian Jul 7, 2017 @ 6:15pm 
You don't have to add your own conditions AFAIK. Just add a ConditionEffect that adds the "Medicated Condition" condition. In the assignable variables list (I think the last argument of the ConditionEffect constructor?), assign a value to the variable "MEDICATED_DURATION".

Similarly, "STUFFED_DURATION" for "Stuffed Condition"
king bore haha Jul 7, 2017 @ 6:27pm 
Ohh, ok. That's quite a bit simpler than what I was doing.

Tested both
consume.conditionEffects = { ConditionEffect.Create("Stuffed Condition",{BuffAttribute.Create("STUFFED_DURATION","10")}), ConditionEffect.Create("Medicated Condition", {BuffAttribute.Create("MEDICATED_DURATION","10")}), }
and they work perfectly. Thanks for letting me know.
Last edited by king bore haha; Jul 7, 2017 @ 6:28pm
< >
Showing 1-4 of 4 comments
Per page: 1530 50