Jump to content

The Sexoutng Api (How-To For Modders)


Recommended Posts

Thaks for you attention, Zippy57.

 

 

I try to expalin as exactly as I can.

 

If I use a script as Topic-Result-Script like:

 

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

 

everything works fine.

 

But now I want to make a topic, which handles with different NPCs.

So I made a topic for (for example) every villager of Goodsprings (GetInFaction 'GoodspringsFaction').

 

I knew, that other modders did similiar and found Topic-Result-Scripts like (In Tryout):

 

set SexoutNG.ActorA to Player

set SexoutNG.ActorB to GetSelf

CIOS SexoutBegin

 

I used this script and it works fine. (Except of the issue, that the Topic doesn't apear on the NPCs I want, but thats another story ;) )

 

So I thought GetSelf is the thing I need, because in the Old-School-Script  the referenced NPC is replaced by GetSelf. And as I want to use the new Calls, so I replaced all "someNPCREF" with GetSelf in the "Now-And-Forever-Interface-Script":

 

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

 

Sadly that doesn't work because I get instantly the Error: "Invalid Reference 'GetSelf' (only object references and reference variables are allowed in this context)"

 

I don't have any experiences in scripting, and I am just to stupid to "translate" the "Old-Call" into the "New-Call". So I thought, the best way to learn, is looking how other/experienced modders are doing it.

So I looked into a few other mod to figure out, what I am doing wrong.

But all mods, I examined seem to use the old scripts.

 

I looked into the GECK-Wiki to figure out what GetSelf does, but it didn't get me smarter.

 

 

Greetings

 

Swyke

Link to comment

Sadly that doesn't work because I get instantly the Error: "Invalid Reference 'GetSelf' (only object references and reference variables are allowed in this context)"

 

I don't have any experiences in scripting, and I am just to stupid to "translate" the "Old-Call" into the "New-Call". So I thought, the best way to learn, is looking how other/experienced modders are doing it.

So I looked into a few other mod to figure out, what I am doing wrong.

But all mods, I examined seem to use the old scripts.

 

I looked into the GECK-Wiki to figure out what GetSelf does, but it didn't get me smarter.

 

Greetings

 

Swyke

Don't forget to use GetContainer for objects instead of GetSelf.

 

I still use the old calls as I'm stuck on what I've learned already I think, too busy coding to learn a new language that I think does the same thing anyway, not sure what it's advantage is.

Link to comment

I think what I'd do in those cases is to have a quest script available with a reference variable you can set == GetSelf. Do this assignment in the script BEGIN section. In the script END section of your dialogue entry, reference the quest's variable OR (and this is preferable) use a repeatable quest by advancing stages along the way.

 

Trying to use GetSelf in dialogue is NOT stable... there is no guarantee that it will return a result in the same frame it's called. If you cross a few frame boundaries (like the trick above of setting variable in script BEGIN but don't use it til script END which forces at least one frame boundary to be passed), you'll get much more reliable results from GetSelf.

Link to comment
  • 2 weeks later...

Hi Astymma, I was thinking of remaking the Crowds (guess nobody's working on that), so I have a couple of questions. It's using SexoutNGFLGlobalCBStartS for a spell that checks actors in current cell and plays cheering animations. So, what I'd like to know is:
1. Is there a "now and forever" method to check if an actor is involved in sex? When I asked Pride (half a year ago) about this, he seemed unsatisfied with both tokens and Var04. So, what would you recommend for this? Currently it checks tokens.
2. Is there a way to check is current sex a rape? I could use actors from SexoutNGFLGlobalCBStartFLA/O/V for detecting A/O/V type, les/gay/creature/3some, but what about rape?
Thanks :)

Link to comment

Hi Astymma, I was thinking of remaking the Crowds (guess nobody's working on that), so I have a couple of questions. It's using SexoutNGFLGlobalCBStartS for a spell that checks actors in current cell and plays cheering animations. So, what I'd like to know is:

1. Is there a "now and forever" method to check if an actor is involved in sex? When I asked Pride (half a year ago) about this, he seemed unsatisfied with both tokens and Var04. So, what would you recommend for this? Currently it checks tokens.

2. Is there a way to check is current sex a rape? I could use actors from SexoutNGFLGlobalCBStartFLA/O/V for detecting A/O/V type, les/gay/creature/3some, but what about rape?

Thanks :)

 

