Jump to content

The Sexoutng Api (How-To For Modders)


Recommended Posts

Since this is in reference to the API, I suppose it might be more prudent to ask this here so that others in the future may see if should they have the same question.

 

What is the preferred method for confirming whether or not an actor is engaged in a sex act? I've seen two methods, one involving tokens and another checking Var04. I'd hate to use one that is slated for deprecation.

 

Var04 Method:

set iAV to self.GetAV Variable04
if (0 == (LogicalAnd iAV SexoutNG.FlagInUse))
;blah
endif

 

Token Method:

if (0 == self.GetItemCount 00SexoutActor)
;blah
endif

Link to comment

Prideslayer has said that either is fine, although I've always had the impression that he was moving away from the "token" method. He has advocated the Var04 method recently. You could combine the 2 methods to be safe:

 

set iAV to self.GetAV Variable04
if ((0 == (LogicalAnd iAV SexoutNG.FlagInUse)) && (0 == self.GetItemCount 00SexoutActor))
   ;blah
endif

Link to comment

For confirming you can use either.. don't worry about it. I thought the var04 method would be final, and intended it to be so when I thought I was never going to get save/load support into the extender. Now that it has save/load support, I will *eventually* be switching entirely to using that internally.

 

Right now, var04 is used internally by sexout for it to check, but the tokens are still handed out and removed because some mods check for those. If it's easier for you, just stick with the token. An "official" NX interface for checking will be made available once I have the time to properly plan it out.

Link to comment

Right! Totally noob question: how do I find out the gender of an actor?

SexoutNG.ActorA.GetIsSex male

...looks silly and GECK said I'm stupid, but I just can't figure out the right way.

 

Basically, I'm trying to tidy up and hopefully improve the Sexout addon to Imp's MCN, and its original relevant piece of code looks like this:

  if(SexoutNG.isOral || Sexout.sextype == Oral)
   if(SexoutNG.ActorB == PlayerREF || PlayerREF == Sexout.female)
     if(playerGivingOral == 0)
       set playerGivingOral to 1
     endif
   endif
endif

...which makes females also produce cum, but gives no cum when being orally raped.

 

I'm also thinking of getting rid of excessive if/endifs there and just string the conditions with ||s and &&s. Good/bad/'oh-god-leave-the-poor-code-alone' idea?

Link to comment

Your code is fine, the language just sucks.. you cannot do "a.b.c" so you need to do "set c to a.b; ..."

 

e.g.

 

set foo to SexoutNG.ActorA
if (foo.GetIsSex male) ...

 

That said, you cannot use SexoutNG.* to get that information -- unless you are the one that set them that is, and you set them in the same frame. Once the sexout spell is running, those variables are copied to internal ones and then cleared out -- they will be blank (or nonsense) when you read them.

 

If MCN is the one that is actually casting SexoutBegin, then it's OK to use them (again, only if it happens in the same frame).

 

Trying to use those variables at any other time is like giving sexout a cupcake and then trying to use the cupcake later -- while madly hoping against hope that sexout hasn't already eaten it.

Link to comment

I'm also thinking of getting rid of excessive if/endifs there and just string the conditions with ||s and &&s. Good/bad/'oh-god-leave-the-poor-code-alone' idea?

 

That code example looks fine as it is to me. I hardly ever use more than 2 logical operators (&& or ||) in the same line. Stringing too many things together in the same line is sometimes unnecessarily harder on the engine than it needs to be, and definitely harder on your own eyes.

 

Imagine a structure like this:

if (something) && (((something else || something else) || (something else && something else)) && something else)
; do something
endif

which is only shorter, but not better for performance than chopping it up a bit.

 

Now replace each "something (else)" by stuff like "GetPlayerTeamMateCount >= (someshort + GetRandomPercent * (someshort - someshort + 1) / 100)" or "player.IsCurrentFurnitureRef != MyIncrediblyLongQuestNameThatWasADumbChoiceWhenIStartedOutButImKindaStuckWithItNow.mystupidlynamedquestvarref", now misplace a bracket somewhere, and you just committed a crime against yer sanity. :cool:

Link to comment

Note there is a limit in the geck script language to how long conditional constructs can be. This applies not just to single statements with the logical operators (&&, ||) but also to how many "elseif" blocks you can have.

 

I already had to break up the random animation picker into two different if .. elseif .. endif blocks because it got to the point that adding one more elseif caused the script to start failing when it was run, though it still saved OK in the geck. I had to do something similar in tryouts, which is why in there you'll find a bunch of simple single-condition if statements one after the other that all do the same thing (return or dispel or something like that).

 

Don't let them get too long or you'll get failures that just "don't make sense" when debugging. ;)

Link to comment

