Carloss32 Posted October 4, 2014 Posted October 4, 2014 hi im new to scripting & im trying to write a basic scripts that will track the amount of times a beastialty sexual ecnounter has happened and once it reaches a certain count it add a new spell to the player and carry on counting to add the next spell just wondering if anyone has any tips???
aqqh Posted October 4, 2014 Posted October 4, 2014 Miscellaneus>Global add new Global variable - can be short and con constant lets call it SexCounter (no matter how you call it) and you need property for it in your script any time something happens add this line SexCounter.SetValue(SexCounter.Getvalue()+1) then if SexCounter.getvalue() == 10 do something elseif SexCounter.getvalue() == 20 do something more etc
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 Miscellaneus>Global add new Global variable - can be short and con constant lets call it SexCounter (no matter how you call it) and you need property for it in your script any time something happens add this line SexCounter.SetValue(SexCounter.Getvalue()+1) then if SexCounter.getvalue() == 10 do something elseif SexCounter.getvalue() == 20 do something more etc ok this help abit i already have script mostly wrote and working to start the animations with animals, not sure what variables i would need to add ot tie to tho, i would upload script but it says i dont have permission
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 i just want it to activate anytime an animation that has beastiality tag runs it gets 1 count added
aqqh Posted October 4, 2014 Posted October 4, 2014 I would add AnimationEnd hook to sexlab thread. Then an event that would do something each time it receives a hook (increase variable by 1) i got this like this in my mod Sexlab scene actor[] sexActors = new actor[2] sexActors[0] = Alias_Victim.GetReference() as actor sexActors[1] = Alias_BaRap01.GetReference() as actor sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "Aggressive") RegisterForModEvent("AnimationEnd_AQDT", "BR1_PV") SL.StartSex(sexActors, anims, hook="AQDT") And event that does something when it receives a hook Event BR1_PV(string eventName, string argString, float argNum, form sender) BaRapQST.SetStage(122) UnregisterForModEvent("AnimationEnd_AQDT") EndEvent
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 I would add AnimationEnd hook to sexlab thread. Then an event that would do something each time it receives a hook (increase variable by 1) i got this like this in my mod Sexlab scene actor[] sexActors = new actor[2] sexActors[0] = Alias_Victim.GetReference() as actor sexActors[1] = Alias_BaRap01.GetReference() as actor sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "Aggressive") RegisterForModEvent("AnimationEnd_AQDT", "BR1_PV") SL.StartSex(sexActors, anims, hook="AQDT") And event that does something when it receives a hook Event BR1_PV(string eventName, string argString, float argNum, form sender) BaRapQST.SetStage(122) UnregisterForModEvent("AnimationEnd_AQDT") EndEvent sorry even more confused now, im a complete scripting noob sorry your prob making sense in general for those who know sexlab scripting but im just starting out working with it
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 Miscellaneus>Global add new Global variable - can be short and con constant lets call it SexCounter (no matter how you call it) and you need property for it in your script any time something happens add this line SexCounter.SetValue(SexCounter.Getvalue()+1) then if SexCounter.getvalue() == 10 do something elseif SexCounter.getvalue() == 20 do something more etc ok i have set the new globalvariable as a short/constant with 0 as its setting, how would i make it so it picks up a beast animation and adds +1 to the count??
Carabosse Posted October 4, 2014 Posted October 4, 2014 Sexlab allows you to trigger events when specific actions occur with hooks. See the wiki page: http://git.loverslab.com/sexlab/framework/wikis/hook I haven't used them myself but Sexlab also seems to have stat tracking functions. You may be able to get away with just using those to determine things like the number of creature encounters the player has had: http://git.loverslab.com/sexlab/framework/wikis/stat-functions
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 would it be something like this?? if animation.HasTag("Bestiality") SexCounter.SetValue(SexCounter.Getvalue()+1)
aqqh Posted October 4, 2014 Posted October 4, 2014 ok slow version this is how you declare actors for a sexlab scene actor[] sexActors = new actor[2]sexActors[0] = PlayerRef ;actor property for player character - this is what you would most likely needsexActors[1] = Alias_Animal.GetActorRef() ;this is an alias that would be linked to some animal - you would have to set it somewhere. Or use properties instead. then sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "dog") ;this is how you declare what kind of animation you want. SL (call it however you like) is a property for sexlabframework . Dog is a tag if you want canine scene if Alias_Animal would be a dog/wolf. use horse if Alias would be a horse etc. RegisterForModEvent("AnimationEnd_Beastess", "BR1_PV") ;this is telling the game that from this point on it is supposed to be ready to send an information about something that is happening to other scripts. AnimationEnd meant it is supposed to send this info when sexlab animation ends. Beastess is your hook (again call it however you like), by that "BR1_PV" you telll the game which event is supposed to receive this info - again call it however you like tho i would use something that makes sense to you and would let you recognize it later. To me "BR1_PV" means 1 bandit rapist on player victim. SL.StartSex(sexActors, anims, hook="Beastess") ;this would start "action" Then event whatever you wrote instead of that "BR1_PV" write it here as well. Event BR1_PV(string eventName, string argString, float argNum, form sender) BaRapQST.SetStage(122) ; for you it would be that SexCounter.SetValue(SexCounter.Getvalue()+1) here instead UnregisterForModEvent("AnimationEnd_Beastess") ;this informs the game that it should stop sending infos - because you no longer need themEndEvent
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 Sexlab allows you to trigger events when specific actions occur with hooks. See the wiki page: http://git.loverslab.com/sexlab/framework/wikis/hook I haven't used them myself but Sexlab also seems to have stat tracking functions. You may be able to get away with just using those to determine things like the number of creature encounters the player has had: http://git.loverslab.com/sexlab/framework/wikis/stat-functions yea iv looked into hooks but they just confuse me, i hate scripting but really want to get this done so once the beastiality sex count reaches each marker a new spell is learnt
Carabosse Posted October 4, 2014 Posted October 4, 2014 I believe that the Sexlab MCM page includes a stat for number of times the player has had happytime with creatures (under sex diary? can't check atm no skyrim). Maybe you could copy how it returns that value in the MCM script and add it as an addendum to wherever you fire an animation then run your logic to determine which spell gets applied based on that value.
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 ok slow version this is how you declare actors for a sexlab scene actor[] sexActors = new actor[2] sexActors[0] = PlayerRef ;actor property for player character - this is what you would most likely need sexActors[1] = Alias_Animal.GetActorRef() ;this is an alias that would be linked to some animal - you would have to set it somewhere. Or use properties instead. then sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "dog") ;this is how you declare what kind of animation you want. SL (call it however you like) is a property for sexlabframework . Dog is a tag if you want canine scene if Alias_Animal would be a dog/wolf. use horse if Alias would be a horse etc. RegisterForModEvent("AnimationEnd_Beastess", "BR1_PV") ;this is telling the game that from this point on it is supposed to be ready to send an information about something that is happening to other scripts. AnimationEnd meant it is supposed to send this info when sexlab animation ends. Beastess is your hook (again call it however you like), by that "BR1_PV" you telll the game which event is supposed to receive this info - again call it however you like tho i would use something that makes sense to you and would let you recognize it later. To me "BR1_PV" means 1 bandit rapist on player victim. SL.StartSex(sexActors, anims, hook="Beastess") ;this would start "action" Then event whatever you wrote instead of that "BR1_PV" write it here as well. Event BR1_PV(string eventName, string argString, float argNum, form sender) BaRapQST.SetStage(122) ; for you it would be that SexCounter.SetValue(SexCounter.Getvalue()+1) here instead UnregisterForModEvent("AnimationEnd_Beastess") ;this informs the game that it should stop sending infos - because you no longer need them EndEvent ty this helps alot, sorry just a couple more questions, if i wanted this to be for all animals would i write a Alias_Horse, Alias_Wolf, Alias_Troll ect and rewrite the entire hook for all the alias list?? would i put those alias in the usual quest/aliases section and link it to each animal???
aqqh Posted October 4, 2014 Posted October 4, 2014 no idea how would sexlab react if you would use one alias for all kinds of animals. sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "dog") instead of that dog you would have to use some tag which would tell sexlab what you want from it to do. You would have to find list of sexlab tags for animal scenes (i've seen it somewhere here on LL) and find something suitable. If there is something suitable. I dont know tbh.
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 no idea how would sexlab react if you would use one alias for all kinds of animals. sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "dog") instead of that dog you would have to use some tag which would tell sexlab what you want from it to do. You would have to find list of sexlab tags for animal scenes (i've seen it somewhere here on LL) and find something suitable. If there is something suitable. I dont know tbh. this is what i got so far actor[] sexActors = new actor[2] sexActors[0] = PlayerRef sexActors[1] = Alias_Horse.GetActorRef() sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "horse") RegisterForModEvent("AnimationEnd_Beastess", "Beastialty") SL.StartSex(sexActors, anims, hook="Beastess") Event Beastiality(string eventName, string argString, float argNum, form sender) SexCounter.SetValue(SexCounter.Getvalue()+1) UnregisterForModEvent("AnimationEnd_Beastess") EndEvent This is my script errors Starting 1 compile threads for 1 files... Compiling "Beastessquest"... C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Beastessquest.psc(666,20): no viable alternative at input 'new' C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Beastessquest.psc(666,29): required (...)+ loop did not match anything at input '[' C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Beastessquest.psc(666,8): Unknown user flag actor C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Beastessquest.psc(670,27): no viable alternative at input 'SL' C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Beastessquest.psc(670,29): required (...)+ loop did not match anything at input '.' C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Beastessquest.psc(670,19): Unknown user flag SL No output generated for Beastessquest, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on Beastessquest
Carloss32 Posted October 4, 2014 Author Posted October 4, 2014 no idea how would sexlab react if you would use one alias for all kinds of animals. sslBaseAnimation[] anims = SL.GetAnimationsByTags(2, "dog") instead of that dog you would have to use some tag which would tell sexlab what you want from it to do. You would have to find list of sexlab tags for animal scenes (i've seen it somewhere here on LL) and find something suitable. If there is something suitable. I dont know tbh. would you add this as a property to the scripts?? if so what would you set it as?? sexActors[1] = Alias_Animal.GetActorRef()
Carabosse Posted October 4, 2014 Posted October 4, 2014 Not related to the method you and aqqh were discussing but I had a look at the source for sslconfigmenu to see how it returns creature partners. Under function libraries it declares sslActorStats Stats Then later to return creature partners Stats.GetSkill(StatRef, "Creatures") For StatRef I think you can use Game.GetPlayer() or the player alias ref I may be wrong but I think this is what returns the total number of creature partners the assigned actor ref has had (I'm a complete scripting newbie so take any of my advice with a large pinch of salt )
aqqh Posted October 4, 2014 Posted October 4, 2014 First off it seems you dont have property set for sexlab framework. Close that script - save without compiling - then properties, add property Type: SexLabFramework Name: SL push ok Then find taht property and push edit value. In pick object find SexLabQuestFramework. secondly i got that event in separate script. AQDT_BanditRapeQST extends Quest - is the script that has that that event included AQDT_BanditRapeQSTmain Extends Quest Hidden - is renamed quest fragment script that (among plenty of other stuff) contains those functions to start sexlab scene. thirdly you can add this if SexCounter.getvalue() == 10 do something ... to that event. It would save you the trouble making new one. so Event Beastiality(string eventName, string argString, float argNum, form sender) SexCounter.SetValue(SexCounter.Getvalue()+1) UnregisterForModEvent("AnimationEnd_Beastess") if SexCounter.getvalue() == 10 PlayerRef.AddPerk(perk1) elseif SexCounter.getvalue() == 20 PlayerRef.AddPerk(perk2) ... endif EndEvent
Carloss32 Posted October 5, 2014 Author Posted October 5, 2014 Thank you for all you help i have got it working now
Recommended Posts
Archived
This topic is now archived and is closed to further replies.