The current system takes all of the known variables and writes them as NX variables to the person SexoutBegin was cast on.

 

Could probably do the following:

 

NX_GetEVFo "Sexout:Start::raper"

That would return the reference id of the raper in a rape situation.

 

As for checking if an actor is currently engaged in sex, afaik the standard method is still:

 

set iAV to ActorA.GetAV Variable04

set iTemp to (iAV || SexoutNG.FlagInUse) - (iAV && SexoutNG.FlagInUse)

 

I'm also unsatisfied with this solution but it'll take a while to fix as things get migrated to NX vars.

Link to comment
  • 2 weeks later...

The NX_Get works nicely and I can get raper ref.
1. But, is there a direct way to know on whom the sexoutBegin spell was casted on? Right now CBStartS spell is casted on actorB that doesn't have to be the actor that SexoutBegin Spell was casted on. So I'm collecting actors from CBStartFL's and than checking all actors to find NX vars.
[spoiler=code] ; in code below ActorA/B/C are the ones involved in sex
; Get NX DATA ! ! ! ! ! (raper)
Set rRap To ActorA.NX_GetEVFo "Sexout:Start::raper"
if 0 == rRap && 0 != ActorB
Set rRap To ActorB.NX_GetEVFo "Sexout:Start::raper"
endif
if 0 == rRap && 0 != ActorC
Set rRap To ActorC.NX_GetEVFo "Sexout:Start::raper"
endif
if 0 == rRap
dbprintc "SCB: No Rape on %n" rSelf
else
dbprintc "SCB: Raper is %n" rRap
endif

 

For example, if the CBStartSpell was casted allways on actor holding NX vars, it would be much simpler to get all sex data, without using lists at all.

 

2. A strange thing I discovered is that "Set iAV To rNpc.GetAV Variable04" when called in a loop will return wrong values sometimes. In the code below, when iterating over 5 or more NPC's,
everything works as it should just for a short time, and than getAV starts to be late somehow, so it returns value for npc in previous iteration, while getItemCount works fine.

[spoiler=code]; slightly modified part of original Crowds script
Set npcRef To GetFirstRef 42
Label 2
if npcRef
Set iAV To npcRef.GetAV Variable04
dbprintC "SexoutCrowd: %n Var04=%g" npcRef iAV
Set bTemp To LogicalAND iAV SexoutNG.FlagInUse
Set iCount To npcRef.GetItemCount 00SexoutActor
dbprintC "SexoutCrowd: %n FlagInUse = %g, Tokens=%g" npcRef bTemp iCount
; ** more code **
Set npcRef To GetNextRef
goto 2
endif

Console output while having sex between player and Veronica, with a few Finds near, when it starts is:
...
Veronica Var04=6.29146e+006
Veronica FlagInUse = 2.09715e+006, Tokens = 1
Fiend Var04=0
Fiend FlagInUse = 0, Tokens = 0
...
and after few seconds (code frequency is 2 sec, so it does it few times right)
...
Veronica Var04=6.29146e+006
Veronica FlagInUse = 2.09715e+006, Tokens = 1
Fiend Var04=6.29146e+006
Fiend FlagInUse = 2.09715e+006, Tokens = 0
...
after few runs more it is
...
Veronica Var04=0
Veronica FlagInUse = 0, Tokens = 1
Fiend Var04=6.29146e+006
Fiend FlagInUse = 2.09715e+006, Tokens = 0
...

 

I'm not sure is this maybe already known behaviour of GetAV, or this is something specific to this code, or I did something silly. Whatewer the reason might be, I'm also starting to dislike the var04 thing :D
Anyway, when not checked in a loop, var04 thing works corectly, so I've moved checks from CBStartS spell to individual npc spells :)

