Asesino Posted July 5, 2016 Posted July 5, 2016 Hello all, I was wondering if someone a bit more familiar with scripting for Oblivion could give me some pointers/help me figure out what I'm doing wrong here. I recently reinstalled (for like the 50th time) Oblivion+Lovers and downloaded Satisfaction. I remembered one issue I had had with it before that Schmen had considered fixing, but it seems he never got around to it. That is, when your character starts up a scene with an NPC (in this case, male character and female NPC) the Oral category is set to raise the SP bar far quicker for the man and slowly for the woman (makes sense, sure). Problem with this is that it still works that way when it is the man performing oral on the woman (and yet his SP rockets up and hers barely moves ). I figured it shouldn't be *that* hard to add in a few lines to the code that would take into account which animations/positions are being used and override this behaviour (if only for those two positions) to make it make more sense. I've found that a variable "sPos" already exists for which animation is being used and thought I could use it to set up this situation. I can't get it to work though. I've tried a few different approaches and it either makes it so the SP bars never appear (and then you have to reload as you become trapped in the anims) or no change occurs at all (no perceivable change, anyways). Here's the code from the quest script: (Warning- Lots of code) ScriptName xLoversSatQuestScriptfloat fQuestDelayTimeshort initshort control ; 0: wait, 1: init, 2: sex, 3: finish, 4: masturbation start, 5: masturbation endshort cumStage ; 0: none, 1: start fem, 2: fem duration, 3: end fem, 4: start male, 5: male duration, 6: fem catches up, 7: male catches up, 8: safe endshort cumTimershort stageshort indexshort sPos ;xLovers position indexshort sGroup ;xLovers position groups: 0: cowgirl, 1: doggy, 2: missionary, 3: standig, 4: blowjobfloat baseIncrementfloat changeNum ;Max number of pose changes allowed. Novice: 1, Apprentice: 2, Journeyman: 3, Expert: 4, Master: 5short changeMenushort changePosefloat playerSP ;player sex points (arousment)float playerSPmax ;player max sex pointsfloat playerSD ;player sexual desirearray_var playerPref ;player position preferencesfloat partnerXPfloat partnerSPfloat partnerSPmaxshort partnerLvlarray_var partnerPrefshort cumScoreref partnerRefarray_var partnerAr ;NPC arraystring_var p ;NPC array keyfloat SDtimerfloat prevHourshort prevDayshort maxDay ;Number of days it takes to fill desire pointsshort randomfloat prefshort ifloat version ;Currently installed versionshort debugshort debugSwitchref MB2token;DEPRECATED VARIABLES in 0.2:float playerXP ;player sex experienceshort playerLvl ;player sex levelBegin GameModecall xLoversSatUpdate 0.5if GetGameLoaded || debugSwitch != debugSetDebugMode debuglet debugSwitch := debugif debug == 1printC "%BLovers Satisfaction:%b Debug messages On"elseprintC "%BLovers Satisfaction:%b Debug messages Off"endiflet MB2token := call xLoversSatGetMB2endifif control == 0;Player is not having sex, checking status every two secondsif PlayerRef.GetItemCount MB2token != 0;Player is masturbatingDebugPrint "%BLovers Satisfaction:%b Masturbation starting."set control to 4elseif PlayerRef.GetItemCount xLoversPkrIdentifier != 0;Player is starting sexset control to 1else;Add desire points and then returnlet SDtimer := ( 24 * (GameDaysPassed - prevDay) ) + ( GameHour - prevHour )let playerSD += SDtimer * ( 100 / (maxDay * 24) )if playerSD > 100let playerSD := 100endifcall xLoversSatEffects playerSDset prevDay to GameDaysPassedset prevHour to GameHourreturnendifelseif control == 1;Player has started sex. Initializing variablesset playerSP to 0set partnerSP to 0set cumStage to 0set cumScore to 0let index := Call xLoversSatGetIndexPairslet sPos := xLoversPkrQuest.arPairs[index]["sPos"]let sGroup := Call xLoversPkrGetSPosGroup sPoslet changeNum := (playerRef.GetActorValueCurrentF xLoversSatAV / 25) + 1let changeNum := floor changeNumlet changeMenu := 0let partnerRef := Call xLoversCmnGetPartner PlayerReflet p := partnerRef.GetNameif eval ar_HasKey partnerAr p;Partner is already in the listDebugPrint "%BLovers Satisfaction:%b %z is already listed, retrieving values" plet partnerLvl := partnerAr[p]["Lvl"]let partnerXP := partnerAr[p]["XP"]let partnerPref := ar_Copy partnerAr[p]["Pref"]else;NPC is not in the listDebugPrint "%BLovers Satisfaction:%b %z is not listed yet, initializing NPC values" p;Randomize NPC levelset partnerLvl to 1 + ( (GetRandomPercent * 33) / 100 )set random to GetRandomPercentif random <= 50set partnerLvl to partnerLvl + 0if partnerLvl < 5set partnerLvl to 5endifelseif random <= 85set partnerLvl to partnerLvl + 33elseset partnerLvl to partnerLvl + 66endifDebugPrint "%BLovers Satisfaction:%b %z's level is %.0f" p partnerLvl;Randomize NPC preferenceslet partnerPref := ar_Construct arrayset i to 0while i <= 4let partnerPref := rand 1.0 2.50let pref := partnerPrefDebugPrint "%BLovers Satisfaction:%b %z's preference for group %.0f is %.2f" p i prefset i to i + 1loop;Override with default genre valuesif partnerRef.GetIsSex male;Male loves a good blowjoblet partnerPref[4] := 1.5else;Female is not likely to cum while blowinglet partnerPref[4] := 0.5endif;Add NPC to the listlet partnerAr[p] := ar_Construct stringmaplet partnerAr[p]["Lvl"] := partnerLvllet partnerAr[p]["Pref"] := ar_Copy partnerPreflet partnerAr[p]["XP"] := 0endifset fQuestDelayTime to 0.1DebugPrint "%BLovers Satisfaction:%b Sex is starting. Position: %.0f, Group: %0.f." sPos sGroupset control to 2elseif control == 2;Player is having sex nowif PlayerRef.GetItemCount xLoversPkrIdentifier == 0set control to 3returnendif;Increase SexPoints (arousment) for both actorslet playerSPmax := call xLoversSatGetSPmax PlayerRef 0let playerSP += call xLoversSatIncreaseSP PlayerRef playerPref[sGroup] playerSPmax GetSecondsPassedlet partnerSPmax := call xLoversSatGetSPmax partnerRef partnerLvllet partnerSP += call xLoversSatIncreaseSP partnerRef partnerPref[sGroup] partnerSPmax GetSecondsPassedlet cumStage := call xLoversSatCumStage playerReflet cumStage := call xLoversSatCumStage partnerRefif cumStage == 1;Start female orgasm, trigger final animation stageDebugPrint "%BLovers Satisfaction:%b Female actor is cumming"set stage to PlayerRef.GetItemCount xLoversStageMcall xLoversCmnSetItemCount PlayerRef xLoversStageM 5call xLoversPkrSafePickIdle PlayerRefcall xLoversCmnSetItemCount partnerRef xLoversStageM 5call xLoversPkrSafePickIdle partnerRefCall xLoversCmnSetItemCount PlayerRef xLoversPkrStop 1set cumTimer to 0set cumStage to 2let cumScore += 1IncrementPlayerSkillUseF xLoversSatAVcall xLoversSatUseSkillNPC 4elseif cumStage == 2;Continue female orgasmlet cumTimer += GetSecondsPassedif cumTimer >= 5set cumStage to 3endifelseif cumStage == 3;End female orgasm, return to previous animation stagecall xLoversCmnSetItemCount PlayerRef xLoversPkrStop 0call xLoversCmnSetItemCount PlayerRef xLoversStageM stagecall xLoversPkrSafePickIdle PlayerRefcall xLoversCmnSetItemCount partnerRef xLoversStageM stagecall xLoversPkrSafePickIdle partnerRefset cumStage to 0elseif cumStage == 4 || cumStage == 7;Start male orgasmDebugPrint "%BLovers Satisfaction:%b Male actor is cumming"call xLoversCmnSetItemCount PlayerRef xLoversPkrStop 0call xLoversCmnSetItemCount partnerRef xLoversPkrStep 4call xLoversCmnSetItemCount PlayerRef xLoversPkrStep 4if cumStage == 4;Male is cumming aloneset cumStage to 5let cumScore += 1IncrementPlayerSkillUseF xLoversSatAVcall xLoversSatUseSkillNPC 4else;Male is catching up, add bonusset cumStage to 8let cumScore += 2IncrementPlayerSkillUseF xLoversSatAV 0 2call xLoversSatUseSkillNPC 8endifelseif cumStage == 6;Female catches up, add bonusDebugPrint "%BLovers Satisfaction:%b Female actor is cumming"set cumStage to 8let cumScore += 2IncrementPlayerSkillUseF xLoversSatAV 0 2call xLoversSatUseSkillNPC 8endifif IsKeyPressed3 33 && cumStage == 0 && changeNum > 0let changeMenu := 1endifif changeMenu == 1MessageBoxEX "Changes left: %.0f|Cowgirl|Doggy|Missionary|Standing|Blowjob|Cancel" changeNumlet changeMenu := -1elseif changeMenu == -1set changePose to GetButtonPressedif changePose != -1call xLoversSatChangePose changePoseset changeMenu to 0endifendifelseif control == 3;Sex has endedDebugPrint "%BLovers Satisfaction:%b Sex has ended, total score: %.0f" cumScorelet p := partnerRef.GetNamelet partnerAr[p]["Lvl"] := partnerLvllet partnerAr[p]["XP"] := partnerXPlet playerSD -= cumScore * 20if playerSD < 0set playerSD to 0endifset playerSP to 0set playerSPmax to 0set partnerSP to 0set partnerSPmax to 0set control to 0set fQuestDelayTime to 2elseif control == 4;Starting masturbationset fQuestDelayTime to 0.1if PlayerRef.GetItemCount MB2token == 0set control to 5endifelseif control == 5;Ending masturbationDebugPrint "%BLovers Satisfaction:%b Masturbation ended."let playerSD -= 10if playerSD < 0set playerSD to 0endifset fQuestDelayTime to 2set control to 0endifend It was my intention to make this be retroactive for NPCs who already exist within the list (which is why I saw no change the first time, when I accidentally added the code under the section where it randomises the NPCs stats, as they were already set). I would think it would be easy enough to add a condition that checks to see if the partner is female and if the specific positions (in my case, they are assigned to 29 & 159) are active and then sets the PartnerPref and PlayerPref for category 4 accordingly. I just can't seem to figure it out though. I know that that is a lot of text to check through but the part where the code I was looking through starts begins at "elseif control == 1" since that's where it begins the if-statement to set stats. If someone could help me with this, I'd seriously really appreciate it. Thanks for reading this otherwise, at least.
xartom Posted July 27, 2016 Posted July 27, 2016 This is way beyond me but I'll guess; maybe change partner pref to get offense/defense rather than getissex then add the specific spos to the list of what gets them off or not.
gregathit Posted July 27, 2016 Posted July 27, 2016 Why don't you try using the umid number? Each animation contains a a unique umid number and you could then tailor the rate of increase based on the particular animation. Be a bit more work, but it would much more specific.
whiskeyii Posted September 5, 2016 Posted September 5, 2016 Hm, I haven't done coding in ages, but would a change like this work for what gregathit is suggesting? int umid = getUmidNumberOfAnimation();Override with default genre values ;if partner is male and is not performing cunnilingusif partnerRef.GetIsSex male && umid != umidOfCunnilingusAnim1 && umid != umidOfCunnilingusAnim2;Male loves a good blowjoblet partnerPref[4] := 1.5 ;if partner is male and is performing cunnilingus else if if partnerRef.GetIsSex male && (umid == umidOfCunnilingusAnim1 || umid == umidOfCunnilingusAnim2) ;Male not likely to cum while performing cunnilingus let partnerPref[4] := 0.5 ;if partner is female and is receiving cunnilingus else if umid == umidOfCunnilingusAnim1 || umid == umidOfCunnilingusAnim2 ;Female prefers cunnilingus let partnerPref[4] := 1.5 else;Female is performing oral sex and is not likely to cum while blowinglet partnerPref[4] := 0.5endifI think you would have to create a function to call the umid of each animation being done, though, so you could check it against the umid numbers of the two cunnilingus animations. Can't do it myself because it's been years since I've even touched Java, but I think the theory is sound. EDIT: I'm not sure how LoversSatisfaction would handle this with two female participants, or even if you could control who's licking who in that scenario. Presumably the one being licked would have their preferences jump up to 1.5, with the person licking dropping to 0.5, but I'm not even sure how to check that, or even if it's possible. I assume with a male-female pair, LoversSatisfaction just forces the guy to do the licking, but I'm not sure what that means for the preferences of the (presumably) female player character. Like I said, lightweight programmer here. ^^;
Schmendrick Posted January 17, 2017 Posted January 17, 2017 Sorry, I havent been here in ages, and I dont recall exactly how the code works, but the function you need to edit is xLoversSatIncreaseSP. The second argument of this function is the preference that NPCs have for the selected animation group. Inside that function you can filter the animation as gregathit suggested, and modify locally the preference. Modifying it in the main script will fail because that section refered by whiskeyii is just for randomizing preference multipliers that will be used later; such multipliers are group-wide, and there is only one animation group for all oral sex.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.