Jump to content

Issue with own mod starting sex


Recommended Posts

Posted

I've made a magical effect, attached the following script to it, attached it to the spell "RapeMe" and it works fine.

 

 

scriptname SexLabZRapeMeMagicEffect extends ActiveMagicEffect
{...}

SexLabFramework property SexLab auto
SexLabZ Property Z auto hidden
spell property SexLabZRapeMe auto

event OnEffectStart(actor target, actor caster)
	
	actor[] actorList = new actor[2]
	actorList[0] = caster
	actorList[1] = target
	
	sslBaseAnimation[] anims
	
	if target.GetLeveledActorBase().GetSex() == 1
		anims = new sslBaseAnimation[2]
		anims[0] = SexLab.GetAnimationByName("Reverse Cowgirl")
		anims[1] = SexLab.GetAnimationByName("Arrok Cowgirl")
		actorList[0] = target
		actorList[1] = caster
	endIf
	
	SexLab.StartSex(actorList, anims, victim=caster, allowBed=false, hook="_SLC_Consequences")
	
endEvent

 

 

 

Then I've made a quest, added a player reference, added the following onHit event script to it but the SexLab animation doesn't start, however the script itself works just fine.

 

 

 

Scriptname SexLabAbusedPlayer extends ReferenceAlias
{...}

SexLabFramework Property SexLab Auto
ReferenceAlias[] property actorRef auto

event OnInit()
	
	RegisterForModEvent("AnimationEnd", "SexLabAnimEnd2")
	
endEvent

event onHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	
	
	
	float playerHealth
	float playerStamina
	float playerHealthLost
	float playerStaminaLost
	float chance
	float staminaModifier
	float staminaMultiplier = 2 ; if stamina is full multiply chance with 1 (do nothing), if stamina is empty multiply with 2 (double the rape chance); half stamina would be 1.5 etc.
	
	playerHealth = Game.GetPlayer().GetActorValuePercentage("Health") ;GetActorValuePercentage return a float number between 0 and 1
	playerStamina = Game.GetPlayer().GetActorValuePercentage("Stamina")

        ; in case you want to do this for NPCs you need to somehow get the actor value of said NPC and replace Game.GetPlayer() with it

	playerHealthLost = 1 - playerHealth
	playerStaminaLost = 1 - playerStamina
	
	
	
	chance = playerHealthLost*playerHealthLost
	staminaModifier = 1 + (staminaMultiplier * playerStaminaLost)
	
	if (chance*staminaModifier) > Utility.RandomFloat(0, 1) ; (.RandomFloat return a number between 0 and 1)
		RapeMe(akAggressor)
;		Debug.Notification("Chance: " + chance + " staminaModifier:" + staminaModifier + " Final chance: " + chance*staminaModifier)
	endIf
	
endEvent

function RapeMe(ObjectReference akAggressor)
	
	Actor akAgg = akAggressor as Actor
	ActorBase BaseOfakAgg = akAggressor.GetBaseObject() as ActorBase
	
	actor[] actorList = new actor[2]
	actorList[0] = Game.GetPlayer()
	actorList[1] = akAgg
	actor playerRef = Game.GetPlayer()
	
	sslBaseAnimation[] anims
	
	if akAgg.GetLeveledActorBase().GetSex() == 1
		Debug.Notification(akAgg.GetLeveledActorBase().GetName() + " is female")
		anims = new sslBaseAnimation[2]
		anims[0] = SexLab.GetAnimationByName("Reverse Cowgirl")
		anims[1] = SexLab.GetAnimationByName("Arrok Cowgirl")
		actorList = SexLab.SortActors(actorList)
		SexLab.StartSex(actorList, anims, victim=playerRef, allowBed=false, hook="_SLC_AbusedPlayer")
	else
		SexLab.StartSex(actorList, anims, victim=playerRef, allowBed=false, hook="_SLC_AbusedPlayer")
	endIf
	
	
