egon123 Posted December 25, 2016 Posted December 25, 2016 Hello everyone! I was working on my mod and encountered some problems. I tried, when an animation is started to give the actors some faction which will open a new dialogue. Basically that the npc remembers the sex and you can address it. For that I wrote an detection script. But sex isn't just sex. There are many variables. Was the Player an actor? Was an creature involved? Was it rape or not? Creature I solved in my test script. But Player and Rape gets more tricky. First the script as it is now: Scriptname Tif__SelfHook extends Quest;---------------------------------------SexLabFramework property SexLab autoFaction Property DogFaction AutoTif__SelfDialogueMain Property SelfMain AutoActor Property PlayerRef Auto;----------------------------------------------------------event OnInit()RegisterForModEvent("StageStart", "StartMessage")endEventevent StartMessage(string eventName, string argString, float argNum, form sender)actor[] actorList = SexLab.HookActors(argString)int stage = SexLab.HookStage(argString)String spieler0 = actorList[0].GetLeveledActorBase().GetName()String spieler1 = actorList[1].GetLeveledActorBase().GetName()String spieler2 = actorList[2].GetLeveledActorBase().GetName()actor Actor1 = actorList[0] as actoractor Actor2 = actorList[1] as actoractor Actor3 = actorList[2] as actorint CreaZahl = SexLab.CreatureCount(actorList)If Actor1.IsInFaction(DogFaction)if (Actor2.GetActorBase().GetSex() == 1) && (Actor2 != playerref)SelfMain.FuByDog(actor2)Endifif (Actor3.GetActorBase().GetSex() == 1) && (Actor3 != playerref)SelfMain.FuByDog(actor3)Endifif (Actor2.GetActorBase().GetSex() == 1) && (Actor2 == playerref)SelfMain.FuByDogPlayer(actor2)SelfMain.FuByDogPlayerMarker(actor2)SelfMain.FuByDogMarkerPlayerD(actor1)Endifif (Actor3.GetActorBase().GetSex() == 1) && (Actor3 == playerref )SelfMain.FuByDogPlayer(actor3)SelfMain.FuByDogPlayerMarker(actor3)SelfMain.FuByDogMarkerPlayerD(actor1)EndifEndifIf Actor2.IsInFaction(DogFaction)if (Actor1.GetActorBase().GetSex() == 1) && (Actor1 != playerref)SelfMain.FuByDog(actor1)Endifif (Actor3.GetActorBase().GetSex() == 1) && (Actor3 != playerref)SelfMain.FuByDog(actor3)Endifif (Actor1.GetActorBase().GetSex() == 1) && (Actor1 == playerref)SelfMain.FuByDogPlayer(actor1)SelfMain.FuByDogPlayerMarker(actor1)SelfMain.FuByDogMarkerPlayerD(actor2)Endifif (Actor3.GetActorBase().GetSex() == 1) && (Actor3 == playerref)SelfMain.FuByDogPlayer(actor3)SelfMain.FuByDogPlayerMarker(actor3)SelfMain.FuByDogMarkerPlayerD(actor2)EndifEndifIf Actor3.IsInFaction(DogFaction)if (Actor1.GetActorBase().GetSex() == 1) && (Actor1 != playerref)SelfMain.FuByDog(actor1)Endifif (Actor2.GetActorBase().GetSex() == 1) && (Actor2 != playerref)SelfMain.FuByDog(actor2)Endifif (Actor1.GetActorBase().GetSex() == 1) && (Actor1 == playerref)SelfMain.FuByDogPlayer(actor1)SelfMain.FuByDogPlayerMarker(actor1)SelfMain.FuByDogMarkerPlayerD(actor3)Endifif (Actor2.GetActorBase().GetSex() == 1) && (Actor2 == playerref )SelfMain.FuByDogPlayer(actor2)SelfMain.FuByDogPlayerMarker(actor2)SelfMain.FuByDogMarkerPlayerD(actor3)EndifEndifEndEvent My questions: 1) How can I check if one of the actors is the player? I tried it with "...&& (Actor2 == playerref )" and for not "...&& (Actor2 != playerref )" For NPCs it worked. But with the player not. So I guess "...&& (Actor2 == playerref )" returns 0. Seems like the wrong way to detect it. Someone got an idea? 2) How can I check if an actor is a Victim? Or if the animation counts as rape? Basically, I need a way to ask sexlab this but I don't know how. Without that the whole script becomes useless. I hope someone with more experience can help me with that
vpoteryaev Posted December 25, 2016 Posted December 25, 2016 Hello everyone! I was working on my mod and encountered some problems. I tried, when an animation is started to give the actors some faction which will open a new dialogue.... 1) How can I check if one of the actors is the player? I tried it with "...&& (Actor2 == playerref )" and for not "...&& (Actor2 != playerref )" For NPCs it worked. But with the player not. So I guess "...&& (Actor2 == playerref )" returns 0. Seems like the wrong way to detect it. Someone got an idea? 2) How can I check if an actor is a Victim? Or if the animation counts as rape? Basically, I need a way to ask sexlab this but I don't know how. Without that the whole script becomes useless. I hope someone with more experience can help me with that Current SexLab has events "Hook<EventType>", i.e. "HookAnimationStart"... Handler for this events has two parameters: RegisterForModEvent("HookAnimationStart", "AnimationStartHandler") .... function AnimationStartHandler(int tid, bool HasPlayer) ... endfunction Parameter "HasPlayer" is self-explanatory. Via SexLab.GetController(tid) you receive current thread with ability to get actors, participating in animation (to check which is victim etc.) or everything you may need. If you need to track every animation where player is envolved, use always available "PlayerTrack_<EventName>" events RegisterForModEvent("PlayerTrack_End", "MyPlayerSexEndHandler") ... function MyPlayerSexEndHandler(form akActor, int tid) ... endfunction You has mentioned a faction. To track a faction's members animations: SexLab.TrackFaction(MyFaction, "MyFactionTrack") RegisterForModEvent("MyFactionTrack_End", "MyFactSLEnd") ... function MyFactSLEnd(form akActor, int tid) ... endfunction See "SexLabFramework.psc", Ashal provided in comments great explanations about every function. Just a small note: in your example you used "RegisterForModEvent" inside OnInit event. It's OK if your quest is started after each game load. In other cases you wil not catch events because RegisterForModEvent must be used on EVERY game load. Kind Regards
egon123 Posted December 27, 2016 Author Posted December 27, 2016 Hello everyone! I was working on my mod and encountered some problems. I tried, when an animation is started to give the actors some faction which will open a new dialogue....1) How can I check if one of the actors is the player? I tried it with "...&& (Actor2 == playerref )" and for not "...&& (Actor2 != playerref )" For NPCs it worked. But with the player not. So I guess "...&& (Actor2 == playerref )" returns 0. Seems like the wrong way to detect it. Someone got an idea? 2) How can I check if an actor is a Victim? Or if the animation counts as rape? Basically, I need a way to ask sexlab this but I don't know how. Without that the whole script becomes useless. I hope someone with more experience can help me with that Current SexLab has events "Hook<EventType>", i.e. "HookAnimationStart"... Handler for this events has two parameters: RegisterForModEvent("HookAnimationStart", "AnimationStartHandler") .... function AnimationStartHandler(int tid, bool HasPlayer) ... endfunction Parameter "HasPlayer" is self-explanatory. Via SexLab.GetController(tid) you receive current thread with ability to get actors, participating in animation (to check which is victim etc.) or everything you may need.If you need to track every animation where player is envolved, use always available "PlayerTrack_<EventName>" events RegisterForModEvent("PlayerTrack_End", "MyPlayerSexEndHandler") ... function MyPlayerSexEndHandler(form akActor, int tid) ... endfunction You has mentioned a faction. To track a faction's members animations: SexLab.TrackFaction(MyFaction, "MyFactionTrack") RegisterForModEvent("MyFactionTrack_End", "MyFactSLEnd") ... function MyFactSLEnd(form akActor, int tid) ... endfunction See "SexLabFramework.psc", Ashal provided in comments great explanations about every function.Just a small note: in your example you used "RegisterForModEvent" inside OnInit event. It's OK if your quest is started after each game load. In other cases you wil not catch events because RegisterForModEvent must be used on EVERY game load.Kind Regards Thank you for the answer and your help. I think I solved it Problem 1 was stupid on my end. The check worked but I gave the wrong actor the faction. So the dialogue condition wasn't true. Problem 2 took me some more work. But I think it works now Had to do much research since I'm not that experienced with scripts. But your post helped me. Especially the pointing to the SexLabFramework.psc. Now I can expand the script Thanks again!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.