Jump to content

The Sexoutng Api (How-To For Modders)


prideslayer

Recommended Posts

Posted

Quick question.  I'm trying to hook into a scene where ActorA is masturbating, but ActorB is dancing, and therefore can't be set to ActorB.  Because global callback notification is cast on ActorB, what's the best way to get notification of this type of scene?  Does it fall back to casting on ActorA when B is empty?

 

I also found I had to set the spellTarget on the unset dancing ActorB, so that I could grab vars during sex.  Because the dancing ActorB isn't actually set to ActorB, their spellTarget NX is empty.  I tried setting them to ActorX just to include them, but have them do nothing.  That didn't work.

Posted

Quick question.  I'm trying to hook into a scene where ActorA is masturbating, but ActorB is dancing, and therefore can't be set to ActorB.  Because global callback notification is cast on ActorB, what's the best way to get notification of this type of scene?  Does it fall back to casting on ActorA when B is empty?

Can you give me an example of this? I don't have any 2p anims in sexout where one side is whacking it and the other is dancing, so in my mind, what you really have are two different acts, (one masturbation, one dance) both using their own independent ActorA. Perhaps the dance animation isn't a sexout act at all and so you only have one act, with actorA?

 

Please explain/clarify.

 

That said, yes, it falls back to actorA. After adding all actors to the mod provided formlists, the hook does a simple check and cast for the notification: "<b>If spunB then B.CIOS elseif spunA then A.CIOS elseif spunC then C.CIOS.</b>"

 

No magic. The do-b-first bit is just a holdover from the early days of NG when I wasn't sure of the performance constraints of these scripts. Since B is usually the player (most sexout mods are fem-oriented), and most acts are 2person, I check for that first and expressed a preference to cast on the actor that is *usually* the player.

 

It's goofy and it will likely change in the future. As long as everyone is checking the NX vars for the spellTarget and then using that ref to check other NX vars, there should be no problem.

 

I also found I had to set the spellTarget on the unset dancing ActorB, so that I could grab vars during sex.  Because the dancing ActorB isn't actually set to ActorB, their spellTarget NX is empty.  I tried setting them to ActorX just to include them, but have them do nothing.  That didn't work.

I'd like you to give me a quick rundown of the script that kicks off the scene, and then I can tell you what's going on and what you should do. I don't really understand quite what you're doing -- spellTarget should (unless I have a bug) be set on every actor involved in an act, all the time.

 

The base effect script sets spelltarget on every involved actor (A-C, X) immediately before doing the global hook:

 

 

    ; Give CIOS token
    if spunTargets > 1
      if (spunA)
        actorA.NX_SetEVFo "Sexout:Start::SpellTarget" self
      endif
      if (spunB)
        actorB.NX_SetEVFo "Sexout:Start::SpellTarget" self
      endif
      if (spunC)
        actorC.NX_SetEVFo "Sexout:Start::SpellTarget" self
      endif
      if (actorX)
        actorX.NX_SetEVFo "Sexout:Start::SpellTarget" self
      endif

      if ((self == actorA) && (1 == spunA))
        AddItem SexoutNGTokenTarget 1 1
      elseif ((self == actorA) && (1 == spunA))
        AddItem SexoutNGTokenTarget 1 1
      elseif ((self == actorC) && (1 == spunC))
        AddItem SexoutNGTokenTarget 1 1
      endif
    endif

    ; Call global callback hooks
    set SexoutNGCallbackQ.actorA to actorA
    set SexoutNGCallbackQ.actorB to actorB
    set SexoutNGCallbackQ.actorC to actorC
    set SexoutNGCallbackQ.isOral to isOral
    set SexoutNGCallbackQ.isVaginal to isVaginal
    set SexoutNGCallbackQ.isAnal to isAnal
    set SexoutNGCallbackQ.spunTargets to spunTargets
    set SexoutNGCallbackQ.spunA to spunA
    set SexoutNGCallbackQ.spunB to spunB
    set SexoutNGCallbackQ.spunC to spunC
    set SexoutNGCallbackQ.animA to animA
    set SexoutNGCallbackQ.animB to animB
    set SexoutNGCallbackQ.animC to animC
    set SexoutNGCallbackQ.bDoCallbacks to 1

 

 

If your code is how I suspect it is, it's not being set because only one actor is being spun -- at the time, it made no sense to set those tracking vars on sex acts only involving a single actor (like masturbation) but I can see how it might be useful.

 

Standing by.

Posted (edited)

Ahhh I see.  I thought it was do B only.  You're correct they're technically two different acts.  The dancer is simply implied as ActorB by the scene, but is not technically included in the act at all (is running a dance effect spell, while ActorA masturbates).  So there is only an ActorA.

 

Problem solved by fallback to actorA.  Kick ass, tyvm.

 

EDIT: I was tricking spellTarget by setting it on the dancer to ActorAs ref.

 