OK, bit confused with something here. I'm trying to use the set SexoutNG.CBDialog function, but using X as the "shadow placeholder" for an NPC not participating in the action, in this case a pimp with the JetSlaver01REF reference.

 

However, how exactly do I make him work with the callback? I've tried the following:

 

set SexoutNG.CBDialogJetSlaver01REF to SlaveJailTRenegade06CallbackB

 

set SexoutNG.CBDialog JetSlaver01REF to SlaveJailTRenegade06CallbackB

 

And a few others, none of which worked. I'm sure I'm missing something silly here, but I would really appreciate a hand.

 

Cheers.

Link to comment

Oh, and one last thing while we're at it.

 

I noticed that quite a few of the SexoutNGAnims in the GECK have both a main name, like SNG201, and then are subdivided into SNG201a and SNG201b. Does this mean there are two variants of the same animation (201) or not?

 

How would I add this in a script? Like this?

 

set Sexout.anim to 201
set SexoutNG.ActorA to VeronicaREF
set SexoutNG.ActorB to GetSelf
CIOS SexoutBegin

Link to comment

Oh' date=' and one last thing while we're at it.

 

I noticed that quite a few of the SexoutNGAnims in the GECK have both a main name, like SNG201, and then are subdivided into SNG201a and SNG201b. Does this mean there are two variants of the same animation (201) or not?

[/quote']

 

The 201a would be for actorA, 201b for actorB.

But yes, to pick an anim, all you really need is what you wrote there, although setting them both separately will work too.

Link to comment

I know Prideslayer said this isn't a technical support type thread, but I figured its better than me opening up yet another one up in the TS forum.

 

So here goes. Whenever I try and use this in the geck:

 

VFSHighTimesDealer.NX_SetEVFl "Sexout:Start::CallVer" 1
VFSHighTimesDealer.NX_SetEVFo "Sexout:Start::ActorA" VFSHighTimesDealer
VFSHighTimesDealer.NX_SetEVFo "Sexout:Start::ActorB" playerREF		
VFSHighTimesDealer.NX_SetEVFl "Sexout:Start::isAnal" 1
VFSHighTimesDealer.NX_SetEVFo "Sexout:Start::CBDialogA" SDCallbackGeneral
VFSHighTimesDealer.CIOS SexoutBegin

 

I get "SCRIPTS: Script 'DefaultCompiler', line 0: Unknown variable or function 'NX_SetEVFI'."

 

Suggestions?

Link to comment

Ah ok. It's already there, so I'll be launching it from teh nvse_loader -shortcut exe from now on.

 

Thanks!

 

EDIT: Now I'm getting this, to the same script:

 

"Warning - Power Up - Scripts

 

SCRIPTS: Script 'DefaultCompiler', line 1:

Syntax error. Invalid reference 'VFSHighTimesDealer' (only object references and reference variables are available in this context."

 

VFSHighTimesDealer is the id for Dixon. I'm taking it they aren't liking that very much...

Link to comment

You're best off declaring a ref first' date=' set that to Getself, & then do the calling. I still use the old calling system when I can.

[/quote']

Yep and then you'r beter checking GetSelf == "Something", I found a lot of idssues I had with scripts on NPC's "Set rZActor to GetSelf" wasn't actually set till the script had run 2 or 3 times.

Link to comment
  • 3 weeks later...
  • 3 months later...

Hello!

 

I have a basic Sexout-modding-question.

 

I tried to figure out, how to script a basic "whoring"-act, which allows to use the same toppics to begin an animation with different NPC. Watching other Mods in GECK I've seen, that Tryout for example uses a "GetSelf" for the NPC-Actor.

 

I've tryied this using the "Now-And-Forever-Interface" as described in the first post here:

 

GetSelf.NX_SetEVFl "Sexout:Start::CallVer" 1
GetSelf.NX_SetEVFo "Sexout:Start::ActorA" GetSelf
GetSelf.NX_SetEVFo "Sexout:Start::ActorB" playerREF
GetSelf.CIOS SexoutBegin

 

But that doesn't work.

Shure I#ve did something stupid wrong.

 

As searching through other mods, I recognized that noone(!) seems to use this "Now-And-Forever-Interface" (!?!)

 

Is this true?

Is it better to use the old interface?

And how can I get my script run?

 

Thakt you, for your attention

 

Swyke

Link to comment

Hello!

Hello.

I have a basic Sexout-modding-question.

Okay.

But that doesn't work.

Shure I#ve did something stupid wrong.

Please define "doesn't work". There are many possible outcomes of "doesn't work" in this system.

As searching through other mods, I recognized that noone(!) seems to use this "Now-And-Forever-Interface" (!?!)

 

Is this true?

No.

Is it better to use the old interface?

No.

And how can I get my script run?

Explain your issue better and we'll see.

Thakt you, for your attention

You're welcome.

Swyke

zippy57
Link to comment

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use