The Man in Black Posted June 4, 2018 Posted June 4, 2018 I'm having a hard time figuring out how to use hooks just from the in-script documentation comments. The parameters are particularly confusing for me -- I'm still beginniner/intermediate when it comes to scripting. I just want to create some pairs of custom events that trigger whenever any sex scene starts and then another when it stops. Thanks.
WaxenFigure Posted June 4, 2018 Posted June 4, 2018 2 hours ago, The Man in Black said: I'm having a hard time figuring out how to use hooks just from the in-script documentation comments. The parameters are particularly confusing for me -- I'm still beginniner/intermediate when it comes to scripting. I just want to create some pairs of custom events that trigger whenever any sex scene starts and then another when it stops. Thanks. I just did exactly that in a mod: You can use it as an example.
The Man in Black Posted June 5, 2018 Author Posted June 5, 2018 2 hours ago, WaxenFigure said: I just did exactly that in a mod: You can use it as an example. Thanks! I don't understand the part about "calling the parent." What does that do?
WaxenFigure Posted June 5, 2018 Posted June 5, 2018 5 hours ago, The Man in Black said: Thanks! I don't understand the part about "calling the parent." What does that do? Standard Object Oriented Programming, when you create a function that extends a parent function you start by calling the parent so the parent gets itself set up first, then you perform your own actions. Take that line out and you get no MCM menu (note the first line of that script "Scriptname _SLAS_MCM extends SKI_ConfigBase ", that's saying this script is extending another script).
The Man in Black Posted June 5, 2018 Author Posted June 5, 2018 15 hours ago, WaxenFigure said: Standard Object Oriented Programming, when you create a function that extends a parent function you start by calling the parent so the parent gets itself set up first, then you perform your own actions. Take that line out and you get no MCM menu (note the first line of that script "Scriptname _SLAS_MCM extends SKI_ConfigBase ", that's saying this script is extending another script). So, do you still need to call parent if you're just extending Quest? I'll explain what I'm trying to do, if that helps. There are two different mods I'm using the hooks for: 1) A mod that checks, whenever a sex scene starts, whether it's aggressive. If so, it will store the victims' current voices, and swap them for one from a custom set of voices. Then swap back the original voice when the scene ends. 2) A mod that lets you engage in a sex ritual for rewards. The hook event needs to gather some data about the actors in the scene when it starts. When it ends, it calculates a score based on data it gathered and send it to another script, which will grant rewards when your score reaches different thresholds. (I'm still not sure whether doing it this way is best or trying to use the track actor functions.)
WaxenFigure Posted June 6, 2018 Posted June 6, 2018 4 hours ago, The Man in Black said: So, do you still need to call parent if you're just extending Quest? I'll explain what I'm trying to do, if that helps. There are two different mods I'm using the hooks for: 1) A mod that checks, whenever a sex scene starts, whether it's aggressive. If so, it will store the victims' current voices, and swap them for one from a custom set of voices. Then swap back the original voice when the scene ends. 2) A mod that lets you engage in a sex ritual for rewards. The hook event needs to gather some data about the actors in the scene when it starts. When it ends, it calculates a score based on data it gathered and send it to another script, which will grant rewards when your score reaches different thresholds. (I'm still not sure whether doing it this way is best or trying to use the track actor functions.) Only if you have a function that is also present in the parent do you need to call the parent version. If you wonder if you need it on a function try it and if it doesn't compile because the parent doesn't have that function then it should be obvious you don't need the call. Mod 1 could use a lot of what I wrote, just change it to perform the voice change instead of change transparency and rebuild the MCM menu part to select the voice (if you allow a selection).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.