EDIT EDIT: So ActorX doesn't count towards a spun target?  I think I get it now.

Edited by t3589
Guest tomm434
Posted

I read last 2 pages and still confused.

Okay, so checking for spell is the best way to check if actor is involves in sex, right?

So basicly I should do a script like that to double check if actor is involved in sex:

If actorref.isspelltarget SexoutNGBegin ==0
make him start sexout again.
endif

I'm still not sure what spell should I check actor for.

Posted

No, Begin is dispelled after setting a bunch of things.

Atm, the most reliable way is still to do the var04 mask - replacing this with a simple on/off nx var would be a welcome addition to a next update ;)

 

    set var04mask to actorRef.getAV Variable04
    if LogicalAnd var04mask SexoutNG.FlagInUse ; --> sexin'

Posted

@tomm434:  Checking the NX variable for sexout:[um...something]::spelltarget rather than checking if the char is under the effect of the spell.

 

@Everyone:  I'm having a bit of a problem with getting strap-ons to equip and unequip properly.  I'm thinking that it has to do with when Sexout undresses and saves the current clothing/equipment.  That I should probably do a check to make sure that the actor is totally unequipped before force equipping the strap-on.  Or should I not be forcing

equipping/unequipping at all (using the don't allow manual un/equip flag)?  Incidentally, I'm having an un/equip problem in another mod that isn't Sexout related.

Posted

Ahhh I see.  I thought it was do B only.  You're correct they're technically two different acts.  The dancer is simply implied as ActorB by the scene, but is not technically included in the act at all (is running a dance effect spell, while ActorA masturbates).  So there is only an ActorA.

 

Problem solved by fallback to actorA.  Kick ass, tyvm.

 

EDIT: I was tricking spellTarget by setting it on the dancer to ActorAs ref.

 

EDIT EDIT: So ActorX doesn't count towards a spun target?  I think I get it now.

No, X isn't 'spun'. That's a naming throwback to when the early editions of NG were using (simulated) spinlocking to lock the actors. ActorX isn't actually involved in the sex act, so doesn't get locked (spun).

 

What exactly are you trying to accomplish with all this? You have two things going on, right?

 

1. A sexout masturbation scene. ActorA only.

2. A dance animation being played by something else, sexout not involved.

 

What's your goal with the interaction? To stop the dance after sexout finishes, or something else?

Posted

replacing this with a simple on/off nx var would be a welcome addition to a next update ;)

One of many things I intend to do this weekend with a UDF.

Posted

ALL OF THEM!  Or at least the 10 that I deemed worthy of being selectable by the player.  If that's the case, that must be in some script that isn't for the associated token.

 

Or...I guess that those are on the "leave on during sex" formlists, huh?  Hence, I wouldn't have to use the no unequip flag, right?

Posted

@tomm434:  Checking the NX variable for sexout:[um...something]::spelltarget rather than checking if the char is under the effect of the spell.

This is not reliable, do not do this. There are only two 'official' ways to check if an actor is currently in use by sexout or not.

 

1. The Var04 flag as Doc mentioned.

2. The presence of the sexout in use token in their inventory (00SexoutActor).

 

Doing anything else might work now, and might not tomorrow. Official interfaces are the only ones to use if you don't want me to break your mod and not care that I did. ;)

 

@Everyone:  I'm having a bit of a problem with getting strap-ons to equip and unequip properly.  I'm thinking that it has to do with when Sexout undresses and saves the current clothing/equipment.  That I should probably do a check to make sure that the actor is totally unequipped before force equipping the strap-on.  Or should I not be forcing