endFunction

 

 

 

I get to the "Name is female" part but each SexLab command isn't executed; the log tells me I'm trying to call them on a None object?!

 

 

 

[08/19/2013 - 05:09:33PM] Papyrus log opened (PC)
[08/19/2013 - 05:09:33PM] Update budget: 1.200000ms (Extra tasklet budget: 1.200000ms, Load screen budget: 500.000000ms)
[08/19/2013 - 05:09:33PM] Memory page: 128 (min) 512 (max) 76800 (max total)
[08/19/2013 - 05:09:44PM] Cannot open store for class "dlc1scwispwallscript", missing file?
[08/19/2013 - 05:09:45PM] Cannot open store for class "DLC2BenthicLurkerFXSCRIPT", missing file?
[08/19/2013 - 05:09:47PM] Cannot open store for class "sslThreadKey", missing file?
[08/19/2013 - 05:09:49PM] ERROR: Unable to bind script SexLabAbusedPlayer to SexLabAbusedPlayer (33000D62) because their base types do not match
[08/19/2013 - 05:09:49PM] Cannot open store for class "sexlabseduction", missing file?
[08/19/2013 - 05:09:49PM] Error: Unable to link type of variable "::Seduction_var" on object "SexLabZSeduceMagicEffect"
[08/19/2013 - 05:09:49PM] Error: Unable to link type of property "Seduction" on object "SexLabZSeduceMagicEffect"
[08/19/2013 - 05:09:49PM] ERROR: Unable to bind script sexlabseduction to SexLabZ (380012E3) because their base types do not match
[08/19/2013 - 05:09:52PM] ERROR: Unable to bind script DLC2WaterScript to  (0401AAD8) because their base types do not match
[08/19/2013 - 05:10:31PM] ERROR: Unable to bind script sexlabconsequencesmenu to alias PlayerAlias on quest SexLCMenu011 (34000D63) because their base types do not match
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 3 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] warning: Property pTG05KarliahInvisibilitySpell on script QF_TG05_00021551 attached to TG05 (00021551) cannot be initialized because the script no longer contains that property
[08/19/2013 - 05:10:31PM] warning: Property TG05KarliahInvisibilitySpell on script tg06questscript attached to TG06 (00021552) cannot be initialized because the script no longer contains that property
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 3 in container  (02003478) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 5 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 2 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 1 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 2 in container  (02007B86) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] warning: Property ThreadKey on script sexlabframework attached to SexLabSystem (0A000D62) cannot be initialized because the script no longer contains that property
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 4 in container  (02007B89) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 2 in container  (02007B87) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:31PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 4 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:35PM] VM is freezing...
[08/19/2013 - 05:10:35PM] VM is frozen
[08/19/2013 - 05:10:35PM] Reverting game...
[08/19/2013 - 05:10:35PM] ERROR: Unable to bind script DLC2WaterScript to  (0401AAD8) because their base types do not match
[08/19/2013 - 05:10:35PM] ERROR: Unable to bind script SexLabAbusedPlayer to SexLabAbusedPlayer (33000D62) because their base types do not match
[08/19/2013 - 05:10:35PM] ERROR: Unable to bind script sexlabseduction to SexLabZ (380012E3) because their base types do not match
[08/19/2013 - 05:10:36PM] ERROR: Unable to bind script sexlabconsequencesmenu to alias PlayerAlias on quest SexLCMenu011 (34000D63) because their base types do not match
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 1 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 5 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 2 in container  (02007B86) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 2 in container  (02007B87) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 3 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 3 in container  (02003478) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] warning: Property pTG05KarliahInvisibilitySpell on script QF_TG05_00021551 attached to TG05 (00021551) cannot be initialized because the script no longer contains that property
[08/19/2013 - 05:10:36PM] warning: Property ThreadKey on script sexlabframework attached to SexLabSystem (0A000D62) cannot be initialized because the script no longer contains that property
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 2 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 4 in container  (02007B89) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] ERROR: Property DLC1DawnguardItemPerk on script DLC1DawnguardItemScript attached to Item 4 in container  (0200F829) cannot be bound because <NULL form> (0100D83A) is not the right type
[08/19/2013 - 05:10:36PM] warning: Property TG05KarliahInvisibilitySpell on script tg06questscript attached to TG06 (00021552) cannot be initialized because the script no longer contains that property
[08/19/2013 - 05:11:04PM] Loading game...
[08/19/2013 - 05:11:04PM] Cannot open store for class "PRKF_000DevourCorpse_0100D5E9", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type PRKF_000DevourCorpse_0100D5E9 referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] Cannot open store for class "DevourmentLearnScript", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type DevourmentLearnScript referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] Cannot open store for class "DevourmentVomitQueueScript", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type DevourmentVomitQueueScript referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] Cannot open store for class "DevourmentScatQuestScript", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type DevourmentScatQuestScript referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] Cannot open store for class "sexlabconsequencesdodamageagg", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type sexlabconsequencesdodamageagg referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] Cannot open store for class "SexLabConsequencesConfigMenu", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type SexLabConsequencesConfigMenu referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] Cannot open store for class "sexlabconsequencessend", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type sexlabconsequencessend referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] Cannot open store for class "QF_000DevourmentAssistQuest_010012DC", missing file?
[08/19/2013 - 05:11:04PM] warning: Unable to get type QF_000DevourmentAssistQuest_010012DC referenced by the save game. Objects of this type will not be loaded.
[08/19/2013 - 05:11:04PM] warning: Could not find type DevourmentScatQuestScript in the type table in save
[08/19/2013 - 05:11:04PM] warning: Could not find type QF_000DevourmentAssistQuest_010012DC in the type table in save
[08/19/2013 - 05:11:04PM] warning: Could not find type DevourmentLearnScript in the type table in save
[08/19/2013 - 05:11:05PM] warning: Could not find type sexlabconsequencessend in the type table in save
[08/19/2013 - 05:11:05PM] warning: Could not find type SexLabConsequencesConfigMenu in the type table in save
[08/19/2013 - 05:11:05PM] warning: Could not find type sexlabconsequencesdodamageagg in the type table in save
[08/19/2013 - 05:11:05PM] warning: Could not find type PRKF_000DevourCorpse_0100D5E9 in the type table in save
[08/19/2013 - 05:11:05PM] warning: Could not find type DevourmentVomitQueueScript in the type table in save
[08/19/2013 - 05:11:05PM] warning: Function critterspawn..OnLoad in stack frame 0 in stack 13481 doesn't exist in the in-game resource files - using version from save
[08/19/2013 - 05:11:05PM] warning: Function critterspawn..OnLoad in stack frame 0 in stack 13482 doesn't exist in the in-game resource files - using version from save
[08/19/2013 - 05:11:05PM] VM is thawing...
[08/19/2013 - 05:11:16PM] --SEXLAB NOTICE _CheckSystem() --- SexLab Compatibility: 'Schlongs of Skyrim.esp' was found
[08/19/2013 - 05:11:16PM] ========== Auto Unequip Ammo: Scanning for supported plugins...
[08/19/2013 - 05:11:16PM] ========== ERRORS RELATED TO MISSING FILES SHOULD BE IGNORED!
[08/19/2013 - 05:11:16PM] ERROR: File "XFLMain.esm" does not exist or is not currently loaded.
stack:
	<unknown self>.Game.GetFormFromFile() - "<native>" Line ?
	[AUA (1600C6C2)].AUAQuestScript.GameLoaded() - "AUAQuestScript.psc" Line 40
	[AUA (1600C6C2)].AUAQuestScript.OnUpdate() - "AUAQuestScript.psc" Line 73
