Freyqq Posted November 2, 2012 Share Posted November 2, 2012 So, I'm trying to make a potion in my mod cause an addiction. I created an addiction in the addiction category and made the potion have a 0.10 chance (10%) to cause that addiction. However, when I playtested it, I couldn't cause an addiction no matter how many of the potion I drank. This was on a new character that had no disease resistance. So, how do you make a potion have a % chance of causing an addiction? Thanks! Link to comment Share on other sites More sharing options...
steve40 Posted November 2, 2012 Share Posted November 2, 2012 I suspect that that feature is obsolete, left over from Fallout. Link to comment Share on other sites More sharing options...
JanusForbeare Posted November 2, 2012 Share Posted November 2, 2012 You could, however, use the RegisterForUpdate function and OnUpdate event to custom script an addiction. Link to comment Share on other sites More sharing options...
Freyqq Posted November 2, 2012 Author Share Posted November 2, 2012 You could, however, use the RegisterForUpdate function and OnUpdate event to custom script an addiction. Is there any documentation for how to do that? I'm still learning the creation kit. Thanks! Link to comment Share on other sites More sharing options...
JanusForbeare Posted November 2, 2012 Share Posted November 2, 2012 It would be a reasonably complex script, so I can't give you a full text. However, what I'd do is make a global variable (found under the Misc. tab in the object window) that has its value increased by 1 every time the addictive substance is used. I'd also add a RegisterForUpdate function every time the substance was used, and if it's not used again in, say, a 24 hour period (ie. the Global Variable has the same value as it did when the register occurred) have the global decrease by 1. When the global reaches a certain value (let's say 5), addiction occurs. This adds a new disease to the player ("addiction") which has detrimental effects. This would require a new global variable which increases for every day that the substance is not used and the addiction remains. The higher this second global increases, the more severe the effects of addiction become. ********** So in a nutshell, you have global A and global B. If global A reaches 5, its value is increased to, say, 10, and the addiction disease is acquired. For every day that the player doesn't "use", global A decreases by 1, and global B increases by 1 (making the withdrawl symptoms more severe). Once global A drops back below 5, the addiction is kicked, the disease is cured, and global B drops back to 0. I'm coming up with this on the fly. Obviously, it's just a basic framework. You'll want to tweak it to your particular tastes. Link to comment Share on other sites More sharing options...
Freyqq Posted November 4, 2012 Author Share Posted November 4, 2012 It would be a reasonably complex script, so I can't give you a full text. However, what I'd do is make a global variable (found under the Misc. tab in the object window) that has its value increased by 1 every time the addictive substance is used. I'd also add a RegisterForUpdate function every time the substance was used, and if it's not used again in, say, a 24 hour period (ie. the Global Variable has the same value as it did when the register occurred) have the global decrease by 1. When the global reaches a certain value (let's say 5), addiction occurs. This adds a new disease to the player ("addiction") which has detrimental effects. This would require a new global variable which increases for every day that the substance is not used and the addiction remains. The higher this second global increases, the more severe the effects of addiction become. ********** So in a nutshell, you have global A and global B. If global A reaches 5, its value is increased to, say, 10, and the addiction disease is acquired. For every day that the player doesn't "use", global A decreases by 1, and global B increases by 1 (making the withdrawl symptoms more severe). Once global A drops back below 5, the addiction is kicked, the disease is cured, and global B drops back to 0. I'm coming up with this on the fly. Obviously, it's just a basic framework. You'll want to tweak it to your particular tastes. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts