Jump to content

NOTICE: The new site is now moved to the original www.loverslab.com URL. The site may be up and down during this transition and there is still some tweaks and setup going on, so you may experience the occasional broken link, visual oddity, and other such errors. 

If you notice anything any particular that's broken or have any suggestions or comments, please post them in the following thread: http://www.loverslab.com/topic/87535-new-site-questions-comments-and-suggestions/

The old site will remain accessible for the next week via the URL http://old.loverslab.com

Sign in to follow this  
Asesino

Help with a script add-on for Lovers Satisfaction?

Recommended Posts

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 xLoversSatQuestScript

float fQuestDelayTime

short init
short control ; 0: wait, 1: init, 2: sex, 3: finish, 4: masturbation start, 5: masturbation end
short 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 end
short cumTimer
short stage
short index
short sPos ;xLovers position index
short sGroup ;xLovers position groups: 0: cowgirl, 1: doggy, 2: missionary, 3: standig, 4: blowjob
float baseIncrement

float changeNum ;Max number of pose changes allowed. Novice: 1, Apprentice: 2, Journeyman: 3, Expert: 4, Master: 5
short changeMenu
short changePose

float playerSP ;player sex points (arousment)
float playerSPmax ;player max sex points
float playerSD ;player sexual desire
array_var playerPref ;player position preferences

float partnerXP
float partnerSP
float partnerSPmax
short partnerLvl
array_var partnerPref

short cumScore

ref partnerRef
array_var partnerAr ;NPC array
string_var p ;NPC array key

float SDtimer
float prevHour
short prevDay
short maxDay ;Number of days it takes to fill desire points

short random
float pref
short i

float version ;Currently installed version
short debug
short debugSwitch

ref MB2token

;DEPRECATED VARIABLES in 0.2:
float playerXP ;player sex experience
short playerLvl ;player sex level


Begin GameMode

call xLoversSatUpdate 0.5

if GetGameLoaded || debugSwitch != debug
SetDebugMode debug
let debugSwitch := debug
if debug == 1
printC "%BLovers Satisfaction:%b Debug messages On"
else
printC "%BLovers Satisfaction:%b Debug messages Off"
endif

let MB2token := call xLoversSatGetMB2

endif

if control == 0
;Player is not having sex, checking status every two seconds

if PlayerRef.GetItemCount MB2token != 0
;Player is masturbating
DebugPrint "%BLovers Satisfaction:%b Masturbation starting."
set control to 4

elseif PlayerRef.GetItemCount xLoversPkrIdentifier != 0
;Player is starting sex
set control to 1

else
;Add desire points and then return
let SDtimer := ( 24 * (GameDaysPassed - prevDay) ) + ( GameHour - prevHour )
let playerSD += SDtimer * ( 100 / (maxDay * 24) )
if playerSD > 100
let playerSD := 100
endif

call xLoversSatEffects playerSD

set prevDay to GameDaysPassed
set prevHour to GameHour

return
endif

elseif control == 1
;Player has started sex. Initializing variables

set playerSP to 0
set partnerSP to 0
set cumStage to 0
set cumScore to 0

let index := Call xLoversSatGetIndexPairs
let sPos := xLoversPkrQuest.arPairs[index]["sPos"]
let sGroup := Call xLoversPkrGetSPosGroup sPos

let changeNum := (playerRef.GetActorValueCurrentF xLoversSatAV / 25) + 1
let changeNum := floor changeNum
let changeMenu := 0

let partnerRef := Call xLoversCmnGetPartner PlayerRef
let p := partnerRef.GetName

if eval ar_HasKey partnerAr p
;Partner is already in the list
DebugPrint "%BLovers Satisfaction:%b %z is already listed, retrieving values" p
let partnerLvl := partnerAr[p]["Lvl"]
let partnerXP := partnerAr[p]["XP"]
let partnerPref := ar_Copy partnerAr[p]["Pref"]

else
;NPC is not in the list
DebugPrint "%BLovers Satisfaction:%b %z is not listed yet, initializing NPC values" p

;Randomize NPC level
set partnerLvl to 1 + ( (GetRandomPercent * 33) / 100 )
set random to GetRandomPercent
if random <= 50
set partnerLvl to partnerLvl + 0
if partnerLvl < 5
set partnerLvl to 5
endif

elseif random <= 85
set partnerLvl to partnerLvl + 33

else
set partnerLvl to partnerLvl + 66
endif
DebugPrint "%BLovers Satisfaction:%b %z's level is %.0f" p partnerLvl

;Randomize NPC preferences
let partnerPref := ar_Construct array
set i to 0
while i <= 4
let partnerPref := rand 1.0 2.50

let pref := partnerPref
DebugPrint "%BLovers Satisfaction:%b %z's preference for group %.0f is %.2f" p i pref

set i to i + 1
loop

;Override with default genre values
if partnerRef.GetIsSex male
;Male loves a good blowjob
let partnerPref[4] := 1.5

else
;Female is not likely to cum while blowing
let partnerPref[4] := 0.5

endif

;Add NPC to the list
let partnerAr[p] := ar_Construct stringmap
let partnerAr[p]["Lvl"] := partnerLvl
let partnerAr[p]["Pref"] := ar_Copy partnerPref
let partnerAr[p]["XP"] := 0