[08/19/2013 - 05:11:16PM] ========== Auto Unequip Ammo: Scan complete.
[08/19/2013 - 05:11:16PM] InitWidgetLoader()
[08/19/2013 - 05:11:16PM] SOS Maintenance: loaded version is 2.030100
[08/19/2013 - 05:11:16PM] SOS Maintenance: 2.030100 is update
[08/19/2013 - 05:11:16PM] SOS UpdateKnownRaces: updating quickreference of races supported by currently loaded SOS addons
[08/19/2013 - 05:11:18PM] ERROR: File "mslVampiricThirst.esp" does not exist or is not currently loaded.
stack:
	<unknown self>.Game.GetFormFromFile() - "<native>" Line ?
	[RaceCompatibilityInitQuest (08002859)].YARC_InitQuestScript.onBeginState() - "YARC_InitQuestScript.psc" Line 182
	[RaceCompatibilityInitQuest (08002859)].YARC_InitQuestScript.GotoState() - "Form.psc" Line ?
	[RaceCompatibilityInitQuest (08002859)].YARC_InitQuestScript.initialize() - "YARC_InitQuestScript.psc" Line 131
	[RaceCompatibilityInitQuest (08002859)].YARC_InitQuestScript.OnUpdate() - "YARC_InitQuestScript.psc" Line 23
