trashgarbage666 Posted February 3, 2019 Share Posted February 3, 2019 I feel like this is a really complicated issue to explain, so I'll try my best -- just bear with me! I'm making drug effects more intricate, hopefully in a way that is interesting and fun. I'll explain my overall idea and how it works before getting into the issue I'm having. Hopefully that'll make this more comprehensible. How it works: Let's say, for the sake of example, the player takes some Jet. One of the first things the drug does is fire off a base effect script that checks if the player is currently under the effects of a "Jet Dose 1" spell. If she is, then it casts "Jet Dose 2" on her instead. Or "Jet Dose 3". Once that's done, the Jet has three separate "AP +10" effects, one that turns on if the player has Jet Dose 3, another than turns on for Jet Dose 2, and the last one is the base effect, so it's always on. So, as the player takes more and more Jet, the benefits start to stack up. However, right as the drug is wearing off, it casts a spell on the player that is equally as bad as the previous benefits. A drug comedown. This comedown spell pretty much operates the same way as the Jet itself. It checks for Jet Dose spells, and activates additional negative effects based on how high the player's dose was. As the comedown finishes, it dispels the Jet Dose spells, leaving the player to take more Jet and begin the process all over again. The problem I'm having: So one important thing to mention is that I have the TimeScale set to 12. (My mod uses JIP NVSE, which takes care of the bugs that used to arise whenever you tampered with this setting.) At TimeScale 12, 5 minutes in real life translates to 1 hour in-game. I use that as a benchmark to decide how long a drug's comedown should be. For realism's sake, I wanted the player to slowly get better over time, instead of getting better all at once. The way I accomplished that was like this: In the comedown spell...The base penalty effect last for 20 real life minutes (the whole duration of the spell)The penalty that checks for "Jet Dose 2" lasts 15 minutesThe penalty that checks for "Jet Dose 3" lasts 10 minutes So, if you took three doses of Jet, the worst of the comedown should be over in two hours, and slowly get better each hour after that until it goes away completely. However, when I use Wait to speed up time, it eats the first in-game hour of my spell! But if I wait it out in real time, this doesn't happen. Kind of frustrating, to say the least! So I slowly went through and debugged each part of this process until I found the problem, and while I did find ...something, I haven't quite fixed the problem, and I'm still very confused. In the GECK, each drug has its own dedicated base effect for raising and lowering stats. They're named things like "ChemIncAGJet", "ChemIncCHAlcohol", "AddictRedENBuffout", etc. I had no idea why these things existed, so I didn't use them. Instead, I used the generic "IncreaseCharisma" and "ReduceStrength" type of base effects. But then I thought maybe the reason they exist is to prevent a conflict of some sort. So I made some stat raising / lowering base effects of my own to cut down on any potential conflicts, and suddenly Wait stopped eating the first 5 minutes of my Jet comedown spell! I assumed the problem was over, so I started working on more drugs. The first one worked as intended, but the one after that didn't. What was interesting to me is that this comedown spell negatively affected three different stats, and the first two stats were fine, and only the third one was getting shortened by an hour. God, this post is so long. Anyways, I'm hoping someone might know what the deal is with the separate base effects they made for drugs, and why they're behaving so strangely. Any information at all would be helpful. Thank you for taking the time to read this behemoth of a post. If I was too vague about anything, feel free to ask, and I'll clarify! Link to comment Share on other sites More sharing options...
Mktavish Posted February 3, 2019 Share Posted February 3, 2019 What is not clear to me at least ... did you disable the addiction chance and effect from vanilla? Cuz it sounds like you did not take that into consideration letting things just do what they will do.Hence you didn't take full control of the situation. Also a point I see as a problem ... when the successive levels of intoxication are cast as a completely separate spell. You did not dispel the preceding one ... thereby letting the engine do it's own thing for how it might stack things. Instead of you taking control for what a stacked chem would yield. Which is the whole reason you would create chem1 , chem2 , chem3 effect separately in the first place. So the good news is you have that sub structure in place already ... at least from my first impression understanding. We be needing some more clarification here ... hopefully this will help you to distill that clarification down some more :wink: Link to comment Share on other sites More sharing options...
trashgarbage666 Posted February 3, 2019 Author Share Posted February 3, 2019 What is not clear to me at least ... did you disable the addiction chance and effect from vanilla? Cuz it sounds like you did not take that into consideration letting things just do what they will do.Hence you didn't take full control of the situation. Why would you assume I didn't have a plan on how to handle vanilla withdrawal? My goal isn't to make a new addiction system, just to add to the existing one. People can experience drug comedowns even when they aren't addicted. Also a point I see as a problem ... when the successive levels of intoxication are cast as a completely separate spell. You did not dispel the preceding one ... thereby letting the engine do it's own thing for how it might stack things. Instead of you taking control for what a stacked chem would yield. Which is the whole reason you would create chem1 , chem2 , chem3 effect separately in the first place. So the good news is you have that sub structure in place already ... at least from my first impression understanding. We be needing some more clarification here ... hopefully this will help you to distill that clarification down some more :wink: It's not necessary to dispel the previous drug dose spells, and I'm almost certain this isn't the cause of the problem. The engine doesn't actually "stack" spells, anyway. It sees them as completely separate entities. It's just a basic "If none, then A. If A, then B. If A and B, then C." where A, B, and C could be any spell. Water breathing, slow fall, etc., and the engine wouldn't be stacking those either. I only named and numbered the drug dose spells that way for my own sanity. But the real meat of my original question was why do the "ChemIncCHAJet" type base effects behave differently than the generic "IncreaseCharisma" type base effects? Right now, my Jet comedown spell is identical to the Buffout comedown spell. When I'm coming down off of Jet, if I use Wait to speed time up, it works fine. But if I'm coming down off of Buffout, it cuts the spell duration off by one hour. Anyways, I'm gonna go play some WoW for a little while and hopefully come back to this with a fresh pair of eyes. Stepping back for a few hours helps sometimes. If need be, I'll post a full detail explanation of my drug effects, and maybe you guys can help me dissect it! Oh, also!! Mktavish! Remember when you were helping me with that headshot script forever ago? This is part of the same mod, haha. It's gotten huge, but it's so much fun now. I'm a lot more handy with the GECK these days, but, as evident by this thread, I obviously still hit the occasional road bump. Anyways, when I do eventually release this thing, I'll be sure to let you know. Your replies have helped a lot over the years, (yes, years.) so I figured the least I could do is put you in the Special Thanks or... something! Link to comment Share on other sites More sharing options...
Mktavish Posted February 3, 2019 Share Posted February 3, 2019 To answer this question specifically ... "But the real meat of my original question was why do the "ChemIncCHAJet" type base effects behave differently than the generic "IncreaseCharisma" type base effects?" One uses a consumable , the other an Actor effect ... for the intermediate delivery into game play. And imo , it's just common sense they would behave differently ... at least with the seems to me method. Since that is all I can use at this present juncture without being able to dissect it in the geck ... :geek: Hence my view of common sense probably isn't very good.But sorry for assumptions on what finer details you may have been or not keeping track of. It was just my seems to me method :ermm: That is awesome you are still working on this mod :thumbsup:Has it really been years :huh: ... sheesh , where does the time go ? But Oy~Veh WOW ??? Not me , I occasionally still play Eq2 just to flex my Warden prowess once in awhile. But should be noted ... I was a warden before wardens became so popular.I don't care about that fancy fairy in luv with nature thing ... since I am a big tuff barbarian warden anyways. And will always be from Freeport ... not Kweeenose with that bunch of goody two shoes that make you wana puke :sick: Hehe LOL ... just joking in case you are on about that goody side stuff :laugh: Link to comment Share on other sites More sharing options...
dubiousintent Posted February 4, 2019 Share Posted February 4, 2019 Trying to analyze your problem, and a couple of questions arise. 1. Are you "chaining" the scripts for each "comedown" script off the previous one (i.e. "Script ComeDown3" calls "Script Comedown2" as the last thing it does, repeat as needed; and if so in what type of block), or trying to use a single script to control the timing of the entire process? 2. When are you switching the timescale to "12" (before the script, at the beginning of each script, or some other time)? Is that as part of the "base effect" or "object script"? 3. Are your switching the timescale back to default (i.e. "30") at any time during the entire "comedown" process or series of scripts? I am assuming you are only having this problem in the "comedown" phase and not during the delivery or effect stage of the drug interaction with the character. -Dubious- Link to comment Share on other sites More sharing options...
trashgarbage666 Posted February 5, 2019 Author Share Posted February 5, 2019 (edited) Trying to analyze your problem, and a couple of questions arise. 1. Are you "chaining" the scripts for each "comedown" script off the previous one (i.e. "Script ComeDown3" calls "Script Comedown2" as the last thing it does, repeat as needed; and if so in what type of block), or trying to use a single script to control the timing of the entire process? I'll do my best to describe them without just dumping the scripts themselves and having you sift through them, haha. These are used inside the drug / ingestible:DrugDoseJet - A base effect + script, it has no duration and uses the ScriptEffectFinish block, meaning it fires the moment the drug is used. This is the script that checks which drug dose spells the player has, and casts the next appropriate one.DrugComedownJetStart - A base effect + script, its duration lasts as long as the drug itself and uses the ScriptEffectFinish block, so it fires right as the drug is wearing off. All this does is cast the comedown spell on the user. This is used inside the drug comedown spell:DrugComedownJetFinish - Another base effect + script, its duration lasts as long as the comedown spell, all this does is dispel the three drug dose spells. 2. When are you switching the timescale to "12" (before the script, at the beginning of each script, or some other time)? Is that as part of the "base effect" or "object script"? 3. Are your switching the timescale back to default (i.e. "30") at any time during the entire "comedown" process or series of scripts? I just changed the value of the global var in GECK, so it's taking place before the game even begins. I am assuming you are only having this problem in the "comedown" phase and not during the delivery or effect stage of the drug interaction with the character. Yep, everything's firing correctly. If I let it all play out in real time, there aren't any problems. Only when I jump ahead in time does it cut off the first hour of the comedown spell. And even then, it's only when using certain stat altering base effects. All things considered, it isn't a gamebreaking bug, but a lot of what I do builds off of existing work I've done. I feel like, if I knowingly leave even one bug in, one day the whole thing might come down like a house of cards. It's part paranoia and part pride. But Oy~Veh WOW ??? Not me , I occasionally still play Eq2 just to flex my Warden prowess once in awhile. But should be noted ... I was a warden before wardens became so popular.I don't care about that fancy fairy in luv with nature thing ... since I am a big tuff barbarian warden anyways. And will always be from Freeport ... not Kweeenose with that bunch of goody two shoes that make you wana puke :sick: Hehe LOL ... just joking in case you are on about that goody side stuff :laugh: Aw man, I really miss EverQuest. The original, I mean. Never got around to playing EQ2. I started playing right after the Kunark expansion. I just googled it and, oh my god, that was almost 20 years ago. Barf. Back then, the idea of sharing a communal 3D space with other people was so novel to me that I rarely played the game the way you're supposed to. I mainly used it as a 3D chat room where you sometimes fight monsters. Edited February 5, 2019 by punchbattle Link to comment Share on other sites More sharing options...
trashgarbage666 Posted February 5, 2019 Author Share Posted February 5, 2019 (edited) EDIT: originally made this post to say "a-ha!! I fixed it!" but it was a false alarm. Edited February 5, 2019 by punchbattle Link to comment Share on other sites More sharing options...
dubiousintent Posted February 6, 2019 Share Posted February 6, 2019 I think you are still onto something regarding the "Wait" function. Looking at that function page:Works only if PackageID is the actor's current package, and if the current package is a Follow or Accompany package.The "StopWaiting" function similarly says:Tells an actor to resume normal package behavior after being put into a "wait" state by the Wait command.The "PackageID" is a requirement in both cases. The UI "Wait/Sleep" command presumably is using those functions as well. Which makes me wonder if perhaps you need to specify a "Follow or Accompany package" while your effects are in play so the "Wait" command functions properly. (That function seems to be the core of the problem.) You might also need to insert an "IsWaiting" check. -Dubious- Link to comment Share on other sites More sharing options...
trashgarbage666 Posted February 6, 2019 Author Share Posted February 6, 2019 I think you are still onto something regarding the "Wait" function. Looking at that function page:Works only if PackageID is the actor's current package, and if the current package is a Follow or Accompany package.The "StopWaiting" function similarly says:Tells an actor to resume normal package behavior after being put into a "wait" state by the Wait command.The "PackageID" is a requirement in both cases. The UI "Wait/Sleep" command presumably is using those functions as well. Which makes me wonder if perhaps you need to specify a "Follow or Accompany package" while your effects are in play so the "Wait" command functions properly. (That function seems to be the core of the problem.) You might also need to insert an "IsWaiting" check. -Dubious- I wanted to give this a shot, so I took the script that was being negatively affected by Waiting, and wrote this to test the waters: If (Player.IsWaiting == 0); PrintToConsole "Waiting? No" ElseIf (Player.IsWaiting == 1); PrintToConsole "Waiting? Yes" EndIf; It returned a "No" every time. Then I skimmed the Wait, IsWaiting, and StopWaiting articles, and based on the language they use to describe their functions, I feel like these are for the Companion Wheel's "Stay" command, and not the actual Wait. I could be wrong, though! That's a total guess! I didn't prod any further with it, though, because this time I actually did find a workaround for my problem! Instead of telling the ingestible to cast a spell on the player at the end of its timer and hoping the Wait feature doesn't mess anything up, I thought maybe I could have the ingesitble cast the spell at the same time the ingestible is being used, that way Wait can't possibly interfere. Then I made all the effects within the comedown spell last longer than the ingestible, and have the condition that the ingestible can't be active. So when the drug wears off, the comedown spell's effects would suddenly turn on. And guess what, it worked!! I've tested it from every angle I can think of, and the results seem air-tight to me! I guess the takeaway here is to try to avoid any automated, ingestible-based casting on the player if the player has the freedom to Wait at any point during that ingesitble's duration ...? I have no idea. Either way, we solved another one, haha. Link to comment Share on other sites More sharing options...
dubiousintent Posted February 6, 2019 Share Posted February 6, 2019 Congrats! That is an interesting bit of information to have learned. I'll be working it into the "Guide". -Dubious- Link to comment Share on other sites More sharing options...
Recommended Posts