Psalam Posted May 25, 2020 Posted May 25, 2020 I have done all of my mods with script fragments. The one in particular that I use the most simply calls SexLab Framework. I have included it in the spoiler below. Is there a simple and straightforward way to convert this into a script. Spoiler ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 Scriptname FuckCynthia03 Extends TopicInfo Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE SexLab.QuickStart(akSpeaker, PlayerRef) ;END CODE EndFunction ;END FRAGMENT For reference, I want to do this because it would make using multiple dialog responses easier.
DocClox Posted May 25, 2020 Posted May 25, 2020 Take the comments out, change it to extend a quest (or whatever you have in mind) and you're pretty much done. Scriptname FuckScript Extends Quest actor property playerref auto Function FuckWhoever(Actor whoever) SexLab.QuickStart(whoever, PlayerRef) EndFunction Oh yeah - needs an explicit playerref property. Attach it to a quest and make sure the property is filled. Job done.
Psalam Posted May 25, 2020 Author Posted May 25, 2020 17 minutes ago, DocClox said: Take the comments out, change it to extend a quest (or whatever you have in mind) and you're pretty much done. Scriptname FuckScript Extends Quest actor property playerref auto Function FuckWhoever(Actor whoever) SexLab.QuickStart(whoever, PlayerRef) EndFunction Oh yeah - needs an explicit playerref property. Attach it to a quest and make sure the property is filled. Job done. Not to put too fine a point on it. This is the script fragment I put at the end of the dialog which then results in sex. So, extends Quest should be fine (since the dialog is in a quest) but I understood that using akSpeaker (the NPC to whom I'm talking) won't work in a script. Am I wrong?
DocClox Posted May 25, 2020 Posted May 25, 2020 6 minutes ago, Psalam said: but I understood that using akSpeaker (the NPC to whom I'm talking) won't work in a script. Am I wrong? Right. So hence the "whoever" parameter. So if you wanted to call it from a dialogue fragmant, you'd do something like this in a dialogue fragment. quest q = getOwningQuest() fuckscript fs = q as fuckscript fuckscript.fuckWhoever(akspeaker)
Psalam Posted May 25, 2020 Author Posted May 25, 2020 4 minutes ago, DocClox said: Right. So hence the "whoever" parameter. So if you wanted to call it from a dialogue fragmant, you'd do something like this in a dialogue fragment. quest q = getOwningQuest() fuckscript fs = q as fuckscript fuckscript.fuckWhoever(akspeaker) What I would like to continue to do is, in the dialog box in the CK there is a place to put a script or script fragment to be performed after the dialog is complete. This is what I've done with the script fragments. You can, as I'm sure you know, instead pull a script from the complete list of available scripts. However, script fragments are not included in that list - only scripts. So, as things now stand, I basically have to rewrite the fragment for any new dialog choice I add. Completely doable but it seems tedious and time-consuming. I would like to make a script so that I could simply add it from the dropdown list after making a new dialog choice and cutting down on the work.
worik Posted May 25, 2020 Posted May 25, 2020 23 minutes ago, Psalam said: So, as things now stand, I basically have to rewrite the fragment for any new dialog choice I add. Completely doable but it seems tedious and time-consuming. I would like to make a script so that I could simply add it from the dropdown list after making a new dialog choice and cutting down on the work. Is it always the same thing that your fragments are doing? ? In that case go with the universal script => attach to a quest and pass everything that's relevant as properties. If they differ in slight details, I would try to add a controlling property and branch in simple IF statements If they differ in bigger details, I'd use functions in the script to call thing that I need. Are we talking about your Cynthia mod? I could unpack that bsa later today and peek a bit inside for some ideas?
Psalam Posted May 25, 2020 Author Posted May 25, 2020 8 minutes ago, worik said: Is it always the same thing that your fragments are doing? ? In that case go with the universal script => attach to a quest and pass everything that's relevant as properties. If they differ in slight details, I would try to add a controlling property and branch in simple IF statements If they differ in bigger details, I'd use functions in the script to call thing that I need. Are we talking about your Cynthia mod? I could unpack that bsa later today and peek a bit inside for some ideas? The fragment above (as you might be able to see from it's name) is from the Cynthia mod - so there's no need to bother to unpack it. You have hit exactly what I was aiming for, a universal script that will do what all these fragments are doing. The question is, how, exactly, given the differences between a fragment and a script, do I do it?
DocClox Posted May 25, 2020 Posted May 25, 2020 2 hours ago, Psalam said: So, as things now stand, I basically have to rewrite the fragment for any new dialog choice I add. Completely doable but it seems tedious and time-consuming. Can't you just cut and past SexLab.QuickStart(akSpeaker, PlayerRef) into each fragment? It's probably no more work than picking a script from a drop down. Or am I still missing the point?
Psalam Posted May 25, 2020 Author Posted May 25, 2020 4 minutes ago, DocClox said: Can't you just cut and past SexLab.QuickStart(akSpeaker, PlayerRef) into each fragment? It's probably no more work than picking a script from a drop down. Or am I still missing the point? That is EXACTLY how I'm doing it. However, as you are also aware, you have some other things that are required for the fragment (identifying properties, etc.) that are also time consuming. I am more than willing to accept that doing the tedious job of making a fragment for each dialog choice IS the easier, softer way. I was just looking to see if I had another alternative. That is, an easier alternative. If not, then cut and paste it will continue to be.
DocClox Posted May 25, 2020 Posted May 25, 2020 Well, assuming you're always having the player in the scene, the only thing that needs to be done is identifying the actor that's going to tale the other role. That's set up for you as kaSpeker, so you could probably have a global function in a quest that did a Game.GetPlayer() so you only needed to pass one argument. But that's not really much of a saving over SexLab.QuickStart, so unless there's other bookkeeping you want to add to the function, I'd stick with the copy and paste. That said, you could try inheriting the script from TopicInfo , at which point it'll probably appear in the dropdowns. But the syntax of associating the function with a particular fragment is not really documented and can be very fragile. In my experience it's more trouble than it's worth, but maybe someone else has got it to work. If so I'd be interested to hear about it myself.
Psalam Posted May 25, 2020 Author Posted May 25, 2020 43 minutes ago, DocClox said: Well, assuming you're always having the player in the scene, the only thing that needs to be done is identifying the actor that's going to tale the other role. That's set up for you as kaSpeker, so you could probably have a global function in a quest that did a Game.GetPlayer() so you only needed to pass one argument. But that's not really much of a saving over SexLab.QuickStart, so unless there's other bookkeeping you want to add to the function, I'd stick with the copy and paste. That said, you could try inheriting the script from TopicInfo , at which point it'll probably appear in the dropdowns. But the syntax of associating the function with a particular fragment is not really documented and can be very fragile. In my experience it's more trouble than it's worth, but maybe someone else has got it to work. If so I'd be interested to hear about it myself. Regardless, thank you for all your help.
Scrab Posted May 25, 2020 Posted May 25, 2020 The drop down menu actually does show hidden scripts, you just need to tick that "Show Hidden" box I was wondering the same thing a few days back and didnt come to a satisfying conclusion to it either. I tried to just put in the topic info script (by that I mean the scripts that contain the fragments) from a previous topic info but realized the obvious: Topic Info Scripts extend a specific topic info ID, not the topic info theyre attached to. So copy & pasting them doesnt help, you had to change the headline of those scripts every time you choose that script from the dropdown menu to extend the specific Topic Info that you want to use that script on (I dont know if what I wrote makes sense I hope you can follow anyway).. which isnt exactly less work Searching the script alone takes forever as there are a few thousand of those hidden TIF scripts. Even if you wouldnt have to change the header everytime you insert that script, due to how slow the CK is, searching that script in the dropdown menu would use up more time than simply creating a new one from scratch.. I mean you could technically also just remove the hidden flag but that doesnt solve the above issue.. and even loading up all the non hidden scripts can take a while What I ended up doing was simply copying the entire topic info. That way, a new, identical TIF Script is created extending the correct Topic Info with all properties filled. All you have to do then is (re)writing the dialogue and moving the whole topic info into the correct branche
Fotogen Posted May 25, 2020 Posted May 25, 2020 No, there is no faster way to do it. As in "less work". There is better, that doesn't take much more work. Sort of. What I like: - i like to have "start sex" centralized. Only one function. So its easier to change it, if I want different, better animation. More context sensitive. - start sex with "keyword" quest. Keyword.SendStoryEvent(Actor1, Actor2, intParam1, intParam2) - two actors and 2 optional parameters that can "describe" which anim I want - it takes extra time to create that "keyword", "script quest", but once you have it, its reusable - in dlg topic, you then select script file, properties, add a keyword, fill it, in script fragment you type: that_kwd_name.SendStoryEvent(akSpeaker, <whatever>, an_int_value) ; add param2 required - an_int_value is like: 0 - whatever, 1 - want blowjob, 2 - nice stuff, 3 - you on top, 4 - don't want Sexlab, but want Zaz stuff, 5 - run forest run, ...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.