[08/19/2013 - 05:11:33PM] ERROR: Cannot call GetAnimationByName() on a None object, aborting function call
stack:
	[alias PlayerRef on quest SexLabAbusedPlayer (33000D62)].SexLabAbusedPlayer.RapeMe() - "SexLabAbusedPlayer.psc" Line 70
	[alias PlayerRef on quest SexLabAbusedPlayer (33000D62)].SexLabAbusedPlayer.OnHit() - "SexLabAbusedPlayer.psc" Line 39
[08/19/2013 - 05:11:33PM] ERROR: Cannot call GetAnimationByName() on a None object, aborting function call
stack:
	[alias PlayerRef on quest SexLabAbusedPlayer (33000D62)].SexLabAbusedPlayer.RapeMe() - "SexLabAbusedPlayer.psc" Line 71
	[alias PlayerRef on quest SexLabAbusedPlayer (33000D62)].SexLabAbusedPlayer.OnHit() - "SexLabAbusedPlayer.psc" Line 39
[08/19/2013 - 05:11:33PM] ERROR: Cannot call SortActors() on a None object, aborting function call
stack:
	[alias PlayerRef on quest SexLabAbusedPlayer (33000D62)].SexLabAbusedPlayer.RapeMe() - "SexLabAbusedPlayer.psc" Line 72
	[alias PlayerRef on quest SexLabAbusedPlayer (33000D62)].SexLabAbusedPlayer.OnHit() - "SexLabAbusedPlayer.psc" Line 39
[08/19/2013 - 05:11:33PM] ERROR: Cannot call StartSex() on a None object, aborting function call

 

 

 

What have I done correctly with the OnEffectStart event but not with the OnHit event?

Posted

You didn't set "SexLabFramework Property SexLab Auto" in second script (the one that doesn't work).

 

P.S:

Game.GetPlayer() function is slow. Don't call it so often.

 

Posted

That looks OK.

 

Only other thing I can think of is you need a clean save or start a new game. I get something like that sometimes when old scripts/quests/etc get stuck inside my save file.

 

 

Posted

Well... My first order of business... I need to figure out how to make a list of the animations I want to test this... Ugh... here I go again.  Big Amazing Plans... little itty bitty knowledge of what the hell I'm doing.  It's kind of like trying to build a Sky Scraper with 200 Lego's.

Posted

I've found out why my first script didn't worked:

If you attach a script to a quest with the very same name it will break the script forever, you have to go back to an older savegame or start a new game.

 

Bottom line:

Never ever give a quest (and properly everything else you can attach a script to) the same name as one of your scripts!

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...