velor Posted July 17, 2023 Posted July 17, 2023 I am working on a mod that handles an infection that spreads like an std. However one issue I am running into is how to keep things moving for it without the player being in proximity since the animations (and their events) need the models loaded. I have not worked with the AI behavior's at all, but I imagine there is a way to hook a script right? Check some conditions and send an event or something? Have not been very successful at finding anything to go on for it.
traison Posted July 17, 2023 Posted July 17, 2023 12 hours ago, velor said: how to keep things moving for it without the player being in proximity The entire foundation of videogames is based on illusion. Who can render the most convincing scenery, using the same resources as their competition. My point being, you will never be able to "keep everything loaded". You will also find that spells cast on actors will occasionally disappear as the actors get unloaded and/or reset. A workaround could be to track actors and their states with StorageUtils from PapyrusUtil. Cast as spell on all actors around you using SPID (or a custom cloak spell) and, have it check the stored actor data and restore the state of the spell. This way it will appear as if the entire world is loaded, but in reality, only the actors that matter (those close to the player) will be playing animations (or whatever). 12 hours ago, velor said: there is a way to hook a script right? Not in the traditional sense. 12 hours ago, velor said: Check some conditions and send an event or something? By editing an existing script and using ModEvent to send an event yes.
velor Posted July 17, 2023 Author Posted July 17, 2023 Yes I am not looking to trigger anything that is loaded. I know skyrim can read if an npc is maybe sleeping, or what location they are currently in right? Even if the player is not nearby. The Radiant AI system. I want to hook something in, like if the npc is sleeping, or at the tavern at a given time, and some stats are high enough, it "emulates" that they had sex or something and passes some events around, queuing whatever might be needed for the next time the NPC is loaded. Looking into some AI overhaul mods but not seeing much I can tie into yet.
wareware Posted July 17, 2023 Posted July 17, 2023 (edited) 13 hours ago, velor said: However one issue I am running into is how to keep things moving for it without the player being in proximity since the animations (and their events) need the models loaded. You would need to rethink your approach in that case. You cannot treat random NPCs the same way as the player. What you can do is make a quest and register the NPC as an alias in that quest when they get infected. That way they have some level of persistence. EDIT: Read your second post. The NPC schedule system uses packages to execute its "tricks". IIRC AI overhaul also has a bunch of scripted packages like NPCs running for cover when its raining. I guess you could create a custom package for infected NPCs. Edited July 17, 2023 by wareware
velor Posted July 17, 2023 Author Posted July 17, 2023 14 minutes ago, wareware said: You would need to rethink your approach in that case. You cannot treat random NPCs the same way as the player. What you can do is make a quest and register the NPC as an alias in that quest when they get infected. That way they have some level of persistence. EDIT: Read your second post. The NPC schedule system uses packages to execute its "tricks". IIRC AI overhaul also has a bunch of scripted packages like NPCs running for cover when its raining. I guess you could create a custom package for infected NPCs. Yea, so far it seems I need to apply any package to all npc's. Not sure if they can be dynamically applied? I will keep digging around though.
wareware Posted July 17, 2023 Posted July 17, 2023 (edited) If you're registering them in a quest you can apply the package to them through it. Look at how vanilla game does it with the College of Winterhold introduction quest where Tolfdir and the students are forced to move to the hall of elements through a package. Edited July 17, 2023 by wareware
velor Posted July 17, 2023 Author Posted July 17, 2023 19 minutes ago, wareware said: If you're registering them in a quest you can apply the package to them through it. Look at how vanilla game does it with the College of Winterhold introduction quest where Tolfdir and the students are forced to move to the hall of elements through a package. A direction ty
jib_buttkiss Posted July 18, 2023 Posted July 18, 2023 Since you're looking to potentially infect the entire game world, I'm not sure that you'll be able to register infected NPCs with a quest alias. As I understand it, aliases can't be dynamically created, only allocated, so you'd need to have quite a few to catch every single female NPC in the game. Also, aliased actors become persistently loaded, and you don't want to persistently load too many NPCs at once- there's a reason the game unloads them in the first place. Maybe someone can come in and say I'm wrong on that front? (I mean, I hope so- that logic is why I limit the number of currently-transforming bimbos in Bimbos of Skyrim and I'd love to un-cap that). I know that SL Eager NPCs has some kind of sex life simulation system, where all NPCs have a false "sex life" while unloaded. It then uses that to adjust their arousal levels for when you next see them. You could take a look into how it does it and use a similar system here maybe to decide who's infected? As for packages, you could use SPID to allocate them. I don't know how detailed SPID gets, but I think it only triggers once on game start? If so, you could have a condition on the package so that it doesn't run unless an NPC is tagged as infected (via a spell effect, faction, or whatever).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now