prideslayer Posted February 1, 2012 Share Posted February 1, 2012 You modders with scanners, Loogie, Hal, and Prkr mainly, does this idea hold any interest for you? Â I'm thinking of implementing a generic scanner in sexout that could be hooked by all the mods that want scanning functionality. It would cut down on code maintenance by everyone, ensure all mods using scanners play nicely together (at least their scanning will!), and so on. Â My thought is to implement three different scanners initially. One for male NPCs, one for female, one for creatures, with a frequency of 1hz (once per second). Â Mods would register for notification the same way the global sex hook works. Create a formlist (or three) in your mod, and a spell, and add them all to new sexout formlists (SexoutScannerListsM, SexoutScannerListsF, SexoutScannerListsC, SexoutScannerSpells). Â Whenever the scanner runs, it will bulld an internal formlist for each of the three categories listed above and: - skip children - skip creatures that there is no animation for - ??? (ideas welcome) Â After the scanner runs, it will copy the formlists into the ones your mods provide, and then call your spells (on the player) to notify you that your form lists have been updated. Put protection inside your spell script to ensure it isn't run more than once -- it won't happen anyway to most people, but some (looking at you astymma!) run threading mods that allow many scripts to run at once. Â As with the other global hook, it will be up to you to clear out your formlists -- ideally in the StartEffect block. Â If this is something other modders think is a good idea, I'll put it on my list, implement it, and modify basic SexoutRapers to use it as a sort of demo. Â Â Link to comment
prideslayer Posted February 1, 2012 Author Share Posted February 1, 2012 It would be up to you to individually, in your spell as you loop through your form lists, to do faction checks and stuff like that. I will add features that make generic sense, but doing specific checks is beyond the scope, just FYI. Link to comment
Chase Roxand Posted February 1, 2012 Share Posted February 1, 2012 I'll certainly use it. Link to comment
iron_jack Posted February 1, 2012 Share Posted February 1, 2012 It sounds like it'd be mighty handy. Might cut out some of the leg work if/when I get around to adding rape functionality to the ferals in SS too. Â I've never worked with formlists so that part is a little intimidating, but that's my problem, not yours. Link to comment
prideslayer Posted February 1, 2012 Author Share Posted February 1, 2012 Formlists are easy. Look at sexoutnotify to see how they're used, this system will be much the same. Even if just the two of you use it, along with rapers, it's worth it. It's a "big win" if tryouts can switch to it as well -- every one of them has a scanner. Â If nothing else it'll cut down on CPU usage. They don't use a lot, but it can't be "good" having 15 different mods all running exactly the same scanner code constantly. Link to comment
Guest Loogie Posted February 1, 2012 Share Posted February 1, 2012 I'd look into using, I guess, though I'd have no idea how. Link to comment
Halstrom Posted February 1, 2012 Share Posted February 1, 2012 Sounds good, I'm also looking for some way to detect the start & end of sex events, ideally later I'd also like to be able to control the duration of the event. I'm thinking of creating an arousal/orgasm based plugin later so sex would look at the Lust built and preferences to determine orgasm occuring for raper/rapee, of course in the case of rape the raper wouldn't stop till they got to orgasm. Link to comment
prideslayer Posted February 1, 2012 Author Share Posted February 1, 2012 I'd look into using' date=' I guess, though I'd have no idea how. [/quote'] Â I could do the first one or two for you. Hell maybe I'll be bored and do them all. Â Sounds good' date=' I'm also looking for some way to detect the start & end of sex events[/quote'] Â Use the global hook for the start, that already exists. Notify and Crowds both use it. Detecting the end, right now, you have to watch for 00SexoutActor to vanish. Â , ideally later I'd also like to be able to control the duration of the event. I'm thinking of creating an arousal/orgasm based plugin later so sex would look at the Lust built and preferences to determine orgasm occuring for raper/rapee, of course in the case of rape the raper wouldn't stop till they got to orgasm. Â You can set the duration fairly long (like 5 minutes), and then abort it earlier if you need to. Link to comment
DoctaSax Posted February 1, 2012 Share Posted February 1, 2012 I'd look into using' date=' I guess, though I'd have no idea how. [/quote'] Â Yes. I'm all for it, not just because of CPU usage but it's simply nice to have some code ready-to-use if I ever decided to make something that has to use a scanner. The less people have to struggle with code because it's already available and optimized, the more they can focus on the gameplay/dialogue/immersion/quests side of things. But that would also require some easy-to-follow instructions for people like myself who aren't too quick on the uptake... (at the moment, I'm not even sure how to make people have sex ) Â Link to comment
prideslayer Posted February 1, 2012 Author Share Posted February 1, 2012 Docta, lots of instructions on how to use sexout are linked to in the first post in its thread, it's pretty easy.  Using the formlists will be.. easier than writing your own scanner, but not braindead easy. You'll need to.  1. Create three formlists. Easy clicking in the geck. 2. Create an init block in your mods main quest script, if it doesn't already have one (naughty naughty!) 3. Create a spell (this requires creating an effect script and a base effect). More geck clicking, except the script of course. 4. In the init block, add each formlist to the corresponding sexout formlist. ListAddForm SexoutScannerListsM MyScannedMales ListAddForm SexoutScannerListsF MyScannedFemales ListAddForm SexoutScannerListsC MyScannedCreatures 5. Add the spell you made to the formlist for spells. ListAddForm SexoutScannerSpells MySpell   That's "it".  The script you write in step three will be run on the player once every second, by casting the spell you provided on the player. When that happens, the three lists above (MyScanned*) that are in your mod, will contain all the males, females, and creatures.  You can loop through the lists 'doing stuff' with those NPCs. When you're done (end of the spell block) you need to clear those three MyScanned* formlists.  It may make more sense for there to just be one list for everything, and leave detecting males, females, and creatures up to the individual mods, as I think about it.  Some of the scanners are using GetDistance and stuff like that, which will become combersome to find the "closest" NPC when you don't care about gender or creatureness. Link to comment
prideslayer Posted February 1, 2012 Author Share Posted February 1, 2012 So the revised proposal is to just have one formlist, not all three. Sexout will have two. SexoutScannerListN (NPCs) and SexoutScannerListS (Spells). Â You'll only need one in your own mod. Â Sneaky trick: You can also use this as a 1hz timer / "clock pulse". Just don't do the formlist part. Sexout will cast the spell on the player once per second, if there's something else you want to do every second, that has nothing to do with scanning. Link to comment
Guest Loogie Posted February 2, 2012 Share Posted February 2, 2012 I could do the first one or two for you. Hell maybe I'll be bored and do them all. Â Â Once I have an example to follow, I could do the rest. Only concern I have is scanners that turn off and on during special circumstances, like the NCR and fiends ones. Â Â Â Link to comment
prideslayer Posted February 2, 2012 Author Share Posted February 2, 2012 I could do the first one or two for you. Hell maybe I'll be bored and do them all. Â Â Once I have an example to follow' date=' I could do the rest. Only concern I have is scanners that turn off and on during special circumstances, like the NCR and fiends ones. Â Â Â [/quote'] Â You can check those flags in your spell. You could do the same thing by either: Â 1. Removing your spell from the sexout formlist when you don't want it called. Â 2. Checking your enable/disable flag in your spell instead of in the scanner. Â The 2nd option is probably easier and safer. Link to comment
Halstrom Posted February 3, 2012 Share Posted February 3, 2012 Sneaky trick: You can also use this as a 1hz timer / "clock pulse". Just don't do the formlist part. Sexout will cast the spell on the player once per second' date=' if there's something else you want to do every second, that has nothing to do with scanning.[/quote']And if you want to have a game world timing script that keeps track of real time missed during sleep / wait & fast travel you can use this nifty code in the block fired by the 1Hz timer. ; *** Alter Script run times to catch up after Fast Travel / Wait / Sleep ; *** Intitialise so script doesn't lockup If fLastUpdatedTime == 0 || fHoursPassed <= 0 Set fLastUpdatedTime to (GameDaysPassed * 24) - .0002 endif ; *** GameDays passed Set gTimeStep to .1 Set fCurrentTime to GameDaysPassed * 24 Set fHoursPassed to fCurrentTime - fLastUpdatedTime If fHoursPassed > gTimeStep If fHoursPassed > 1 Set gTimeStep to .2 endif If fHoursPassed > 4 Set gTimeStep to .5 endif If fHoursPassed > 8 Set gTimeStep to 1 endif If fHoursPassed > 16 Set gTimeStep to 2 endif Set fLastUpdatedTime to fLastUpdatedTime + gTimeStep :*** do anything here you want repeated if missed to catchup, this script will keep firing this block every second till it catches up then resume to working just every 6 minutes (.1 gTimeStep) I increase gTimeStep to catchup faster and I then use gTimestep as a multiplier in the stuff done here. You would use a gTimeStep of 1 if you only wanted to check or modify something every game hour instead of 6 minutes. endif Link to comment
prideslayer Posted February 4, 2012 Author Share Posted February 4, 2012 Code for this is in and ready. Posting the scanner quest script here for any additional ideas, criticisms, or comments before I release a version with it and modify rapers (or perhaps crowds) to use it. Â Debugging statements will obviously be changed to debugprints or removed before release. Â scn SexoutScannerQSCRIPT int gInitS int gInitE float gsp float fDelay ref lastCell ref actor int whileIa int whileIb int whileSa int whileSb int whileSc int whileCa int whileCb int nIdx int nCnt ref remoteList ref remoteSpell int dbgScanCnt begin MenuMode if ((MenuMode 1012) || (MenuMode 1007)) ; Sets the delay timer whenever sleeping or loading if (fDelay != 5) set fDelay to 5 endif endif end begin GameMode set gsp to GetSecondsPassed if (GetGameRestarted || GetGameLoaded) set whileIa to 0 set whileIb to 1 set whileSa to 10 set whileSb to 11 set whileSc to 12 set whileCa to 20 set whileCb to 21 set fDelay to 5 set dbgScanCnt to 0 ; reset formlists to clear dirty data set nCnt to ListGetCount SexoutScannerListN Label whileIa if (nCnt > 0) ListRemoveNth SexoutScannerListN 0 set nCnt to ListGetCount SexoutScannerListN goto whileIa endif set nCnt to ListGetCount SexoutScannerListS Label whileIb if (nCnt > 0) ListRemoveNth SexoutScannerListS 0 set nCnt to ListGetCount SexoutScannerListS goto whileIb endif endif ; Delay block for fast travel etc. if fDelay > 0 set fDelay to fDelay - gsp return endif ; begin scanner PrintToConsole "Scanning..." set actor to GetFirstRef 200 Label whileSa if actor PrintToConsole "SEXSCAN DEBUG: Found %n" actor set nCnt to ListGetCount SexoutScannerListN set nIdx to 0 if (nCnt > 0) Label whileSb if ((nIdx + 1) <= nCnt) set remoteList to ListGetNthForm SexoutScannerListN nIdx ListAddForm remoteList actor PrintToConsole "SEXSCAN DEBUG: Added %n to %n" actor remoteList set nIdx to nIdx + 1 goto whileSb endif endif set actor to GetNextRef goto whileSa endif PrintToConsole "Scan %g complete" dbgScanCnt set dbgScanCnt to dbgScanCnt + 1 ; end scanner ; Call remote spells set nCnt to ListGetCount SexoutScannerListS set nIdx to 0 if (nCnt > 0) Label whileCa if ((nIdx + 1) <= nCnt) set remoteSpell to ListGetNthForm SexoutScannerListS nIdx PrintToConsole "SEXSCAN DEBUG: Casting %n on player" remoteSpell player.cios remoteSpell set nIdx to nIdx + 1 goto whileCa endif endif end Link to comment
prideslayer Posted February 4, 2012 Author Share Posted February 4, 2012 The only issue I'm already seeing in my mind is that the list clearing may cause a problem if another mod inits (and adds itself) to me before my own init runs. I think it would be best if mods using this just do the "blind add" in their own loops to ensure they are added to the form. If not a blind add than something like this:  if (0 == MyFormList.IsInList SexoutScannerListN) ListAddForm SexoutScannerListN MyFormList endif  Same thing for the spell.  I need to do the clear or else 'junk' added by a mod might remain in the list even if that mod is unloaded, which will cause this script to bomb out. I say might because I haven't tested. I don't know how well the reference cleaning stuff in the game works when it comes to formlist contents. Link to comment
Guest Loogie Posted February 4, 2012 Share Posted February 4, 2012 My trip got cancelled, so I can do real modding today. Is this generic scanner good to go or do kinks need worked out before Tryouts use it? Link to comment
prideslayer Posted February 4, 2012 Author Share Posted February 4, 2012 My trip got cancelled' date=' so I can do real modding today. Is this generic scanner good to go or do kinks need worked out before Tryouts use it? [/quote'] Â It's only in the beta ESM right now, nothing is using it yet, but it should work. Hoping that while people are testing the beta, others can look over that script above and tell me how it looks. That's not the script you'll need, that's the one in sexout.esm, just fyi. Link to comment
prideslayer Posted February 4, 2012 Author Share Posted February 4, 2012 Loogie, Rapers is a mess so I'm shelving switching that right now. I'm working on modifying Kings Tryout to use the new scanner and will send it to you when it's done. Shouldn't take more than half an hour or so. Â Edit: Gonna be a bit more than half an hour. I decided to document my work as I go to provide a tutorial for everyone when I'm done. Writing documentation is slower than writing code.. Link to comment
prideslayer Posted February 4, 2012 Author Share Posted February 4, 2012 Kings tryout conversion completed, testing it out now. Link to comment
prideslayer Posted February 5, 2012 Author Share Posted February 5, 2012 Got sidetracked with some other stuff, but finished testing and tweaking, looks good. Going to post the HOWTO in the sexoutNG thread and link to it from the OP. Loogie do you want my Kings ESP here.. tryout thread.. privately.. or where? Link to comment
Guest Loogie Posted February 5, 2012 Share Posted February 5, 2012 Might as well post it here. Link to comment
prideslayer Posted February 5, 2012 Author Share Posted February 5, 2012 Might as well post it here. Â You got it, here it is. Will remove once you have it, unless you want others to download and test. Â (EDIT: Removed download, quite stale at this point.) Link to comment
ChancellorKremlin Posted February 5, 2012 Share Posted February 5, 2012 I'm so in on this! Link to comment
prideslayer Posted February 5, 2012 Author Share Posted February 5, 2012 I'm so in on this! Â You're going to need the beta sexout ESM from the NG thread as well. Link to comment
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