endif

set fQuestDelayTime to 0.1

DebugPrint "%BLovers Satisfaction:%b Sex is starting. Position: %.0f, Group: %0.f." sPos sGroup
set control to 2

elseif control == 2
;Player is having sex now

if PlayerRef.GetItemCount xLoversPkrIdentifier == 0
set control to 3
return
endif

;Increase SexPoints (arousment) for both actors
let playerSPmax := call xLoversSatGetSPmax PlayerRef 0
let playerSP += call xLoversSatIncreaseSP PlayerRef playerPref[sGroup] playerSPmax GetSecondsPassed
let partnerSPmax := call xLoversSatGetSPmax partnerRef partnerLvl
let partnerSP += call xLoversSatIncreaseSP partnerRef partnerPref[sGroup] partnerSPmax GetSecondsPassed

let cumStage := call xLoversSatCumStage playerRef
let cumStage := call xLoversSatCumStage partnerRef

if cumStage == 1
;Start female orgasm, trigger final animation stage
DebugPrint "%BLovers Satisfaction:%b Female actor is cumming"
set stage to PlayerRef.GetItemCount xLoversStageM
call xLoversCmnSetItemCount PlayerRef xLoversStageM 5
call xLoversPkrSafePickIdle PlayerRef
call xLoversCmnSetItemCount partnerRef xLoversStageM 5
call xLoversPkrSafePickIdle partnerRef

Call xLoversCmnSetItemCount PlayerRef xLoversPkrStop 1

set cumTimer to 0
set cumStage to 2

let cumScore += 1
IncrementPlayerSkillUseF xLoversSatAV
call xLoversSatUseSkillNPC 4

elseif cumStage == 2
;Continue female orgasm
let cumTimer += GetSecondsPassed
if cumTimer >= 5
set cumStage to 3
endif

elseif cumStage == 3
;End female orgasm, return to previous animation stage
call xLoversCmnSetItemCount PlayerRef xLoversPkrStop 0
call xLoversCmnSetItemCount PlayerRef xLoversStageM stage
call xLoversPkrSafePickIdle PlayerRef
call xLoversCmnSetItemCount partnerRef xLoversStageM stage
call xLoversPkrSafePickIdle partnerRef
set cumStage to 0

elseif cumStage == 4 || cumStage == 7
;Start male orgasm
DebugPrint "%BLovers Satisfaction:%b Male actor is cumming"
call xLoversCmnSetItemCount PlayerRef xLoversPkrStop 0
call xLoversCmnSetItemCount partnerRef xLoversPkrStep 4
call xLoversCmnSetItemCount PlayerRef xLoversPkrStep 4

if cumStage == 4
;Male is cumming alone
set cumStage to 5
let cumScore += 1
IncrementPlayerSkillUseF xLoversSatAV
call xLoversSatUseSkillNPC 4
else
;Male is catching up, add bonus
set cumStage to 8
let cumScore += 2
IncrementPlayerSkillUseF xLoversSatAV 0 2
call xLoversSatUseSkillNPC 8
endif

elseif cumStage == 6
;Female catches up, add bonus
DebugPrint "%BLovers Satisfaction:%b Female actor is cumming"
set cumStage to 8
let cumScore += 2
IncrementPlayerSkillUseF xLoversSatAV 0 2
call xLoversSatUseSkillNPC 8
endif

if IsKeyPressed3 33 && cumStage == 0 && changeNum > 0
let changeMenu := 1
endif

if changeMenu == 1
MessageBoxEX "Changes left: %.0f|Cowgirl|Doggy|Missionary|Standing|Blowjob|Cancel" changeNum
let changeMenu := -1
elseif changeMenu == -1
set changePose to GetButtonPressed
if changePose != -1
call xLoversSatChangePose changePose
set changeMenu to 0
endif
endif

elseif control == 3
;Sex has ended
DebugPrint "%BLovers Satisfaction:%b Sex has ended, total score: %.0f" cumScore

let p := partnerRef.GetName
let partnerAr[p]["Lvl"] := partnerLvl
let partnerAr[p]["XP"] := partnerXP

let playerSD -= cumScore * 20
if playerSD < 0
set playerSD to 0
endif

set playerSP to 0
set playerSPmax to 0
set partnerSP to 0
set partnerSPmax to 0

set control to 0
set fQuestDelayTime to 2

elseif control == 4
;Starting masturbation

set fQuestDelayTime to 0.1
if PlayerRef.GetItemCount MB2token == 0
set control to 5
endif

elseif control == 5
;Ending masturbation
DebugPrint "%BLovers Satisfaction:%b Masturbation ended."

let playerSD -= 10
if playerSD < 0
set playerSD to 0
endif

set fQuestDelayTime to 2
set control to 0

endif

end

 

 

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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 cunnilingus
if partnerRef.GetIsSex male && umid != umidOfCunnilingusAnim1 && umid != umidOfCunnilingusAnim2
;Male loves a good blowjob
let 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 blowing
let partnerPref[4] := 0.5

endif

I 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. ^^;

Share this post


Link to post

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.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×