WraithSlayer Posted January 30, 2015 Posted January 30, 2015 Just use: SexLabFramework Property SexLab Auto Form[] EquipedItems EquipedItems = SexLab.StripActor(akSpeaker, DoAnimate = true) [...] SexLab.UnStripActor(akSpeaker, EquipedItems) If you're stripping and redressing in different Topic Info scripts, you'll need to store the EquippedItems form somewhere else that can store the variable, most likely your Quest script. Also, I'm not sure if the DoAnimate parameter will override the SexLab MCM settings. You'll have to test it yourself.
Guest Posted January 30, 2015 Posted January 30, 2015 Hi, I had problem using the SexLab stripping. If you do it on two fragments of your dialogue usually I do it this way: Fragment 1 ; Stripping Debug.SendAnimationEvent(PlayerRef, "Arrok_Undress_G1") ; Use G0 if the player is male, but does not really matter myQuest.playerArmor = PlayerRef.getWornForm(32) ; Just the cuirass Utility.wait(0.5) ; Small delay to strip while the animation is playing, you may want to increase this to 1 or 1.5 or 2, depending of your taste PlayerRef.unequipItemSlot(32) In your main quest script you should have a property like: Armor Property playerArmor Auto Fragment 2 ; Redressing Debug.SendAnimationEvent(PlayerRef, "Arrok_Undress_G1") ; Same anim, it does not exist a "dress" animation Utility.wait(0.5) ; Small delay for the animation, you may want to increase this to 1 or 1.5 or 2, depending of your taste PlayerRef.equipItem(myQuest.playerArmor) ; Just the cuirass If you want to strip also the boots and other items you have to do more or less the same with different body parts (http://wiki.tesnexus.com/index.php/Skyrim_bodyparts_number)
chajapa Posted January 30, 2015 Author Posted January 30, 2015 I think your problem is due to the part of the quote I outlined in red, though. If I understand correctly, you modified your CK so you can have the player use more than 80 characters in a line? I don't think Skyrim supports this at all, nor would I recommend using these types of hacks to circumvent CK restrictions. #1 .... thank you, thank you, thank you... for your help. I really appreciate it. And I hope that nowhere in the discussion do I come across as defiant or disbelieving ... I just talk a lot and tend to.... "over explain" things Not really a hack. It's just a setting in the editor ini file. So I look at it more as a built-in adjustment. That being said, it's very possible I'm hitting against the result of increasing it. It just works so well for a single topic... if all I have to do is remember to decrease the line length on topics that will be grouped with others to form a number of choices... that's not so bad. I haven't really found any "official" documentation all of the ini settings. I am a reader though so I wish there was more information on it.
chajapa Posted January 30, 2015 Author Posted January 30, 2015 Just use: SexLabFramework Property SexLab Auto Form[] EquipedItems EquipedItems = SexLab.StripActor(akSpeaker, DoAnimate = true) [...] SexLab.UnStripActor(akSpeaker, EquipedItems) If you're stripping and redressing in different Topic Info scripts, you'll need to store the EquippedItems form somewhere else that can store the variable, most likely your Quest script. Also, I'm not sure if the DoAnimate parameter will override the SexLab MCM settings. You'll have to test it yourself. So... if I put code in the "begin" script fragment and then put code in the "end" script fragment (of the same topic).... is that 2 separate scripts? I can't remember if I've done both before. Right now I don't have a "quest script" I don't think. I mean when I open the quest in CK, if I go to the tab for scripts, it's empty.
WraithSlayer Posted January 30, 2015 Posted January 30, 2015 #1 .... thank you, thank you, thank you... for your help. I really appreciate it. And I hope that nowhere in the discussion do I come across as defiant or disbelieving ... I just talk a lot and tend to.... "over explain" things Not really a hack. It's just a setting in the editor ini file. So I look at it more as a built-in adjustment. That being said, it's very possible I'm hitting against the result of increasing it. It just works so well for a single topic... if all I have to do is remember to decrease the line length on topics that will be grouped with others to form a number of choices... that's not so bad. I haven't really found any "official" documentation all of the ini settings. I am a reader though so I wish there was more information on it. Even though it's just an .INI edit, keep in mind that the CK is used for more games than just Skyrim, and it might be the case that Skyrim's dialogue interface simply can't handle the size of text you're throwing at it.
WraithSlayer Posted January 30, 2015 Posted January 30, 2015 Just use: SexLabFramework Property SexLab Auto Form[] EquipedItems EquipedItems = SexLab.StripActor(akSpeaker, DoAnimate = true) [...] SexLab.UnStripActor(akSpeaker, EquipedItems) If you're stripping and redressing in different Topic Info scripts, you'll need to store the EquippedItems form somewhere else that can store the variable, most likely your Quest script. Also, I'm not sure if the DoAnimate parameter will override the SexLab MCM settings. You'll have to test it yourself. So... if I put code in the "begin" script fragment and then put code in the "end" script fragment (of the same topic).... is that 2 separate scripts? I can't remember if I've done both before. Right now I don't have a "quest script" I don't think. I mean when I open the quest in CK, if I go to the tab for scripts, it's empty. Different fragments in a script share the same scope, and they can both access whatever properties are defined in the script. However, I don't think that defining a local variable in a fragment allows another fragment to access it, so you'd still need to store your EquippedItems form array in an external location. Are you sure you don't have a Quest script yet? We covered conditional script variables earlier, where having a Quest script was a requirement. I'm guessing you might have gone the GlobalVariable route though, and that's fine too. But having a Quest script is useful for a lot of things, so you might want to take the opportunity to make one now and store EquippedItems on it. Just go on the Scripts tab and Add, make sure the script type is Quest. (also toggle the Conditional checkbox if you want to use conditional vars later)
chajapa Posted January 30, 2015 Author Posted January 30, 2015 I haven't gotten my head around the conditional variables yet. I got sidetracked by "what am I making for dinner?", "the satellite dish needs the snow knocked off", and "Aw, crap... Daisy is eating a rodent!"... stuff like that. And after having broken my first mod (GotMilk)... and I think it just needs the over-length lines adjusted... I got a little gun shy about whacking away at yet ANOTHER mod. (I'm working on one called "JUGs"). So I'm not sure what's supposed to go into a main quest file, although I've been reading on how to put functions in it and call them from fragments... just haven't got to actually doing one after my failure to get StripSlots working. OH.... and if I put: form[] EquipedItems into the main quest script, do I need to put something like EquipedItems Property myQuest Auto into the fragment?
WraithSlayer Posted January 30, 2015 Posted January 30, 2015 I haven't gotten my head around the conditional variables yet. I got sidetracked by "what am I making for dinner?", "the satellite dish needs the snow knocked off", and "Aw, crap... Daisy is eating a rodent!"... stuff like that. And after having broken my first mod (GotMilk)... and I think it just needs the over-length lines adjusted... I got a little gun shy about whacking away at yet ANOTHER mod. (I'm working on one called "JUGs"). So I'm not sure what's supposed to go into a main quest file, although I've been reading on how to put functions in it and call them from fragments... just haven't got to actually doing one after my failure to get StripSlots working. Honestly, for now this will do fine: Scriptname YOUR_QUEST_SCRIPT extends Quest Form[] Property EquipedItems Auto You can add more stuff later if you need it, but for now that'll do the job of storing your equippedItems array. Only need to set the properties in your topic info scripts so they can access this Quest script.
WraithSlayer Posted January 30, 2015 Posted January 30, 2015 OH.... and if I put: form[] EquipedItems into the main quest script, do I need to put something like EquipedItems Property myQuest Auto into the fragment? Yes. If you don't define it as a Property, then it's just a local script variable, and other scripts won't be able to access even if they have a valid reference to your Quest script.
chajapa Posted January 30, 2015 Author Posted January 30, 2015 OK... I'm still not getting this. Here's what I have in my main quest script (I'm using a test quest just to try this. It has only the topics needed to practice this) Scriptname shirtoffmain extends Quest SexLabFramework property SexLab auto Actor property PlayerRef auto Form[] Property EquipedItems Auto Form[] EquipedItems ; Your function here function ShirtOff() bool[] strip = new bool[33] ; Strip chest strip[16] = true ; Strip chest secondary strip[26] = true ; Strip our actor of their shirt form[] ActorEquipment = SexLab.StripSlots(PlayerRef, strip) SexLab.StripSlots(PlayerRef, strip) ; Your function end here EndFunction (the ShirtOff function was from an attempt to get StripSlots to work) And this is what I'm trying to compile in the script fragment. ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 Scriptname shirtoff_off_1 Extends TopicInfo Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE ; ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment SexLabFramework Property SexLab Auto EquipedItems Property shirtoffmain Auto and... I get this error when trying to compile it: C:\Games\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\temp\shirtoff_off_1.psc(17,22): unknown type equipeditems C:\Games\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\temp\shirtoff_off_1.psc(17,22): cannot name a variable or property the same as a known type or script No output generated for shirtoff_off_1, compilation failed. The QUEST name is ShirtOffQuest The quest script is called shirtoffmain I hate making it obvious that I don't know what the f..... I'm doing
Guest Posted January 31, 2015 Posted January 31, 2015 Hi, here is some update on your code, after the explanation. ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 Scriptname shirtoff_off_1 Extends TopicInfo Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE ShirtOffQuest.ShirtOff() ; this calls the function ShirtOff from your Quest script ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment SexLabFramework Property SexLab Auto shirtoffmain Property ShirtOffQuest Auto So, to have your script available you need it (not a variable inside) as Property. I used the name ShirtOffQuest inside as the reference to let the auto fill work. Then you can call all the functions inside your quest script like ShirtOffQuest.ShirtOff(). You can also access its variables like ShirtOffQuest.equipeditems[0].getName() For properties you have to: use your script as type of the property (the first word) then write Property then a local name that you will use (cannot be the same, sorry) the the magical Auto keyword As personal recommendation use for the local variable name the exact name of your quest. So you can auto fill it.
Guest Posted January 31, 2015 Posted January 31, 2015 Just a fun note. chajapa, WraithSlayer and me we are in the top 10 for downloads.
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 <lots of things> What's with the SexLab.StripSlots() function? Use SexLab.StripActor() instead as shown in my example above, it's there to make your life easier. Also, are you trying to strip the player? I thought you wanted to strip the NPC, but your code in ShirtOff() seems to be targetting the player. You're defining EquipedItems twice in shirtoffmain! D: This is bad for a whole lot of reasons! Form[] Property EquipedItems Auto Form[] EquipedItems Your property reference in shirtoff_off_1 is wrong. You have the following: EquipedItems Property shirtoffmain Auto You should have the following: shirtoffmain Property ShirtOffMainScript Auto It's always variable type first, then Property declaration, then variable name. Make these changes and compile the script. Next, go into the CK, to the topic info script, Properties window, and bind your ShirtOffMainScript to the ShirtOffQuest. At this point, your topic info script (shirtoff_off_1) has direct access to the shirtoffmain script in ShirtOffQuest, via the ShirtOffMainScript property reference. So you can just do the following in your topic info script: ShirtOffMainScript.EquipedItems = SexLab.StripActor(akSpeaker, DoAnimate = true) ...and the form array will be filled with the items. Then in another fragment, where you redress, call: SexLab.UnStripActor(akSpeaker, ShirtOffMainScript.EquipedItems)
chajapa Posted January 31, 2015 Author Posted January 31, 2015 OK, I changed the main script and removed all the junk I wasn't using. The main quest script (shirtoffmain) now looks like this: Scriptname shirtoffmain extends Quest SexLabFramework property SexLab auto Actor property PlayerRef auto Form[] Property EquipedItems Auto The fragments in the topic compiled without error. That script is shirtoff_off_1 and looks like this: ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 4 Scriptname shirtoff_off_1 Extends TopicInfo Hidden ;BEGIN FRAGMENT Fragment_2 Function Fragment_2(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE ShirtOffMainQuest.EquipedItems = SexLab.StripActor(akSpeaker, DoAnimate = true) ;END CODE EndFunction ;END FRAGMENT ;BEGIN FRAGMENT Fragment_3 Function Fragment_3(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE SexLab.UnStripActor(akSpeaker, ShirtOffMainQuest.EquipedItems) ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment SexLabFramework Property SexLab Auto ShirtOffMain Property ShirtOffMainQuest Auto Now... the lines that are stripping and unstripping will be doing that to akSpeaker which is the NPC. If I want to strip the PLAYER, I can just change those lines to point at akActor? I think in these dialogues, akSpeaker is the NPC and akActor is the player. If I try changing those akSpeaker reference to PlayerRef, I get this error: Starting 1 compile threads for 1 files... Compiling "shirtoff_off_1"... C:\Games\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\shirtoff_off_1.psc(9,51): variable PlayerRef is undefined C:\Games\Steam\SteamApps\common\Skyrim\Data\Scripts\Source\shirtoff_off_1.psc(18,20): variable PlayerRef is undefined No output generated for shirtoff_off_1, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on shirtoff_off_1 Just need to add Actor Property PlayerRef Auto to the fragment? I have that property in the main quest script.... anyways.... Yes if I add that PlayerRef definition to the fragment script, it compiles... but... will it strip my player? THAT.... is the question....
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 Yes: you did everything correctly. However, since you already have a reference to the shirtoffmain script, you don't even need to create a new property for the player in your topic info script, you can just use ShirtoffMainQuest.PlayerRef for the same effect.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 AWESOME! It worked! And the DoAnimate parameter DOES override the SexLab setting. She animates when she strips. The UNstrip doesn't animate but I can live with that. I did the test in a single Topic. Next I have to try it using 2 separate topics and see if I can get it to work. It *should* just be a matter of setting all of the properties and binding them in the second topic and then pasting in the UNstrip code into the fragment box.... right? I might get to test this in a bit, but... getting tired
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 AWESOME! It worked! And the DoAnimate parameter DOES override the SexLab setting. She animates when she strips. The UNstrip doesn't animate but I can live with that. That's intended. The SexLab framework does not have an appropriate animation for unstripping, so the UnStrip() function call doesn't animate the player, at least in the current version of the framework. If I understand CPU74's suggestion earlier, you can use the following line right before your UnStrip() call to manually execute the strip animation on the player, or whichever NPC reference you need: Debug.SendAnimationEvent(PlayerRef, "Arrok_Undress_G1") I did the test in a single Topic. Next I have to try it using 2 separate topics and see if I can get it to work. It *should* just be a matter of setting all of the properties and binding them in the second topic and then pasting in the UNstrip code into the fragment box.... right? Yes. All you have to do for the second topic script is add whatever properties you require.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 If I wasn't fairly sure you have whiskers... I'd plop a big ol' sloppy kiss right on your lips! It WORKS! MUAHahahahahha.... *rubs hands together gleefully* My female player character just walked up to Faendal and said, "Excuse me..."... Faendal: "yes?" Topic2 She: "What do you think of these?" and she strips and puts her hands behind her back Faendal: "Those are WONDERFUL!" and he claps...heheheh Topic3 She: "Thank you!" and she redresses. Faendal: "Awwwww... I don't get to touch 'em?" Topic4 She: "Nope. Not this time. I'm just test driving them." Faendal: "Damn...." That was my test run. I DO have another question now.... If I strip 2 different characters at (or near) the same time, will the variable remember who was wearing what? I mean... will it remember what akSpeaker was wearing AND what PlayerRef was wearing and be able to redress them accordingly?
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 I DO have another question now.... If I strip 2 different characters at (or near) the same time, will the variable remember who was wearing what? I mean... will it remember what akSpeaker was wearing AND what PlayerRef was wearing and be able to redress them accordingly? Nope. You'll need two Form[] arrays in that case, one for the player and another for the NPC. Make sure both the Strip and UnStrip calls for the player are using one variable, and the NPC is using the other variable. If you get your wires crossed you'll just create a mess.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 So in the main quest script I'd need like: Form[] Property MyEquipedItems Auto Form[] Property TheirEquipedItems Auto and then use those appropriately in the fragment code?
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 So in the main quest script I'd need like: Form[] Property MyEquipedItems Auto Form[] Property TheirEquipedItems Auto and then use those appropriately in the fragment code? Correct.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 So.... many... new... possibilities..... In my brain... my mod is getting much bigger than I have time for... hahahha OK... here's my next question... again... all through dialogue.. I'd like to be able to have an NPC equip an item from another mod. I was able to do this in GotMilk by making MilkModNEW.esp a master, but that meant hitting tes5edit every time I touched the file and adding it back in as a master because CK strips esp files from the master list. So... Could I do something like this: bool MMEinstalled = False if Game.GetModbyName("MilkModNEW.esp") != 255 MMEinstalled = True endif ...to check if MilkMod is installed? And if that's ok, then how would I find a particular item and equip it on the NPC I'm talking to? I think I can use akSpeaker.EquipItem (something) to have them equip something, but I'd need to be able to use that MMEinstalled bool as a condition to display the topic, AND... I'd need to know how to refer to the item I want them to equip. In one case, I'd like to try having them equip Lactacid. It's a drinkable item. If I target an NPC in console and then: equipitem <ID of Lactacid> 1, they drink it. It has an effect on the NPC once they drink it, so it's not like I can just make up a name. The effect is from MilkModNEW so ... it would have to be the "actual item" from that mod. In another case, I'd like them to equip a particular piece of ... armor.. from MilkModNEW. That armor piece also has an effect attached to it I think. So... I'm guessing that once I am able to establish that MilkModNEW is installed (MMEinstalled = True) that I would then have to know the actual ID in order to have them equip it. I've seen this as an example of retrieving a FormList: FormList SOS_Factions = Game.GetFormFromFile(0x00000d62, "Schlongs of Skyrim - Core.esm") as FormList ;SOS_Faction ...that was after checking if SoS was installed, of course... Would I be able to do something similar to retrieve an item? **edit ** hmmmm.... reading, reading, reading... something like: Potion MME_Lactacid = Game.GetFormFromFile(0x0002f2f4, "MilkModNEW.esp") As ObjectReference ;get Lactacid from MilkModNEW Armor MME_MobileMilker = Game.GetFormFromFile(0x0002f2f4, "MilkModNEW.esp") As ObjectReference ;get Mobil Milker from MilkModNEW Not sure what Potion would actually be. I know it's consumable and I think it shows up as food in-game. And if those lines are even CLOSE to being valid, this would have to be done WITHIN the check for whether or not MilkModNEW is installed. So, something like this? bool MMEinstalled = False if Game.GetModbyName("MilkModNEW.esp") != 255 Potion MME_Lactacid = Game.GetFormFromFile(0x0002f2f4, "MilkModNEW.esp") As ObjectReference ;get Lactacid from MME Armor MME_MobileMilker = Game.GetFormFromFile(0x0002f2f4, "MilkModNEW.esp") As ObjectReference ;get Mobil Milker from MME MMEinstalled = True endif And if THAT is close to be correct... I'd still need to know if I have to put anything else into the main quest script AND, what I'd have to put in as a property in a topic's script fragment. Am I getting close?
Guest Posted January 31, 2015 Posted January 31, 2015 Hello, if you DON'T want to add a strong dependency to the other mod then the Game.GetFormFromFile(id, "mod) is the correct way. I just don't think they are ObjectReferences (items placed in a cell), probably they are potions or armor. Open with CK the other mod, find them by name or by id, edit them and check what type of object are they. Let's say your 0x0002f2f4 (MME_Lactacid) is a Potion, and your 0x0002f2f4 (MME_MobileMilker) is an Armor. Then your code should be something like: bool MMEinstalled = False Potion MME_Lactacid = Game.GetFormFromFile(0x0002f2f4, "MilkModNEW.esp") Potion ;get Lactacid from MME Armor MME_MobileMilker = Game.GetFormFromFile(0x0002f2f4, "MilkModNEW.esp") As Armor ;get Mobil Milker from MME if (MME_Lactacid && MME_MobileMilker) MMEinstalled = True endif You don't need the mod before, just try to grab the items and check if they are None or they are the valid objects. But for sure you need to cast them to the correct type. Hope this helps.
Guest Posted January 31, 2015 Posted January 31, 2015 Small recommendation. Do not call the mod MilkModNEW.esp (if this mod is made by you.) The day this mod become old and you will do a new one, what will you do? Call it MilkModNEWNEW.exp ??? Use the major version number maybe. Let's say: MilkMod.esp was your original 1.0 version (and then 1.1, 1.2, etc.) The new mod should be called something like MilkMod2.exp (and it will be good for versions 2.0, 2.1, 2.2, etc.) Every time you do HUGE modifications to the mod (restructuring the objects that are provided, for example) then increase the major version. Version 1.3 is: major = 1, minor = 3 Minor versions should be increases for fixes and small enhancements, major versions should be used when you break the full compatibility with the previous version. Sadly not everybody follow a simple rule like this one. Cheers,
chajapa Posted January 31, 2015 Author Posted January 31, 2015 Question 1: If I don't check to see if MilkModNEW.esp is installed... then wouldn't there be an error when I try to GetFormFromFile and it looks for MilkModNEW? Question 2: And now if I want to equip the Potion on an NPC, would I just use: akSpeaker.EquipItem(ShirtOffMainQuest.MME_Lactacid, 1) <--- or is this (MME_Lactacid, 1, false) or (MME_Lactacid, 1, true) I don't know what the "false" and "true" are doing. (I would already have ShirtOffMain Property ShirtOffMainQuest Auto in the fragment) MilkModNEW.esp is Milk ModEconomy by Ed86. The name doesn't change as he changes versions. He took over MilkMod when it was abandoned and renamed it to MilkModNEW.esp. He's done a VERY nice job with it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.