3. My second question is a bit offtopic, hope you don't mind.
So, is there a way to make NPC's walk to arbitrary location (it can be in the same cell always)? I hope there is, and my dumbass just can't find it.
First thing that came to me was a travel package, but I have no idea is there a way to make them have dynamically set target location different for each instance (npc).
Second idea is to make a spell that plays walking animation (it seems I can't find any walk or run anim in idleanims in gameplay in geck, so I don't know how to play them actualy), and it could manage heading of npc (and position if needed) so he gets to target location eventualy.
This second idea seems like a complete nonsence, and I'm probably starting to loose it. Any idea that helps with this would be much apritiated.
 

Link to comment

I can only answer #3. Travel packages have to have a destination set in the GECK, it can't be set during gameplay. There's a way around this, but depending on how many NPCs you think you'll be dealing with, it's going to be a lot of work.

 

1. Create an X-Marker.

2. Create a Travel package to that X-Marker.

3. Before you give an NPC that package, use MoveTo on the X-Marker to move it where you want the NPC to go.

 

If you want multiple NPCs going to multiple locations, you'll need to repeat this for each one.

Link to comment

3. My second question is a bit offtopic, hope you don't mind.

So, is there a way to make NPC's walk to arbitrary location (it can be in the same cell always)? I hope there is, and my dumbass just can't find it.

First thing that came to me was a travel package, but I have no idea is there a way to make them have dynamically set target location different for each instance (npc).

If the npc's aren't meant to do anything important but walk around, have a look at adding sandbox or wander packages with addscriptpackage. Set the radius to be high enough, the location 'near current location'. And have a look at the flags that say what they can and can't do while on the package (eat, use furniture, that sort of thing).

Zippy's advice is good if you know what cell the action takes place in, but I think crowds is meant to happen in various places.

Link to comment

Thanks for your ideas.

 

I can only answer #3. Travel packages have to have a destination set in the GECK, it can't be set during gameplay. There's a way around this, but depending on how many NPCs you think you'll be dealing with, it's going to be a lot of work.

1. Create an X-Marker.
2. Create a Travel package to that X-Marker.
3. Before you give an NPC that package, use MoveTo on the X-Marker to move it where you want the NPC to go.

If you want multiple NPCs going to multiple locations, you'll need to repeat this for each one.

I thought about trying that, wasn't sure are Xmarker's moveable as they're in Static category (funny GECK-o thingie). Anyway, multiple locations would be needed when more than one simultaneous sex scene is played, so crowders go to the right one. So, I could, for example, make 4 Xmarkers and 4packages, and limit suppoting up to 4 simult. sex scene's. I would be very sad to have this kind of limit, not very simple (read 'many many places to make a mistake -> bug') , but if there's nothing better, I could live with that.

 

 

 

3. My second question is a bit offtopic, hope you don't mind.
So, is there a way to make NPC's walk to arbitrary location (it can be in the same cell always)? I hope there is, and my dumbass just can't find it.
First thing that came to me was a travel package, but I have no idea is there a way to make them have dynamically set target location different for each instance (npc).

If the npc's aren't meant to do anything important but walk around, have a look at adding sandbox or wander packages with addscriptpackage. Set the radius to be high enough, the location 'near current location'. And have a look at the flags that say what they can and can't do while on the package (eat, use furniture, that sort of thing).
Zippy's advice is good if you know what cell the action takes place in, but I think crowds is meant to happen in various places.

This I have tried in the first place. Both Wander and SB pck, with different flags (radius=1000), but for some reason NPC's were often very stubborn to go in the wrong way, even when setting their heading each second from spell script. No, they allways turn away and go whoever nows where, even with nothing but 'wandering' checked in pckg. So, that didn't work very good, especially with far away NPC's (more than 500 distance).

So, there's no way to avoid packages completely?
 

Link to comment

1.

The target should have one SexoutNGTokenTarget in their possession. If they don't, then I need to find where Pride was supposed to have given that out and make sure it is being handed out. He was also migrating to an all NX system with every actor having all the NX vars for the act. Will be completing that migration when I can.

 

2.

I'm also unhappy with var04 and I'm looking at finding a better solution.

 

3.

The easiest way to move an NPC to an arbitrary location is use a marker and move it to the location desired then apply a travel package that has that marker as its destination like what's been said so far.

 

To play an idle animation like walking, use http://geck.bethsoft.com/index.php/PlayGroup

Link to comment

1.

