Jump to content

Possible to add conditions to potion consumption?


Artemis0420

Recommended Posts

I am working on a mod that adds barbarian-centric healing items to the game. I would like to add conditional requirements to consuming some of the items (ex: can only be used when not in combat, or can only be used IN combat when under a certain health percentage, etc). I cannot seem to find a way to assign conditions to consuming the potion itself, only the magical effects individually. I assume there may be some script work involved but I would imaging these sort of checks would be able to utilize existing scripts instead of having to write new ones. Any suggestions?

Link to comment
Share on other sites

You can put conditions on the potions.If you scroll down to the bottom of the ingestible theres a conditions field.I once put the IsInCombat /comparison value zero/run on subject condition onto the healing potions so they wouldnt work when in combat- It worked.

 

 

If you use the MGEF then it will effect everything that uses it.Putting conditions on the potions confines it to just the potions that you want.

Edited by kryten397
Link to comment
Share on other sites

That sounds like exactly what I'm looking for. I had created the items under Magic > Potion > Potions > *potion in question* The window where you specify the magnitude/duration/effects etc doesn't seem to have a space to add conditions, I only see a space to add Keywords. Is there a different "ingestible" category in the object window that I am missing?

 

Thanks so much for your reply btw. At least I know it's doable if I can find the right place. :huh:

Link to comment
Share on other sites

I dont know how you cant find it or see it

 

Potion Window - - select field where duration/magnitude are listed
right click and select edit
Effect Item window --- Large area called Conditions
right click in that area and select new
Condition item window will appear where you can set up your conditions

If i wanted to put a condition on a Magic effect . I would go to Magic--Magic Effect and select for example AlchRestoreHealth.

 

For something like that its quicker to use SSEedit.By the time the creation kit loads up you could have aready done it. Potions are listed under Ingestibles which is different to the CK

Link to comment
Share on other sites

Ah I see, I knew I had seen an Ingestible category before but I guess I never noticed it was exclusive to SSEedit, in CK it's set up a bit differently as the Effect Conditions are more of a window within a window.

 

Sorry, for being unclear. I am trying alter the player's ability to actually consume the potion based on certain conditions. What you suggested is what I tried initially, but that only prevents the individual effects of the potion from being applied if the conditions aren't satisfied at the time of consumption. It does not prevent the player from being able to consume it. So if you accidentally use it while not in the right combat state/health percentage or whatever you just consume it with no effect. This gets frustrating as it's easy to waste a good potion by incorrectly guessing if your health bar is juuuuust above 30% or juuuust below 30% in the heat of battle, or thinking you're safely out of combat and waste a good bandage because you apparently aggro'd a nearby mudcrab. That is what I meant by seemingly only being able to apply conditions to the individual effects of the potion versus the actual act of consuming it.

Link to comment
Share on other sites

Ah ok.i misunderstood. Ive seen mods on here that auto consume potions when your health goes below a certain level but i cant remember their names.It would need a script constantty monitoring your health.

 

You would need to look at the scripts to see how its done.or contact the author and ask.

 

Good luck with your mod.

Link to comment
Share on other sites

Adding conditions to the potion effect wont prevent the potion being consumed, and only prevents the actual effect happening

 

For auto-usage you can have an ability on the player that listens for OnHit()

 

When hit, perform condition checks to use a potion, and perhaps delegate some of that workload to the CK - Kinda depends how you prefer to approach this, and yeah if there are templates out there def look those over. I imagine this is an in-demand concept

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...