Marikhen Posted July 18, 2016 Share Posted July 18, 2016 I just started monkeying around with the Creation Kit about 14-16 hours ago, and everything I've seen dealing with scripting revolves around creating new scripts. I haven't really found anything on modifying Bethesda's scripts with an eye towards compatibility either. Unfortunately tutorial type stuff tends to make my brain try to crawl out of my eye sockets while diving into the deep end and getting into the code tends to work out better in the long run for me. I'm digging around in the Survival/HC_ManagerScript file to effect some changes that I quite frankly can't figure out another way to do as they involve disease states and all I can find in the rest of the Creation Kit that relates to what I'm doing are the risk keywords associated with various consumables. I've got the basic idea working and ironed out, but I don't like that I'm doing it by editing the entire HC_ManagerScript, recompiling it, and so on. Is there a better way of doing this such as setting up a smaller script/file containing modified default functions and additional variables, packaging it in with the hardcore/Survival quest, and having it override the relevant portions of the default script, and if so what would be the best way of going about it? Link to comment Share on other sites More sharing options...
Reneer Posted July 18, 2016 Share Posted July 18, 2016 It would be better if you explained what you are trying to do, overall. Directly editing the base scripts is generally not the way to go about things unless you are absolutely certain that that is the only way to do something. And even then it really isn't the greatest idea. Link to comment Share on other sites More sharing options...
Marikhen Posted July 18, 2016 Author Share Posted July 18, 2016 Overall I'm upgrading the Lead Belly perk and the hazmat suit armor. Outside of the scripting I've got Lead Belly condensed so that rank 1 offers more reduction for ingested radiation than the old rank 1, though not as much as rank 2, while rank 2 now offers immunity. Rank three allows for increased HP recovery from various foodstuffs similar to how PerkMagWastelandSurvival01 is utilized. I'm still debating whether to only modify the irradiated foods to offer more healing or have it apply to all foods. The hazmat suit was much smaller in scope in that I simply wanted it to function underwater as it appeared it ought to. It has air tanks and looks waterproof, and in fact I'm fairly certain I saw something in the Creation Kit indicating that it's air-tight based on gas protection. Adding a waterbreathing effect to the suit was simple enough and also didn't require tinkering with a script. Changing things so that Lead Belly reduces the effect what you eat/drink has on your chances of contracting a disease and eliminating that aspect from swimming in a presumably water-tight hazmat suit, however, seems to be something that can only be done in the script as the associated values are constants defined in the script. What I want to do, however, is get each one of those set up in individual mods with just the necessary scripting and not the entire HC_ManagerScript and, hopefully, to not have to have a third script with both sets of changes merged in the event both mods are run at the same time. Link to comment Share on other sites More sharing options...
exploiteddna Posted July 18, 2016 Share Posted July 18, 2016 I agree with what Reneer said, you don't really want to edit the vanilla scripts.. especially as a beginner. In fact, I'd say editing vanilla scripts should be strictly off limits unless you are very seasoned at both scripting and modding, you have a really good reason, and you're unable to accomplish your goal by using a separate script (or doing so would be overly complicated). Link to comment Share on other sites More sharing options...
PoliteRaider Posted July 19, 2016 Share Posted July 19, 2016 Perhaps rather than having your perk and script act on the disease factors in the HC Manager script directly, they could instead act on the food items to affect whether they have the relevant keywords. Link to comment Share on other sites More sharing options...
Marikhen Posted July 19, 2016 Author Share Posted July 19, 2016 I agree with what Reneer said, you don't really want to edit the vanilla scripts.. especially as a beginner. In fact, I'd say editing vanilla scripts should be strictly off limits unless you are very seasoned at both scripting and modding, you have a really good reason, and you're unable to accomplish your goal by using a separate script (or doing so would be overly complicated). I've been doing this sort of thing off and on for 20 odd years now, and I hope that I have enough experience to have a fairly decent appreciation for the risks involved with this sort of behavior. If I were intending on making my work available to the public I would fully agree with attempts to caution me against editing the scripts in this fashion even if there seems to be zero chance of them breaking anything, but this is for my own personal use so warnings not to do it aren't going to change my mind. I'm perfectly willing to listen to suggestions on ways to achieve my goals in a safer, easier, and/or more compatible fashion such as PoliteRaider's suggestion on altering the keywords, something that never occurred to me could be done with the game running, but I'd much rather have suggestions on my original concern rather than cautions to not do what I'm doing at all. Just to be clear, or at least as clear as I can be, I'm trying to find out whether or not the engine supports "outsourcing" specific portions of one script to another so that you can have the modifications to the script in a file separate from the original script thereby allowing multiple mods to alter separate portions of the original script without directly interfering with one another. If the engine can't handle that and thus requires that multiple mods that edit a given script have those edited portions merged into a single script then so be it, but I really would like to know if that's the case regardless of what it means for what I'm trying to do at the moment. Perhaps rather than having your perk and script act on the disease factors in the HC Manager script directly, they could instead act on the food items to affect whether they have the relevant keywords. I'm perfectly willing to go that route with regards to Lead Belly if it's possible, and if you, or anyone else for that matter, have suggestions on how to accomplish that I'd be interested in hearing them. I'm not sure that "waterproofing" the hazmat suit would be that easy though. Event Actor.OnPlayerSwimming(Actor akSender) float GameDaysPassed = Utility.GetCurrentGameTime() if NextSwimEventAllowed <= GameDaysPassed trace(self, "Actor.OnPlayerSwimming() and NextSwimEventAllowed <= GameDaysPassed. Will call HandleDiseaseRiskEvent()") HandleDiseaseRiskEvent(DiseaseRiskSwimmingAmount) NextSwimEventAllowed = GameDaysPassed + GameDaysPerSwimmingEvent endif EndEventI don't see anything there that checks something external to the script which can be changed in a fashion that alters how the script functions, at least not short of figuring out some way of making you not swim while underwater and wearing a hazmat suit. Given that the idea is for a bit more realism having you "fly" or whatever while underwater might be problematic. :laugh: Link to comment Share on other sites More sharing options...
Recommended Posts