equipping/unequipping at all (using the don't allow manual un/equip flag)?  Incidentally, I'm having an un/equip problem in another mod that isn't Sexout related.

Do whatever you want to do with their state of undress *before* doing the sexout CIOS. Sexout will then do one of two things depending on the call flags:

 

1. Remove all items that are not in the safe for sex list(s) (there are three -- male, female, unisex). The strapons should all be in there already.

 

2. Remove nothing (don't undress flag set).

Posted

 

 Official interfaces are the only ones to use if you don't want me to break your mod and not care that I did. ;)

 

Aww!  Meanie!  :P

 

Guest tomm434
Posted

nyaalich, prideslayer, thanks. Maybe you will consider adding this to the first post in this thread?

Posted

 

Ahhh I see.  I thought it was do B only.  You're correct they're technically two different acts.  The dancer is simply implied as ActorB by the scene, but is not technically included in the act at all (is running a dance effect spell, while ActorA masturbates).  So there is only an ActorA.

 

Problem solved by fallback to actorA.  Kick ass, tyvm.

 

EDIT: I was tricking spellTarget by setting it on the dancer to ActorAs ref.

 

EDIT EDIT: So ActorX doesn't count towards a spun target?  I think I get it now.

No, X isn't 'spun'. That's a naming throwback to when the early editions of NG were using (simulated) spinlocking to lock the actors. ActorX isn't actually involved in the sex act, so doesn't get locked (spun).

 

What exactly are you trying to accomplish with all this? You have two things going on, right?

 

1. A sexout masturbation scene. ActorA only.

2. A dance animation being played by something else, sexout not involved.

 

What's your goal with the interaction? To stop the dance after sexout finishes, or something else?

 

 

You're spot on.  It's for voyeur sex (private exotic dance).  Works just like you describe.  ActorA plays masturbation anim while dancing actor is not involved in sexout.

 

I've had it working for quite some time so I'm not really 'trying' to get it to work.  I was just making sure I cover all the angles on this special case.  I read 'cast on ActorB' in the OP and figured I better make sure I'm doing this right.

 

I do still have to pass ActorAs ref to the dancing actors spellTarget on sex start, but this works fine imo for such an unorthodox scene.  Though originally it just made sense to try and find a way to assign them special actorship (ActorX) just to get the vars, but not apply any anims.

Posted

Ok, which way do you want the event chain to go? Should the sex scene stop when the dance is over, does the dancer stop when the sex scene is over, or something else?

 

I think you're probably overthinking (and thus overcoding) this.. it should be dead simple, but I want to understand fully so I don't offer up something that won't work. You shouldn't have to mess with spelltarget though.

Posted

FWIW, I remember in the prototype that they didn't finish at the same time, but I believe that that was due to the length of the dance idle.

Posted (edited)

The dancer is given a timer on sex start, grabs duration, and ends accordingly.  It is dead simple as you describe.  All I need to do to stop setting the spelltarget explicitly, is add a CB start spell to grab the vars from the correct actor.  So as I said before, it's me, it's not you. lol  This is why I asked about the CB start fallback.

 

In short, you're right.  I'm just being lazy.  But at least now I know I'm being lazy.  Before I didn't.

 

EDIT: Under-coding really, or more accurate coding in the wrong place.  Thank you for the push.

 

EDIT EDIT: Fixed it.  No more setting spelltarget.

Edited by t3589
Posted

ALL OF THEM!  Or at least the 10 that I deemed worthy of being selectable by the player.  If that's the case, that must be in some script that isn't for the associated token.

 

Or...I guess that those are on the "leave on during sex" formlists, huh?  Hence, I wouldn't have to use the no unequip flag, right?

 

Hmm well I do this in SCR so they should be added ok and there are heaps of Strap ons in the Formlist

 

scn SexoutSCRS0AddStuffToLists

 

Set rList to SexoutSLClothTypeStrapon

Set iCnt to ListGetCount rList

Label 9

if iCnt > 0

Set iCnt to iCnt - 1

Set rItem to ListGetNthForm rList iCnt

AddFormToFormList SexoutNGSafeClothesF rItem

AddFormToFormList SexoutNGSafeClothesM rItem

goto 9

endif

 

There should be a message in SCR if you turn debugging on to say Formlists have been added ok. Just checked there isn't one, added on for the next beta.

 

Posted

The dancer is given a timer on sex start, grabs duration, and ends accordingly.  It is dead simple as you describe.  All I need to do to stop setting the spelltarget explicitly, is add a CB start spell to grab the vars from the correct actor.  So as I said before, it's me, it's not you. lol  This is why I asked about the CB start fallback.

 

In short, you're right.  I'm just being lazy.  But at least now I know I'm being lazy.  Before I didn't.

 

EDIT: Under-coding really, or more accurate coding in the wrong place.  Thank you for the push.

 

EDIT EDIT: Fixed it.  No more setting spelltarget.

Haha ok, no worries.

Posted

priiiiiiiiide:  You never answered this one.

 

When I've set a specific anim on all involved actors (animA + animB or animA + animB + animC) as well as setting the anim var itself, should I be seeing stuff like this in the console:  "NGSAN: RandomSextype rndA 37"?

Posted

priiiiiiiiide:  You never answered this one.

 

When I've set a specific anim on all involved actors (animA + animB or animA + animB + animC) as well as setting the anim var itself, should I be seeing stuff like this in the console:  "NGSAN: RandomSextype rndA 37"?

Yes. That's picking a sextype (anal, vaginal, oral), not an anim #.

Posted

Based on the MCM settings for anal, vag, oral?  Position-wise, oral is quite a bit different from the other two, but that doesn't interfere with anything?

 

EDIT:  I'm trying to figure out why the Bangatron! is working for approximately everyone except for 3 or 4 people, so I'm trying to eliminate possibilities.

Posted

Yes, it generates a random percentage, then uses the MCM settings to determine which to set it to. It doesn't affect anything in sexout really, it's mostly there for pregnancy/workinggirl/etc. Sexout only makes sure it's "legal" vs. any chastity devices or gags the actor maybe wearing.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...