learnedcock Posted May 12, 2016 Posted May 12, 2016 I'm working on a mod that includes a temple to Molag Bal where the player can perform a sex ritual. The idea is that if the player is in the ritual circle and rapes the same NPC some number of times, he will get the ability to summon an avatar of Molag Bal some number of times (number of times tracked by the global variable). I have the following attached to a trigger volume: ScriptName MolagBalTempleSexRitual Extends ObjectReference ObjectReference Property oRitualLightFX auto SexLabFramework Property SexLab auto Bool Property IsPlayerInRitualCircle auto Actor Property PlayerRef auto Actor Property myVictim auto Int Property iRapeCount auto Int Property iTargetRapeCount auto Int Property iPlayerSexCountStart auto Int Property iPlayerSexCountNew auto Bool Property PlayerHasBlessing auto Spell Property MolagBalRapeBlessing auto GlobalVariable Property gRewardSpellCount auto Event OnTriggerEnter(ObjectReference akActionRef) PlayerRef = Game.GetPlayer() If akActionRef == PlayerRef IsPlayerInRitualCircle = True iRapeCount = 0 iTargetRapeCount = 3 iPlayerSexCountStart = SexLab.SexCount(PlayerRef) Debug.Notification("Ritual triggered") Debug.Notification("SexCount Start: " + (iPlayerSexCountStart as String)) RegisterForSingleUpdate(3.0) EndIf EndEvent Event OnTriggerLeave(ObjectReference akActionRef) If akActionRef == PlayerRef IsPlayerInRitualCircle = False Debug.Notification("Player left ritual circle") If (iRapeCount >= iTargetRapeCount && PlayerHasBlessing == False) GrantMolagBlessing() EndIf If oRitualLightFX.IsEnabled() oRitualLightFX.Disable(True) EndIf EndIf EndEvent Event OnUpdate() iPlayerSexCountNew = SexLab.SexCount(PlayerRef) Debug.Notification("New SexCount: " + (iPlayerSexCountNew as String)) If iPlayerSexCountNew > iPlayerSexCountStart iPlayerSexCountStart = iPlayerSexCountNew Actor myLastPartner = SexLab.LastSexPartner(PlayerRef) myVictim = SexLab.LastVictim(PlayerRef) If myLastPartner == myVictim iRapeCount += 1 oRitualLightFX.Enable(True) String sRapeCount = iRapeCount as String String sTargetRapeCount = iTargetRapeCount as String Debug.Notification("Ritual progress: " + sRapeCount + " of " + sTargetRapeCount) EndIf EndIf If (iRapeCount >= iTargetRapeCount && PlayerHasBlessing == False) oRitualLightFX.Disable(True) GrantMolagBlessing() EndIf If IsPlayerInRitualCircle == True RegisterForSingleUpdate(3.0) EndIf EndEvent Function GrantMolagBlessing() Debug.Notification("You have pleased Molag Bal.") If !(PlayerRef.HasSpell(MolagBalRapeBlessing)) PlayerRef.AddSpell(MolagBalRapeBlessing) EndIf gRewardSpellCount.SetValue(gRewardSpellCount.GetValue() + 3) PlayerHasBlessing = True EndFunction I've been trying to debug it, and iPlayerSexCountNew never changes from 0, which means nothing can proceed. This is my first attempt scripting with SexLab functions, I can't figure out why it's not tracking the player's sex acts. Am I supposed to fill the SexLab property with something in the CK? Thanks.
Delzaron Posted May 13, 2016 Posted May 13, 2016 Add "conditional" at the end of your Int properties. For increase a variable value, you need to do something like this : Int Property Staue auto conditional Function EvaluateStatue(enq) Statue += enq If statue = 1 effect endIf Endfunction And when you want to increase your variable, you use : (Quest as QuestScript).EvaluateStatue(1) (it will add 1) Or (Quest as QuestScript).EvaluateStatue(-1) (it will remove 1)
Krupnokalibernaya Posted May 14, 2016 Posted May 14, 2016 Add "conditional" at the end of your Int properties. For increase a variable value, you need to do something like this : Int Property Staue auto conditional Function EvaluateStatue(enq) Statue += enq If statue = 1 effect endIf Endfunction And when you want to increase your variable, you use : (Quest as QuestScript).EvaluateStatue(1) (it will add 1) Or (Quest as QuestScript).EvaluateStatue(-1) (it will remove 1) Hi, I wonder how many programming background do I need if I want to mod Skyrim, if I have only done introductory java
Delzaron Posted May 14, 2016 Posted May 14, 2016 Add "conditional" at the end of your Int properties. For increase a variable value, you need to do something like this : Int Property Staue auto conditional Function EvaluateStatue(enq) Statue += enq If statue = 1 effect endIf Endfunction And when you want to increase your variable, you use : (Quest as QuestScript).EvaluateStatue(1) (it will add 1) Or (Quest as QuestScript).EvaluateStatue(-1) (it will remove 1) Hi, I wonder how many programming background do I need if I want to mod Skyrim, if I have only done introductory java I had no skills in informatics...
Krupnokalibernaya Posted May 14, 2016 Posted May 14, 2016 Add "conditional" at the end of your Int properties. For increase a variable value, you need to do something like this : Int Property Staue auto conditional Function EvaluateStatue(enq) Statue += enq If statue = 1 effect endIf Endfunction And when you want to increase your variable, you use : (Quest as QuestScript).EvaluateStatue(1) (it will add 1) Or (Quest as QuestScript).EvaluateStatue(-1) (it will remove 1) Hi, I wonder how many programming background do I need if I want to mod Skyrim, if I have only done introductory java I had no skills in informatics... Thanks
Recommended Posts
Archived
This topic is now archived and is closed to further replies.