Jump to content
Headerman

How to monitor arousal and execute a function from it

Recommended Posts

Hi guys,

 

I am creating a mod and have links to Sexlab and SAR. I want the script to monitor the arousal and when arousal reaches 100, the player orgasms automatically.

 

Is there a simple line or two that does this? I am new to scripting so i am still learning about it,

 

Someone has mentioned a spell active on the player could do it. I also have a quest script running at the same time too if that helps?

Link to post

For something like that, I'd recommend doing a quest that runs on startup as a spell requires some extra steps to work properly. As for the script, I'd do something like this:

Scriptname myScript extends Quest

slaUtilScr Property slaUtil auto
Actor Property PlayerRef Auto

Event OnInit()
	Debug.Trace("Mod Loaded")
	RegisterforSingleUpdateGameTime(1.0); this tells the game to register our script to run every in-game hour
										; it's very important to use RegisterforSingleUpdateGameTime() so that if your mod updates or someone removes it the game doesn't have an undefined onUpdate block
EndEvent

Event OnUpdateGameTime()
	if(PlayerRef.getFactionRank(slaUtil.slaArousal) == 100); this is the actual arousal check - assuming you're using SLA redux
    	Orgasm() ; this is up to you - you can either have the player start a solo sex scene with SL, or do something else
    endIf
    RegisterforSingleUpdateGameTime(1.0) ; this tells the game to re-register for the next update after we're done
endEvent

Then you'd just have to set the properties correctly in the CK, and decide what you want to do when the player gets too 100 arousal. If its sexlab scripting, I can help with that, but if you're planning on doing anything else (say, hook into cumshot and have the player cum) I can't really help you there.

 

also you may want to check out my guide on getting all the necessary pre-requisite scripts for SLA and SL if you don't have them already:

 

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...