Jump to content

The Sexoutng Api (How-To For Modders)


prideslayer

Recommended Posts

Posted

OK, I've got a dumb question. Where is the mesh for the er... "strap on" business for a few girl/girl anims located? I had assumed it was an animated object but maybe I'm missing it somewhere. It's only used for a few animations but I'm putting together a TypeN for Sexout package and it clips rather badly on the TypeN body. :blush:

There are different versions in different mods. Legion tryout has one, and I believe there are some in SCR as well. They're just normal clothing/armor items. An enchantment on them tells sexout that the wearer should be treated as male instead of female when picking animations and such.

Posted

 

TypeN for Sexout package and it clips rather badly on the TypeN body

Could be the Spectums Toy Pack part of the SCR requirement. There were a few there that clipped with certain bodies if memory serves me correctly.

Posted

Ack, I didn't think to try SCR! I'll rummage around in there and locate it. Thanks! :cool:

 

Edit: It was Spectrum's Pack! Thanks again. :shy:

Posted

Dialogue scripts are problematic and this is a common consequence- Most likely, GetSelf is not returning quick enough so myRef == 0, hence there is no actorB so sex is masturbation. Sometimes it does.. thats just the wonderful game engine. Take a look in the GECK scripting 101 thread for more info on this, start at the beginning.

 

In Soliciting (take a look in GECK if you like, the code is quite clear from V4.2), I only do additem, startquest, or setting quest variables within dialogue scripts, everything else is in other scripts. I would suggest you move that code to an effect, object or quest script and call that from dialogue instead.

 

Object OnAdd blocks will run during dialogue, GameMode and Effect spells will not, but running before or afterwards is usually fine if you aren't changing current dialogue responses.

 

Also, I'd suggest using the new NX sexout calling method rather than the old one. The variable names are the same.

 

Thanks for the tip. I moved the bulk of the code to an effect, reading the ref from a quest variable. In the dialogue, I now just set that quest variable and "cast" the effect, and now it appears to work every time.

 

