Twycross448 Posted April 8, 2015 Share Posted April 8, 2015 Folks, I think I need a little friendly advice here. I made a small modification that adds a 2nd basement to Lakeview Manor, accessible via a trapdoor in the stable. This basement contains 2 animals, a dog and a horse, for some beast loving action whenever the player fancies it. So far, so good. The trapdoor correctly appears when you build the stable, it links correctly to the basement, the 2 animals are there... but the script I wrote seems to not work properly. See, to get it working, I made a quest that is set to start on startup and attached the following script to it: Scriptname FAB_FalkreathBeastSex extends Quest SexLabFramework Property SexLab Auto Actor Property PlayerRef Auto Actor Property FAB_Dog_Bitchlover Auto Actor Property FAB_Horse_MrStuds Auto Message Property FAB_StartBeastSexDog Auto Message Property FAB_StartBeastSexHorse Auto ReferenceAlias Property Animal Auto FAB_FalkreathBeastSex Property QuestScript Auto Event OnActivate(ObjectReference akActionRef) if (Animal.GetActorReference() == FAB_Dog_Bitchlover) Int iButton = FAB_StartBeastSexDog.Show() If iButton == 0 SexLab.QuickStart( PlayerRef, Animal.GetActorReference()) endIf elseif (Animal.GetActorReference() == FAB_Horse_MrStuds) Int iButton = FAB_StartBeastSexHorse.Show() If iButton == 0 SexLab.QuickStart( PlayerRef, Animal.GetActorReference()) endif endif EndEvent And while the script compiles without error, the 2 animals only have their standard interaction (Talk for the dog and Ride for the horse). So I presume I made some kind of mistake in how I attached the script, or maybe even my whole idea is flawed, I don't know. Could anybody maybe shed a helping ray of light on this? Cheers and thank you!448 Link to comment
Veladarius Posted April 8, 2015 Share Posted April 8, 2015 Since they are actors not activators it may not work on them, also the OnActivate event is typically placed on the object itself as that is what is being activated. Probably the easiest way to do this that I can think of is to have dialogue for them to start it and put your scripts to start things there. Link to comment
aqqh Posted April 8, 2015 Share Posted April 8, 2015 first off: ReferenceAlias Property Animal Auto How do you fill this alias? instead of that - make a separate aliases for both creatures and attach a script to each of them Event OnActivate(ObjectReference akActionRef) if akActionRef == PlayerRef Int iButton = FAB_StartBeastSexDog.Show() etc Link to comment
CPU Posted April 8, 2015 Share Posted April 8, 2015 Hello @Twycross448, in your mind, what is the action to start this sex with dog || horse? The player pushes a button? Pulls a chain? Opens a door? If yes, then OnActivate is fine, but you should add it to the Reference of the Activator or the Static inside the cell. If you used a custom static, then you can add it to the main Activator or Static. If you use a standard one, attach the script to the reference inside the cell. If you want to start the sex act in a different way the maybe the OnActivate is not the good event to catch. For example, if you want to start the sex when the player goes inside an area or close to something, then you may want to add a trigger and the evet will be OnTriggerEnter. Link to comment
Twycross448 Posted April 8, 2015 Author Share Posted April 8, 2015 Thank you all for your input. :-) I deeply appreciate it. I will go over what you all said and try different approaches once I have a bit of spare time tomorrow. (Originally wanted to continue today, but something else came up. ^_^" Real Lifetm is a cruel mistress...) @CPU The way I originally wanted to do it was that the player walks up to the animal, hits "E" (Use Object button) and a message box plops up giving the option to either start sex or to walk away. Link to comment
CPU Posted April 8, 2015 Share Posted April 8, 2015 Hi @Twycross448. I don't think the "Use" button (E) is a good idea. Creatures are not objects for the Skyrim engine. You may want to add a dialogue. But I really do not like the idea because it may break other mods (you need to do an unsafe change on the vanilla races to enable dialogues. Dogs are active by default, horses are not.) Use a trigger. It is way more safe. When you will be inside the trigger area, your script can check if the player is close enough and then start the animation. Until the player exists the triggerarea. I can provide an example about how to implement it. Link to comment
Veladarius Posted April 8, 2015 Share Posted April 8, 2015 You can use the animals specifically in dialogue if they are used in an alias and the dialogue references the alias. Link to comment
Twycross448 Posted April 9, 2015 Author Share Posted April 9, 2015 Quick interjection from my side, instead of having the animals present the entire time, would it mayhabs be a viable path to make 2 spells (one for each beast) that summons them, have them fuck the player char and then despawn again? Is that even possible? I mean, I can make a standard summoning spell easy enough, but those despawn after a set time, not once a function (in this case the sexlab function) is finished running. If doable, this would have the additional benefit that it would be usable everywhere, not just down in that basement. Link to comment
CPU Posted April 9, 2015 Share Posted April 9, 2015 It is doable. Create your spell, be sure it is a self/concentration or similar (not targeted). On the magic effect use the function OnEffectStart(Actor a, Actor . In this function first summon the creature (creat.MoveTo(PlayerRef); creat.enable(True)), and then start a sexlab animation using an hook to the end of sex. In the end of sex you can make the creature to disappear. The hook function has to be put in the MagicEffect script. Link to comment
Twycross448 Posted April 9, 2015 Author Share Posted April 9, 2015 Thank you, CPU. I'll look into it tonight. (First need to read up on what the heck hooks actually are and how they work in the Papyrus world... ^_^" I still have so much to learn it isn't even funny. ) Link to comment
CPU Posted April 9, 2015 Share Posted April 9, 2015 Hello. Here a small example script to be attached to the MagicEffect you will create. It has an Hook inside to have the creature disappear when the sex act is completed. SexLabFramework Property SexLab Auto Actor Property PlayerRef Auto Actor Property creature Auto Event OnEffectStart(Actor caster, Actor target) ; Enable the creature creature.MoveTo(PlayerRef) creature.enable(True) Utility.Wait(1.0) ; "Give it time to appear" Actor[] players = new Actor(2) players[0] = PlayerRef players[1] = creature sslThreadModel Thread = SexLab.NewThread() if (Thread.AddActor(players[0]) == -1 || Thread.AddActor(players[1]) == -1) Debug.notification("Cannot assign actor to the sexlab anim") return endIf Thread.DisableBedUse(True) ; "No beds for creatures, just in case" String hook = "EndSexWithCreature" ; "This is the name of the Hook" Thread.SetHook(hook) RegisterForModEvent("OrgasmEnd_" + hook, "TheSexIsCompleted") ; "TheSexIsCompleted is the name of the function that will be called when the Orgasm stage will end" sslThreadController t = Thread.StartThread() ; "Start the animation" EndEvent ; "This function is the event called by the sexlab hook" Event TheSexIsCompleted(string eventName, string argString, float argNum, form sender) ; "Remove the registration" UnregisterForModEvent(eventName) ; "Have the creature to fade away" creature.disable(True) EndEvent Remember to set up the properties. If you want this to happen only in the cell where the creature is defined (you should set the reference to the creature in the cell graphical editor as "is disabled"), you may want to add a condition to the MagicEffect (when you attach it to the spell) like: Player - GetInCell - <name of the cell> == 1.0 K.R., Link to comment
Twycross448 Posted April 9, 2015 Author Share Posted April 9, 2015 Big freaking thanks, CPU. One question though. When I use the script as you posted it (of course with properties set), I get a compilation error. Or better to say, two of them. FABFalkreathDogSex.psc(14,29): mismatched input '(' expecting LBRACKET FABFalkreathDogSex.psc(14,31): required (...)+ loop did not match anything at input ')' If I read that right, something in the line Actor[] players = new Actor(2) isn't to its liking, correct? or is the 2nd number (29 respectively 31) the line number? Link to comment
CPU Posted April 9, 2015 Share Posted April 9, 2015 Sorry, my fault. Replace the line with: Actor[] players = new Actor[2] Edit: I wrote the code directly here in the forum. It was supposed to be just a guidance (also if it is pretty complete as script for your need.) Link to comment
Twycross448 Posted April 9, 2015 Author Share Posted April 9, 2015 I wrote the code directly here in the forum. It was supposed to be just a guidance I honestly couldn't tell. To me, it looked pretty complete. But then again, I probably know more about black holes than I do about Papyrus.... Again, thank you. Link to comment
CPU Posted April 9, 2015 Share Posted April 9, 2015 Feel free to ask anytime. Couple of points: the creature will appear by magic just at the player position. There is a fade but nothing else. Maybe you can "materialize" it to a specific Marker (placed under the ground) and add a little going up translation to make the appearance nicer. The disappear has the same problem. You can make the creature cast a smoke spell to ave the smoke animation and then fade out the creature. But this is more advanced, start with the basics and then you can improve. Cheers. Link to comment
Twycross448 Posted April 10, 2015 Author Share Posted April 10, 2015 Alright, so far, so good. This is the script for the dog as it currently is: Scriptname FAB_FalkreathDogSex extends ActiveMagicEffect SexLabFramework Property SexLab Auto Actor Property PlayerRef Auto Actor Property FABDogBitchlover Auto Event OnEffectStart(Actor akTarget, Actor akCaster) Debug.notification("Script Activated!") ; Enable the creature Game.GetPlayer().PlaceAtMe(FABDogBitchlover,1,false,false) as Actor Utility.Wait(5.0) ; "Give it time to appear" Actor[] players = new Actor[2] players[0] = PlayerRef players[1] = FABDogBitchlover sslThreadModel Thread = SexLab.NewThread() if (Thread.AddActor(players[0]) == -1 || Thread.AddActor(players[1]) == -1) Debug.notification("Cannot assign actor to the sexlab anim") return endIf Thread.DisableBedUse(True) ; "No beds for creatures, just in case" String hook = "EndSexWithBitchlover" ; "This is the name of the Hook" Thread.SetHook(hook) RegisterForModEvent("OrgasmEnd_" + hook, "BitchloverFinished") ; "BitchloverFinished" is the name of the function that will be called when the Orgasm stage will end sslThreadController t = Thread.StartThread() ; "Start the animation" EndEvent ; "This function is the event called by the sexlab hook" Event BitchloverFinished(string eventName, string argString, float argNum, form sender) ; "Remove the registration" UnregisterForModEvent(eventName) ; wait a bit Utility.Wait(5.0) ; "Have the creature to fade away" FABDogBitchlover.disable(True) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) EndEvent Compiles fine, i can learn the spell from the tome, use the spell, the script does fire... but the creature is not spawned correctly (and thus SexLab gives me the error message because it cannot slot an actor that is not present, obviously). This is the corresponding line of the Papyrus.0.log: [04/10/2015 - 01:39:56AM] Error: (D4009AFA): cannot be placed. stack: [ (00000014)].Actor.PlaceAtMe() - "<native>" Line ? [None].FAB_FalkreathDogSex.OnEffectStart() - "FAB_FalkreathDogSex.psc" Line 11 (Note: D4009AFA is the correct ID) Link to comment
CPU Posted April 10, 2015 Share Posted April 10, 2015 You get the error probably because the dog is disabled. You have to enable it first: FABDogBitchlover.enable(True) Utility.wait(1.0) FABDogBitchlover.moveTo(PlayerRef, 60.0 * Math.Sin(PlayerRef.GetAngleZ()), 60.0 * Math.Cos(PlayerRef.GetAngleZ()), PlayerRef.GetHeight() + 15.0) Do not use: Game.GetPlayer(), use directly PlayerRef, way faster. And be sure the FABDogBitchlover property is correctly filled with the Dog Actor. Link to comment
Twycross448 Posted April 10, 2015 Author Share Posted April 10, 2015 Alright. I thought PlaceAtMe would spawn npcs enabled by default. ^_^" Anyways, now it mostly works. The dog is spawned, the sex works, but the despawning does not take place. The reason is that according to the Papyrus.0.log the event "RegisterForModEvent" cannot be called. Here is the full error from the log. [04/10/2015 - 05:03:25PM] ERROR: Unable to call RegisterForModEvent - no native object bound to the script object, or object is of incorrect type stack: [None].FAB_FalkreathDogSex.RegisterForModEvent() - "<native>" Line ? [None].FAB_FalkreathDogSex.OnEffectStart() - "FAB_FalkreathDogSex.psc" Line 29 Does the "no native object" line mean that it can only run on an NPC that is actually placed in the game world and not spawned dynamically or am I misinterpreting it there? o_O? Link to comment
CPU Posted April 10, 2015 Share Posted April 10, 2015 It should work. But if the MagicEffect ends before the sex act ends, then it will automatically unregister. Set the time for the effect to something very long, like 2 minutes. Link to comment
Twycross448 Posted April 11, 2015 Author Share Posted April 11, 2015 Alright. I have set it to 15 minutes, just to be save. ^_^" A quick test seemed to work. So thank you very much for your input in this matter, CPU. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.