Jump to content

Need a bit of Help - Anufis Underwear


Recommended Posts

When I suggested posting the script here I had you in mind Drake (aka ... I was counting on you).

 

When I looked at the script myself I was wondering if maybe it was populating an array or something.

 

Also, would it be sufficient to just create a male version of the lower body slot underwear and then do the usual of having the male version in Underwear\male and female in Underwear\female (or whatever folder naming the mod uses instead of "Underwear") and then let the game engine sort out whether or not to display the male version or female version?

Link to comment
Share on other sites

Striker, I hope you don't mind, if I add some answers here. But when it's about scripting I just can't resist.

 

 

If you mean those 4 lines starting with a ";", these are just comments/remarks and, while perhaps nice to know, not relevant to the functioning of the code.

 

This is just a simple loop it looks like. Starting with the 1st NPC inside the cell (GetFirstRef xyz) and then iterating through all others (GetNextRef), either "before" executing the code (if male, disabled, a Dark Seducer, Golden Saint, Dremora, already having the item AnufisIGotUnder or the item AnufisIHaveUnder, whatever they are) or afterwards when all checks passed.

 

So in order to make this work also on males, it should suffice to simply remove the block that skips when it's not female:

            if NPC.isFemale==0
              let NPC:=GetNextRef
              Continue
            endif

Without this block the loop will not skip male NPCs anymore like it does now.

 

Thanks for the tip.

 

I believe the AnufisIGotUnder AnufisIHaveUnder is some sort of token to determine the NPC already has the underwear, which is given when NPCs get Underwear, not 100% sure.

 

When I suggested posting the script here I had you in mind Drake (aka ... I was counting on you).

 

When I looked at the script myself I was wondering if maybe it was populating an array or something.

 

Also, would it be sufficient to just create a male version of the lower body slot underwear and then do the usual of having the male version in Underwear\male and female in Underwear\female (or whatever folder naming the mod uses instead of "Underwear") and then let the game engine sort out whether or not to display the male version or female version?

I didn't make that, I made a separate Leveled list with meshes exclusive to Males. So, if I remove the Male/female check in there it'll give female underwear to all NPCs

 

The female underwear comes with a script that makes it work exclusive to females and I saw there's a variant exclusive to Males, so I added some meshes with the Male script to work as a counterpart.

 

So, is it possible to make an "If" line where, after checking all those conditions, it gives Females the AnufisUUW & AnufisLUW and gives Males the Leveled list I made?

 

 

Edited by LostData751
Link to comment
Share on other sites

Yes, I think them being tokens makes sense.

Why, of course it is. You already even got the IF condition to distinguish it so. Just replace these 3 lines:

            NPC.AddItemNS AnufisIGotUnder 1
            NPC.AddItemNS AnufisUUW 1
            NPC.AddItemNS AnufisLUW 1

with this construct:

            if NPC.isFemale==1 ;is female
                        NPC.AddItemNS AnufisIGotUnder 1
                        NPC.AddItemNS AnufisUUW 1
                        NPC.AddItemNS AnufisLUW 1
            else ;is male
                        NPC.AddItemNS AnufisIGotUnder 1
                        NPC.AddItemNS <male version of AnufisUUW> 1
                        NPC.AddItemNS <male version of AnufisLUW> 1
            endif

and there you go.

If in doubt, just show us the complete modified script again to check.

Link to comment
Share on other sites

I HAVE SUCCEDED!!!

            if NPC.isFemale==1

              NPC.AddItemNS AnufisIGotUnder 1

              NPC.AddItemNS AnufisUUW 1

              NPC.AddItemNS AnufisLUW 1

              Continue

            elseif NPC.isFemale==0

              NPC.AddItemNS AnufisIGotUnder 1

              NPC.AddItemNS AnufisLUWM 1

              Continue

            else

              let NPC:=GetNextRef

              Continue

This is what I did, I assumed I should've used the same structure with the let NPC:=GetNextRef and Continue, I added the last else in the occasion there is such a thing as an NPC that can be neither male or female, it works flawlessly.

Saw your reply too late, Drake, but you still initially gave me the right idea on what to try.

 

A few more questions, am I allowed to upload this to the NexusMods? I'm not sure if I should since I didn't ask permission to Anufis and I'm not sure how it works to technically reupload a mod Popcorn71 got out of the downloads since they didn't feel like sharing anymore. However, I'm aware the mods are atleast a decade old, I don't know if it changes anything.

I used RobertMaleV5 Musc Meshes for the Male underwear and "reshaped" Anufis' Bras so they fit the body on the OCO2 Seamless mod.

Link to comment
Share on other sites

If the original mods give explicit permission to modify and then upload then you are OK with uploading your version (give credit to the original mod authors for their work).

 

If the original mods do not give explicit permission to modify and upload modifications to the original then you will need to contact those mod authors and get permission from them (and yes, sometimes that isn't possible because mod authors from long ago are no longer active, but you still need their permission before you can upload your version).

Edited by Striker879
Link to comment
Share on other sites

Hmm, it's a little bit surprising this still works, but perhaps I'm just missing the rest of the script to see why.

 

You putting the "Continue"s into each gender case without a previous "GetNextRef" call should actually prevent the loop from moving on.

And OBSE's "IsFemale" can only return boolean, 0 or 1, so an "else" case should never be met.

 

But as your current script isn't causing your game to hang up thanks to an infinite loop as created by the code part I saw, I must definitely be missing the part of the whole picture which still makes it all work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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