Jump to content

Need help triggering scene on bleedout event


Recommended Posts

And some other scripting help

 

I want to trigger a scene when the player enters bleedout state. The current code works except when the animation starts the player plays the bleedout animation again a few times and then recovers into idle animation rather than playing the sex scene animation.

 

The other questions I have :

Is there a better way to hook into animation end event. I want my code to run no matter what mod is used to trigger the sex scene as long as the player is victim.

Can I somehow hook into the events thrown by mods like Defeat without editing their script?

 

The code which is attached to a player alias is below

 

Event OnInit()
	RegisterforModEvent("HookAnimationEnd", "Finish")
endEvent

Event OnEnterBleedout()	
	Actor Acc = combataliasact.getactorref() as Actor
	Acc.StopCombatAlarm()
	Rape(Acc)
endEvent

Event Finish(int tid, bool hasPlayer)
	if(PlayerRef.GetParentCell()==describedcell)
		Utility.Wait(5)
		getOwningQuest().setStage(15)
		UnregisterForModEvent("HookAnimationEnd")
	endif
endEvent

Function Rape(Actor Acc)
	actor[] sexActors = new actor[2]   
	actor Victim = PlayerRef
	sexActors[0] = Victim 
	sexActors[1] = Acc    
	sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, [tags], [exclusion], True)
	Victim.SetNoBleedoutRecovery(False)
	SL.StartSex(sexActors, anims, Victim, CenterOn = Victim, allowbed=false, hook=[hook])
EndFunction

 

Link to comment

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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use