Crowley9 Posted June 22, 2017 Share Posted June 22, 2017 How might one go about making addictions and withdrawal symptoms pass with time? You can enter a duration for the withdrawal effects as with all Actor Effects, but that does not actuall seem to make addictions go away with time. The Chems Alcohol and Meds mod (http://www.nexusmods.com/newvegas/mods/50817/?) has this feature at least according to the changelog. I've tried digging through the mod with GECK and FNVedit, but I have been unable to locate whatever it is that makes the addictions pass with time. Now I'm thinking of scripts that are set to run in tandem with addictions that will remove the addiction once the timer in the script runs out. Also, I did try contacting the author of the mod directly, but got a message saying he is cannot receve message. If anyone is willing to inspect the mod and try to find how he did it, I would be very grateful. Link to comment Share on other sites More sharing options...
Mktavish Posted June 22, 2017 Share Posted June 22, 2017 Not sure , but I think you just need to flag the base effect with "Recover" after giving it the duration you want.For value modifier archetype at least ?And there is that "AddictionRemovalEffect" that runs a script , you can look at. Looks like a dispel all for doctor visits ? Link to comment Share on other sites More sharing options...
Crowley9 Posted June 23, 2017 Author Share Posted June 23, 2017 The only addiction-related effect that is not flagged with "Recover" seems to be "AddictionEFFECT" itself, and adding that flag doesn't seem to have any effect on it passing with time. According to the GECK documentation, the function of the flag is "When the effect expires, the attribute return to their previous state." Link to comment Share on other sites More sharing options...
Mktavish Posted June 23, 2017 Share Posted June 23, 2017 Well maybe all you need do is flag that one , since all addiction effects have that one in common. And give it a duration on the actor effect. Says it has "variable 10" for the assoc. item ... not sure what that does.But it may be keeping the other base effects from recovering. Also I think they will not recover without having a duration set.But for first test , just give the Addiction effect a duration. Mean time I'll see if I can figure out what that mod is doing to accomplish it. Link to comment Share on other sites More sharing options...
Mktavish Posted June 23, 2017 Share Posted June 23, 2017 Ok what they did was make 26 special base effects ... each with their own script They all start with this on their form-ID "patWithdrawalEnd" Then the script attached looks like this ... All start with "patWithdrawal" for script name. ========================================== SCN patWithdrawalAlcoholScript BEGIN ScriptEffectFinish player.dispel WithdrawalAlcoholEND ========================================== Then they add that base effect to the Actor Effect/Addiction , and give it the duration.And since they didn't fill in a name , it appears blank in the list on that screen except the duration and other columns. If you can get it to recover , by flagging the Addiction Effect / giving it a duration ... and possibly having to give the other base effects the same duration. I would still try that first , since it will be less work. Hope that helps Link to comment Share on other sites More sharing options...
Crowley9 Posted June 23, 2017 Author Share Posted June 23, 2017 (edited) Oh duh, I just realized I had been exploring the base Version 9 of the mod, not the updated Version 9. Well, this clears things up. Looks like I was right about using a script that will remove the addiction when its timer runs out. Sorry about being so dense, but thank you for your help! Edited June 23, 2017 by Crowley9 Link to comment Share on other sites More sharing options...
Mktavish Posted June 23, 2017 Share Posted June 23, 2017 Glad you got it ;) Link to comment Share on other sites More sharing options...
Crowley9 Posted June 23, 2017 Author Share Posted June 23, 2017 For some reason I simply can't get this to work. The script saves fine, and I've also tried "RemoveSpell" in place of "Dispel", but nothing works. I've also tried various values for how long it should take until the addiction is removed. I'll attach my .esp here, in case anyone wants to take a look at it. The only required master file is the main New Vegas one, and I've only tried changing alcohol addiction. The script and base effect are titled "newWithdrawalAlcoholScript" and "newWithdrawalAlcoholEnd", and the duration of the addiction is currently set to ten minutes (real time, I think). Link to comment Share on other sites More sharing options...
Mktavish Posted June 24, 2017 Share Posted June 24, 2017 (edited) Hmmm , not sure what up with that. Maybe there is another piece to the puzzle in their mod.But maybe their mod was never confirmed working ... because their method does appear to be an old method used with the creation kit before Fo3 ... and certainly FNV maybe doing something quite different with addiction effects. I checked my method mentioned too ... doesn't work either. But maybe you can insert something in this vanilla script which handles all the addictions. =====================================ScriptName GenericScript ; All generic game functionality goes here. Short HereAndNowXPShort Addicted Begin GameModeSet Addicted to 0If Player.HasMagicEffect AddictRedAGAlcohol == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedAGJet == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedAGMorphine == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedAGPsycho == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedAGSteady == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedAGTurbo == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedENBuffout == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedCHQuantum == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedCHRebound == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedCHTobacco == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedENHydra == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedPEMentats == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedSTAntNectar == 1Set Addicted to 1Elseif Player.HasMagicEffect AddictRedCHQuantum == 1Set Addicted to 1EndIf If Player.HasMagicEffect Concussion == 0Player.CastImmediateOnSelf PlayerConcussedEndIfEnd========================================= Edited June 24, 2017 by Mktavish Link to comment Share on other sites More sharing options...
Crowley9 Posted June 24, 2017 Author Share Posted June 24, 2017 (edited) I tried to see if I could make this work by adding the script to the addiction Actor Effect, and instead of determining the duration there, I would instead have the timer there, it would be handled in the script. Like this: SCN newWithdrawalAlcoholScriptfloat timerfloat fQuestDelayTimeBEGIN ScriptEffectStart set fQuestDelayTime to 1 if ( timer < 60 ) set timer to timer + getSecondsPassed else Player.Dispel WithdrawalAlcohol endifEND However, this doesn't seem to work either. Please do point out if I made a mistake. So, my next idea is to hook the script to the effects of using the chem (or alcohol) itself. Will report how it goes! edit: Well, adding another effect to the chem that lasts longer than the other effects doesn't really have the intended outcome, as the addiction doesn't start applying until all effects have gone. I thought it might not work that way since chems also have the Usage Monitor function attached to them with much longer duration than other effects, but I guess that one is an exception. more edit: I also tested if running a script on an addiction effect works if it is set to run at the beginning of the script, and that does work. This combined with the above got me theorizing of a roundabout mechanism that might work: I set a script to run at the beginning of addiction which activates another actor effect (or something similar that works), which on it has a base effect with a set duration which in turn has the script to remove the addiction set to run when that script ends. the return of the edit IN SPACE: Okay, I finally got this thing to work in a slightly messy fashion. At the beginning of the addiction it runs a script that uses CastImmediateOnSelf to apply an Actor Effect that has an effect with a duration which in turn is set to run a script at the end of it which cures the addiction. Now that I have this sussed out, the rest is grunt work. Edited June 24, 2017 by Crowley9 Link to comment Share on other sites More sharing options...
Recommended Posts