I'm not using the NX calling method because I can't make it compile (it should work with 2.6.82, shouldn't it?), anyway the old method appears to work fine, and seeing as it uses the same sintax as the scripts in the base game it's easier to read as well.

 

Thanks again (also to the other posters).

 

Posted

I'm having some trouble getting Start values for SO Erotica, and I'm worried that SO Char Resize is only working purely by luck at this point since (unless I'm missing something) since I'm grabbing the values the same way more or less.  Both spells are added to the global start FL in their respective mods.

 

I know that Odessa was trying to get a way to determine the anim near the end of sex.

I know that the Start vars are cleared, and that Spunk will be storing those.  I imagine that I should probably switch to that in both mods, but I don't know how close it is to being integrated to SCR, and unless other mods are already requiring it, I would feel bad requiring it

Sexout Character Resize (works)


 

scn SexoutResizeInitScript

int DoOnce
ref rActorRef
ref rActorA
ref rActorB
ref rActorC

begin ScriptEffectStart
  if (0 == DoOnce)
    set rActorRef to NX_GetEVFo "Sexout:Start::spellTarget"

    if (0 != rActorRef)
      set rActorA to rActorRef.NX_GetEVFo "Sexout:Start::actorA"
      set rActorB to rActorRef.NX_GetEVFo "Sexout:Start::actorB"
      set rActorC to rActorRef.NX_GetEVFo "Sexout:Start::actorC"


etc..........




Sexout Erotica (Missing values for AnimB, ActorA, and ActorB (0, <no name> x 2, bActor#Male gets the value just fine)

 

Note:  I put it in Update instead of Start so that it would have another chance to get the animation.  Initially, I did have everything in the Start block.


 

scn SexoutEroInit2pSCRIPT

int iDur
int iStartOrStop ; 0 = init, 1 = spell, -1 = threesome, dispel
int iTimer
int iAnim
int iIsPlayer ; 1 = A  2 = B  3 = C, 0 = voyeur
ref rActA
ref rActB
int iActASex
int iActBSex


Begin ScriptEffectUpdate    
    if (0 == iStartOrStop)
        Set iAnim to NX_GetEVFl "Sexout:Start::animB"
        if ((5001 <= iAnim) && (5600 >= iAnim))
            Set iStartOrStop to -1
            Dispel SexoutEroEFFInit2p
            MessageBoxEX "Init2p was dispelled"
            Return
        elseif (0 == iAnim)
            Return
        else
            MessageBoxEX "iAnim is %g" iAnim
            Set iStartOrStop to 1
        endif
    elseif (1 == iStartOrStop)
        if (0 == Sexout.duration)
            Set iDur to Sexout.dfTime
        else
            Set iDur to Sexout.duration
        endif
        Set rActB to NX_GetEVFo "Sexout:Start::actorB"
        Set iActBSex to NX_GetEVFl "Sexout:Start::bActorBmale"
        if (player == rActB)
            Set iIsPlayer to 2
        endif
        If (200 > iAnim)
            Set rActA to NX_GetEVFo "Sexout:Start::actorA"
            Set iActASex to NX_GetEVFl "Sexout:Start::bActorAmale"
            if (player == rActA)
                Set iIsPlayer to 1
            endif
        Endif

        MessageBoxEx "ActorA:  %n SexA:  %g %r ActorB: %n SexB: %g %r Player is Actor: %g %r Duration: %g" rActA iActASex rActB iActBSex iIsPlayer iDur

        Set iStartOrStop to 2
    endif
End

 


 

Help is greatly appreciated.  :-/

Posted

looks like you're trying to get some nx vars from the spell's implied ref that isn't the spelltarget ref, and some of those vars are only on the spelltarget ref.

 

 

(Conversely, I have a situation where a var that's supposed to be on the spelltarget ref isn't but is on the other actor.)

Posted

The spell is being triggered from the SexoutNGFLGlobalCBStartS formlist which, if I understand, would be cast on Actor B.  It doesn't have anything to do with the char that the begin sex spell is cast on, does it?

 

Is the solution to check AnimA and AnimB for a non-zero value for a two person anim?

Posted

So then, get the spell target, figure out if the target is A B or C, and then get the value for the corresponding anim?

Posted

That should do it (just a should be fine, a is always there), or you can count the tokens, but then that often takes a few script runs.

Posted

:huh: I thought that B was always present?  That B was usually used even when the anim was just a single actor masturbating.  nyaallich_making_more_shit_up++?

Posted

There is only one 'special' thing about actorB.

 

If the player is not involved in the scene, and the anim is 2p or 3p, the 'actorB' is the one that is not moved or rotated. That's it. When the player is involved, they are not rotated or moved regardless of which actor they are.

 

Player involved or not, the spells follow whoever the script cast them on initially.

Posted

Oh, as for callbacks & notifications Callbacks are (obviously?) cast on whoever the scene author said to cast them on. CBSpellA is cast on A, B on B, etc.

 

Notifications are cast on B if present, otherwise A, otherwise C. I honestly don't remember why this is. :)

Posted

Sexout was always rather oriented toward a game where the player is female/passive/B. I suppose that's why.

Now you got me doubting the masturbator = A bit, maybe that's just because I ended up setting it that way.

Posted

The masturbator can be any of them in the initial call. The sanitizer will check to see if actor B==C or A==C and if so, delete/clear C. Then it checks if A==B and if so, deletes/clears B, so after the sanitizer the only actor should be A.

Posted

Oh I should note that if only A/B/C is set, the sanitizer doesn't actually do anything. If B is set and A and C aren't, it'll blindly clear C, then do nothing to B because B != A. Same with C if it's set and A/B aren't. There is a little method to that madness, so you can cause any solo actor to play any part of a multiplayer act, e.g. just the B or C side of a 3some or the B side of a 2some, without another actor involved.

Posted

Just wanted to point out that SexoutPositioning functions as both a guide to using NX Vars AND as a guide to utilizing the callback system... specifically to obtain information you're discussing.

 

Here's SexoutPosBEMainS which does the heavy lifting:

 

 

scn SexoutPosBEMainS

ref rActor
ref rTemp
ref rTarget
int iAbort
float fTemp
int iStage
float fTimer
int iQuiet
int iPlayerInvolved
int iDispel

Begin ScriptEffectStart
    set rActor to GetSelf
     if rActor
         if SexoutPosQVars.iDebug
            printtoconsole "SexoutPos: BEMainS starting on Actor:(%i)[%n]" rActor rActor
        endif
     else
         if SexoutPosQVars.iDebug
            printtoconsole "SexoutPos: BEMainS starting on NULL Actor... Aborting."
        endif
          set iAbort to 1
          set iStage to 2
          return
    endif
    set rTemp to rActor.NX_GetEVFo "Sexout:Start::spellTarget"
    if rActor != rTemp
         if SexoutPosQVars.iDebug
            printtoconsole "SexoutPos: BEMainS cast on different actor(%i)[%n] than SexouNGBegin(%i)[%n]. Switching to SpellTarget to get NX Vars. Continuing." rActor rActor rTemp rTemp
        endif
        set rActor to rTemp
     else
         if SexoutPosQVars.iDebug
            printtoconsole "SexoutPos: BEMainS cast on same actor as SexouNGBegin(%i)[%n]. Continuing." rActor rActor
        endif
    endif
    if rActor == Player
        set fTimer to 0    
        set iStage to 0
        set iQuiet to 0
        set rTarget to rActor
        ;start with NULL state
        rActor.Dispel SexoutPosSpMonitor
        rActor.Dispel SexoutPosSpReset
        rActor.Dispel SexoutPosSpTerminate
    else
        set rTemp to rActor.NX_GetEVFo "Sexout:Start::actorA"
        if rTemp
            ;start with NULL state
            rActor.Dispel SexoutPosSpMonitor
            rActor.Dispel SexoutPosSpReset
            rActor.Dispel SexoutPosSpTerminate
        endif
        if rTemp == Player
            set iPlayerInvolved to 1
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor not player but Actor A is... recasting on A."
            endif
            set rTarget to rTemp
        endif
        set rTemp to rActor.NX_GetEVFo "Sexout:Start::actorB"
        if rTemp
            ;start with NULL state
            rActor.Dispel SexoutPosSpMonitor
            rActor.Dispel SexoutPosSpReset
            rActor.Dispel SexoutPosSpTerminate
        endif
        if rTemp == Player
            set iPlayerInvolved to 1
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor not player but Actor B is... recasting on B."
            endif
            set rTarget to rTemp
        endif
        set rTemp to rActor.NX_GetEVFo "Sexout:Start::actorC"
        if rTemp
            ;start with NULL state
            rActor.Dispel SexoutPosSpMonitor
            rActor.Dispel SexoutPosSpReset
            rActor.Dispel SexoutPosSpTerminate
        endif
        if rTemp == Player
            set iPlayerInvolved to 1
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor not player but Actor C is... recasting on C."
            endif
            set rTarget to rTemp
        endif
        if 0 == rTarget
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Player is not actor A, B or C or NX Vars are missing from (%i)[%n]... Aborting." rActor rActor
            endif
            set iStage to 2
            set iAbort to 1
            set iQuiet to 1
            if rActor
                ;return actor to NULL state
                rActor.Dispel SexoutPosSpMonitor
                rActor.Dispel SexoutPosSpReset
                rActor.Dispel SexoutPosSpTerminate
            endif
            return
        else
            ;start with NULL state
            set SexoutPosActive to 0
        endif
    endif
End

Begin ScriptEffectUpdate
    if 1 == iDispel
        return
     endif
    if 0 == iStage
        if fTimer < 5.00
            set fTimer to (fTimer + ScriptEffectElapsedSeconds)            
            return
        else
            set iStage to 1
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Timer elapsed, moving on."
            endif
            return
        endif
    endif
    if 1 == iStage
        set rTemp to rActor.NX_GetEVFo "Sexout:Start::actorA"
        if rTemp
            set SexoutPosQVars.rActorA to rTemp
            set SexoutPosQVars.iHasA to 1
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosX"
            set SexoutPosQVars.PosOrigAX to fTemp
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosY"
            set SexoutPosQVars.PosOrigAY to fTemp
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosZ"
            set SexoutPosQVars.PosOrigAZ to fTemp
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor A(%i)[%n] found, PosOrigA values set." rTemp rTemp
            endif
        else
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor A not found, PosOrigA values not set."
            endif
        endif
        set rTemp to rActor.NX_GetEVFo "Sexout:Start::actorB"
        if rTemp
            set SexoutPosQVars.rActorB to rTemp
            set SexoutPosQVars.iHasB to 1
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosX"
            set SexoutPosQVars.PosOrigBX to fTemp
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosY"
            set SexoutPosQVars.PosOrigBY to fTemp
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosZ"
            set SexoutPosQVars.PosOrigBZ to fTemp
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor B(%i)[%n] found, PosOrigB values set." rTemp rTemp
            endif
        else
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor B not found, PosOrigB values not set."
            endif
        endif
        set rTemp to rActor.NX_GetEVFo "Sexout:Start::actorC"
        if rTemp
            set SexoutPosQVars.rActorC to rTemp
            set SexoutPosQVars.iHasC to 1
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosX"
            set SexoutPosQVars.PosOrigCX to fTemp
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosY"
            set SexoutPosQVars.PosOrigCY to fTemp
            set fTemp to rTemp.NX_GetEVFl "Sexout:PosZ"
            set SexoutPosQVars.PosOrigCZ to fTemp
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor C(%i)[%n] found, PosOrigC values set." rTemp rTemp
            endif
        else
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Actor C not found, PosOrigC values not set."
            endif
        endif
        set rTemp to rActor.NX_GetEVFo "Sexout:Start::spellTarget"
        if rTemp
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: rActorOrig being set to spellTarget(%i)[%n]" rTemp rTemp
            endif
            set SexoutPosQVars.rActorOrig to rTemp
        else
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: spellTarget is NULL, unable to set rActorOrig... Aborting." rTemp rTemp
            endif
            set iAbort to 1
            set iStage to 2
            return
        endif
        if 1 == SexoutPosQVars.iHasB
            set rTemp to SexoutPosQVars.rActorB
            set SexoutPosQVars.rActorCur to rTemp
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: rActorCur being set to B:(%i)[%n]" rTemp rTemp
            endif
        else
            if 1 == SexoutPosQVars.iHasA
                set rTemp to SexoutPosQVars.rActorA
                set SexoutPosQVars.rActorCur to rTemp
                if SexoutPosQVars.iDebug
                    printtoconsole "SexoutPos: rActorCur being set to A:(%i)[%n]" rTemp rTemp
                endif
            elseif 1 == SexoutPosQVars.iHasC
                set rTemp to SexoutPosQVars.rActorC
                set SexoutPosQVars.rActorCur to rTemp
                if SexoutPosQVars.iDebug
                    printtoconsole "SexoutPos: rActorCur being set to C:(%i)[%n]" rTemp rTemp
                endif
            else
                if SexoutPosQVars.iDebug
                    printtoconsole "SexoutPos: iHasA, iHasB, iHasC all set to False. Can't set rActorCur. Aborting."
                endif
                set iAbort to 1
                set iStage to 2
                return
            endif
        endif
        set iStage to 2
        return
    endif
    if 2 == iStage
        if 1 == iAbort
            if 0 == iQuiet
                ShowMessage SexoutPosMsgAbort
            endif
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: Generic Abort... check previous console messages for cause."
            endif
            set iDispel to 1
            rActor.Dispel SexoutPosSpMain
        else
            if SexoutPosQVars.iDebug
                printtoconsole "SexoutPos: BEMainS completed successfully... dispelling SpMain on actor(%i)[%n] and casting SpMonitor on actor(%i)[%n]" rActor rActor rTarget rTarget
            endif
            if rTarget != Player
                printtoconsole "SexoutPos: BEMainS completed successfully but rTarget(%i)[%n] is not the same actor as the Player... Aborting." rTarget rTarget
                set iAbort to 1
                set iStage to 2
                return
            endif
            rTarget.CIOS SexoutPosSpMonitor
            set iDispel to 1
            rActor.Dispel SexoutPosSpMain
        endif  
    endif
End

 

 

 

Note the spell target checks and such code designed to handle the spell not being cast on the actual spell target.

Posted

Sorry.  I'm an idiot.  The problem with my script was that I wasn't using reference.NX_GetEVF# when trying to set my script's vars.  :blush:

 

I was probably getting the ActorB thing for masturbation since no matter the act, someone is always "getting it" + reading more in to previous responses in various threads than there was.  The other information that you guys gave me was useful, so thank you for that.

 

EDIT:  I think I was missing the reference because I was looking at NG's "set actorA    to NX_GetEVFo "Sexout:Start::actorA"" statements inside of the BaseF script.  That's my excuse.

Posted

I've run into an issue while trying to run a few commands from the console.

 

Here's my batch file:

set "14000dc0".anim to 10005
set "14019333".bDontUndressA to 1
set "14019333".bDontUndressB to 1
set "14019333".actora to Player
set "14019333".actorb to getself
player.cios 140027a8

 

(where "14000dc0" is Sexout, "14019333" is SexoutNG and 140027a8 is SexoutBegin)

 

My character and the NPC (getself) simply look at each other without anything happening. I also lose control of my character: all I can do is look up or down.

 

I've done a few tests.

1) If I set both "undress" commands to 0, the animation works fine. Same thing if "undressA" (my character) is 0 and "undressB" is 1, even though both of them will get naked anyway.

2) If I try those commands on two NPCs instead ("getself" x2 instead of Player), everything works as intended.

Posted

With the released version or the debug version of SexoutNG ? Undressing should be sorted out in the debug version.

 

Posted

With the released version or the debug version of SexoutNG ? Undressing should be sorted out in the debug version.

 

I use what is on the download page, so "SexoutNG - Core 2.6.82r2.fomod" and "SexoutNG - Data 2.6.80.fomod"

 

Is there another version?

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...