Jump to content

Having problems with sexout and array variables.


x3kmak

Recommended Posts

Posted

Basically I'm creating a mod for TTW/NV that let's you trade sex for health/radiation/addiction treatment but  for some reason sometimes the sex act doesn't happen, it prints on the console the following error:

 

image.png.3f89f2969e62c91397df504a1c234743.png

 

the 1st reports a script error for kNVSE for some reason but if I take the plugin out is just prints the same but points to my mod instead ("Error in script 00000000 (CDS - Companion Doctor's Service - Sexout.esp).

 

Now I already tried asking for help in this situation back on August, unfortunately nobody responded and I felt I was doing something wrong since I my modding experience was through FNVedit rather that GECK. 

 

https://www.loverslab.com/topic/173143-unable-to-use-flags-from-sexout-api-due-to-array-error/

 

Now I'm trying again to resume my mod and started on Doc Mitchell and everything was working fine, then went to TTW doctors and done all dialogue to DocChurch, but when I tried to do the same to Doctor Preston he just refused, giving the error above. I endup putting the sexoutcall in a if condition (if TTWSexFlags != 0) to execute if it was inititialized and it worked for Preston, but when I tried to test DocChurch again he got the error above too. 

 

So I tried to test some NPC's with both sexoutBang and Sexoutkey, sexoutkey worked 100% on everyone I've tested. Bang works is most from fnv/ttw , as long they werent a important NPC(for some reason) and when it didn't work it print on the console the same error about arrays not being uninitialized. Sexout tryout was triggering when I was going testing the previous mods and it also trigger the sex scenes wells.

 

My assumption is that xNVSE is the one giving problems because there is still issues open on their github about problems with arrays:

 

 

Here's the code I'm trying to execute at the end of the Dialogue when "Result Script (End)" triggers:

 

array_var TTWSexFlags

let TTWSexFlags := Ar_List "oral", "blow"

if TTWSexFlags != 0
 call fnSexoutActRunFull (Ar_Map "ActorA"::DocChurchREF, "ActorB"::PlayerREF, "Flags"::TTWSexFlags, "CBDialogA"::DoctorSex99AFTcaps )
endif

 

I'm going to try using the old sexout calls to try and see if it works, since all the old mods worked while the sexoutBang and mine that used the fnSexoutActRunFull were giving too much trouble. But if any one went through this problem or know what happening knows a better way, please tell me because I'm almost giving up making this mod.

 

 

Posted

I'm actually trying to shift the initialization of the variables and the function fnSexoutActRunFull call to my own script, so now I call my function in my script with some params that then give the proper flags and correct fnSexoutActRunFull call depending on the parameters I pass thought. So far its playing nicely, array_var doesnt give me problems anymore, but before DocChurch/DocMitchell also didnt gave me any problems before I switch to Doctor Preston, so we will see when I start with him again.

 
Posted

It's actually ill-advised to declare vars in a dialogue result script. If you must declare a var, you should do it in a different script like a UDF, and use the dialogue result script to call that UDF.


It is, however, possible to add that flags array in the same line as you construct the map, without declaring anything:

call fnSexoutActRunFull (Ar_Map "ActorA"::DocChurchREF, "ActorB"::PlayerREF, "Flags"::(Ar_List "oral", "blow"), "CBDialogA"::DoctorSex99AFTcaps )

 

That is, last time I worked with NVSE arrays. YMMV.

 

This

if TTWSexFlags != 0

is also not how you check if an array var is initialized.

You go

if arrayvar

instead.

 

Posted
21 hours ago, DoctaSax said:

It's actually ill-advised to declare vars in a dialogue result script. If you must declare a var, you should do it in a different script like a UDF, and use the dialogue result script to call that UDF.


It is, however, possible to add that flags array in the same line as you construct the map, without declaring anything:

call fnSexoutActRunFull (Ar_Map "ActorA"::DocChurchREF, "ActorB"::PlayerREF, "Flags"::(Ar_List "oral", "blow"), "CBDialogA"::DoctorSex99AFTcaps )

 

That is, last time I worked with NVSE arrays. YMMV.

 

 

 I've actually tried to put directly the array list into the function call but it didn't let me save, probably missed either the () or wrote something wrong, anyways its working for now, Still hopping that the xNVSE team fix this array problem because its effecting some mods too like headtracking and sexoutbang that uses arrays.

 

 

 

21 hours ago, DoctaSax said:

 

This

 

if TTWSexFlags != 0

is also not how you check if an array var is initialized.

You go

if arrayvar

instead.

 

 

Just noticed it now (oops) was going to try using the Ar_Size, to check if returned > 0 (idk why I put differential there) but didn't finish it and pasted it here.

 

 

thanks for the help at solving the issue! Hopefully its the last time array's give me problems. 

 

 

Update: I can confirm I stopped having errors, I even went and fixed SexoutBang which wasn't working with some NPC's

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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