The target should have one SexoutNGTokenTarget in their possession. If they don't, then I need to find where Pride was supposed to have given that out and make sure it is being handed out. He was also migrating to an all NX system with every actor having all the NX vars for the act. Will be completing that migration when I can.

 

2.

I'm also unhappy with var04 and I'm looking at finding a better solution.

 

3.

The easiest way to move an NPC to an arbitrary location is use a marker and move it to the location desired then apply a travel package that has that marker as its destination like what's been said so far.

 

To play an idle animation like walking, use http://geck.bethsoft.com/index.php/PlayGroup

Thanks, will try those :)

 

 

Link to comment
  • 2 months later...

Question: Is there by chance a callback to remove an item from an actor?

 

I'm currently adding Strapons to actors before calling SexoutBegin and removing them post SexoutBegin removes them in the middle of the animation, or even before it starts.

 

Or should I just use a loop with SexoutActor check post SexoutBegin to check if its ok to remove the strapon?

Link to comment

You can work that in in a CBSpellA & CBSpellC. Detect the actor it's cast on (GetSelf), run a GetEquipped check, then remove.

 

Thank you again DoctaSax, I hadn't even considered doing it that way cause I was already casting the cooldown with the spell callbacks, but I can cast cooldown elsewhere without any problems.

Link to comment
  • 1 month later...

I feel silly for asking basic things like this, it has been a long time since I used GECK. I'm unable to get anything working using either the classic nor the new interface.

 

It's most likely because of the NPC refs being wrong. I've added two NPC to the renderer, gave each of them a "Reference Editor ID"(wouldn't they become globally available by now), then I use the sample code as given on the first page. Doing this in a simple dialog does compile according to GECK but nothing happens.

 

Can anyone show me a little sample snippet on how to start an animation of for example a dialog result end script?

 

EDIT: Nevermind, I'm an idiot. It's important to start G.E.C.K with NVSE using "nvse_loader -editor".

Link to comment
  • 4 weeks later...

Can anyone help me get noAnim to work?

 

I have tried the following, of which non worked (Animation is played regardless):

player.NX_SetEVFl "Sexout:Start::noAnim" 1
player.NX_SetEVFo "Sexout:Start::noAnim" 1
set SexoutNG.noAnim to 1

Complete code used:

        player.NX_SetEVFl "Sexout:Start::CallVer" 1
        player.NX_SetEVFl "Sexout:Start::noAnim" 1
        player.NX_SetEVFo "Sexout:Start::ActorA" partnr
        player.NX_SetEVFo "Sexout:Start::ActorB" player
        player.CIOS SexoutBegin
Link to comment
  • 2 months later...

I see you can use the token" method. and Var04 method to monitor each time sex occurs. Such as

 

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

but what if you wanted to monitor every time a woman cummed and a male injected sperm into the player. And each oriface that was used so you could add an item for each.

Male sperm in vagina add item 1, male sperm orally add item 2, male sperm annaly add item 3, female cum on vagina add item 4, female cum in mouth add item 5, female cum dripping off strap  into ass add item 5?

Then how would you seperate by race and creature?

Link to comment

@BigOnes69:

 

Have a look at the 3 '...SexEnd...' scripts inside SCR, they do exactly that. So similar in fact that there may be a way without writing your own sexend scripts.. Halstrom would be best person to ask.

--

 

To make your own script run whenever sex ends look at the block of ListAddForms in SCR's 'SexoutSCRS1MainFast', or in 'SexoutWEARMainQuestScript' in my wear-and-tear mod (I also use sexend scripts which were heavily influenced by looking at Halstrom's.

 

The 'ListAddForm SexoutNGFLGlobalCBEndS MySpellEffect' casts 'MySpellEffect' whenever sex ends. You attach your script to a base effect, and that to the spell that gets cast. So: Casting MySpell -> Causes MyBaseEffect -> which is MyScript.

 

CAUTION:

1) 'whenever sex ends' means exactly that- you need to figure out who the actors are because the player may not be involved

2) if player isn't involved you still need to clear the lists or there will be garbage next time.

3) If multiple sex acts are happening simultaneously then you need to sort out the confusion

4) I believe if 2 sex acts finish simultaneously (same frame?) then the sex end scripts may only run once.

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