Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

10 hours ago, dborg2 said:

I'm running into a new issue.

I have a formidlist(A) with multiple forrmidlists, Like "B".

I have a script that browses through all formidlists within formidlist(A) to search for a form, and do stuff based, on it being found.

 

Now in game I have a different script that adds a form to formidlist B, but it seems that it isn't updating into formislist(A)-formidlists.

When my other script browses through FormIdList-A's formidlists, it doesn't find the new form, I added in 'B'.

 

Is thas bad programming on my side, or is it a bug from Bethesda, and what would be the best workaround?

 

Does re-adding FormidList-B to Formidlist-A fix it, or do i need to add a new formidlist-C to A?

As I see it, you should see the ones you added later too. Could you post both the scripts, one to browse through all the elements and one to add the form in B?

By the way, if you're using NVSE to add elements to lists, then it is a non-persistent operation and it should be repeated everytime the game restarts

Link to comment
1 hour ago, A.J. said:

As I see it, you should see the ones you added later too. Could you post both the scripts, one to browse through all the elements and one to add the form in B?

By the way, if you're using NVSE to add elements to lists, then it is a non-persistent operation and it should be repeated everytime the game restarts

SexoutP5SBodySwapSub is called by all swap-scripts periocally. (And gets a formidlist 'A' supplied)

 

SexoutSCR00SAddDLCStuff will be called when the user presses the 'SCR-MCM -Extra' button.

 

And picture is one of those FormIDLists (A) with in it a FormIDList 'B' that should work, but doesn't.

PregBodySwapOutfitOWBList.jpg

 

(Note that I called the 'AddDLCStuff' script in the same session as the rest of the testing I did)

SexoutP5SBodySwapSub.txt

SexoutSCR00SAddDLCStuff.txt

Link to comment

Mmmh... I don't wanna state the obvious... but I guess that your best deal would be first be sure that the lists REALLY contain what you are expecting. Instead than a simple DBPrintC, I'd dump them all, better if on a file so I could check in tranquillity.

Then and only then, when I'd be really sure that they are really loaded, I'd check why the second script doesn't browse correctly through the elements.

Link to comment
  • 2 months later...

I'm back again. This time running into the next scripting issue.

 

When wearing an outfit and P2 script SexoutP5SBodySwapOutfit.txt is called with 'actor' and '2' and it will call SexoutP5SBodySwapSub.txt  to find the P2-version of the outfit that 'actor'  is wearing, and return it.

 

The same scripts are called by P3, but then with the 'CurrentOutfit' + '3'. However, for all outfits, P2 is returned and I just can't find out why.

 

---(Edit from here)

I've managed to track down the issue to the SwapSub script.

 

Full ("edited for testing"-subscript)

Quote

scn SexoutP5SBodySwapSub
; argument vars
ref rSwapUpperBody
ref rCurrentOutfit
ref rGlobalList
int iBellySize
int iBellySizeTemp
int iMaxP
int iArrayLength

;other vars
array_var Entry
ref rCurrList

Begin Function {rCurrentOutfit, iBellySize, rGlobalList, iMaxP}
     Let rSwapUpperBody := NVFakeGolfBall
    Let iBellySizeTemp := 3 ; iBellySize
    if iBellySizeTemp > iMaxP
        Let iBellySizeTemp := iMaxP
    endif

      if ListGetCount rGlobalList > 0
          foreach Entry <- (GetListForms rGlobalList)
             let rCurrList := Entry["value"]
             if (-1 < IsRefInList rCurrList rCurrentOutfit)
                Let iArrayLength :=  Ar_size Entry                                           ; --->
                if iBellySizeTemp > iArrayLength 
                    Let iBellySizeTemp := iArrayLength
                endif    
                                                                                 ; <--- If I comment out this section. It works. At the risk of buffer-overflow
                let rSwapUpperBody := ListGetNthForm rCurrList iBellySizeTemp
                SetFunctionValue rSwapUpperBody
                printc "SexoutP5SBodySwapSub, found  %n" rSwapUpperBody    
                BREAK
            endif
        loop
    endif
    
    SetFunctionValue rSwapUpperBody
    return
end

 

For some reason iArrayLength becomes 2, and I can't figure out why.

 

Explanation of variables:

Quote

rCurrentOutfit = The outfit the actor is currently wearing
iBellySize = The size we want
rGlobalList = an Array containing outfit-Arrays (so 2 dimensional array). The different outfit-arrays don't have the same length though.

iMaxP = Some of the outfit lists contain 'garbage'. For instance there are 6 Not-pregnant NCR Trooperoutfits in FNV. I want to recognize all, but only use the default 1. These exception-outfits are in different globallists

 

Am I using the 'Ar_size' incorrectly? Or am I required to have all entries with the same array length?

 

Link to comment
On 2/12/2019 at 8:00 AM, dborg2 said:

I'm back again. This time running into the next scripting issue.

 

When wearing an outfit and P2 script SexoutP5SBodySwapOutfit.txt is called with 'actor' and '2' and it will call SexoutP5SBodySwapSub.txt  to find the P2-version of the outfit that 'actor'  is wearing, and return it.

 

The same scripts are called by P3, but then with the 'CurrentOutfit' + '3'. However, for all outfits, P2 is returned and I just can't find out why.

 

---(Edit from here)

I've managed to track down the issue to the SwapSub script.

 

Full ("edited for testing"-subscript)

For some reason iArrayLength becomes 2, and I can't figure out why.

 

Explanation of variables:

 

Am I using the 'Ar_size' incorrectly? Or am I required to have all entries with the same array length?

 

Update... I changed all the global-formidlists to contain the same amount of outfits, rewrote my swapping script SexoutP5SBodySwapOutfit and removed the 'Ar_size' check from SexoutP5SBodySwapSub.  Now it seems to work fine.

 

 

 

Link to comment
  • 8 months later...

Howdy could someone help me with a tiny issue Im having? 
Im new to moding and tried to do a simple mod that adds couple of prostitutes with vanila fade to black (at least for now) I wrote a script that removes 50 caps from player inventory and plays a sound effect along with fade to black this works however It didnt check player caps count so If players had 0 caps the script would play regardless and player would get a freebie. I added a condition to remedy this but now the dialogue option dont show up at all 

Screenshot_5.png

Screenshot_6.png

Link to comment
49 minutes ago, Dibella_Follower said:

Howdy could someone help me with a tiny issue Im having? 
Im new to moding and tried to do a simple mod that adds couple of prostitutes with vanila fade to black (at least for now) I wrote a script that removes 50 caps from player inventory and plays a sound effect along with fade to black this works however It didnt check player caps count so If players had 0 caps the script would play regardless and player would get a freebie. I added a condition to remedy this but now the dialogue option dont show up at all 

Screenshot_5.png

Screenshot_6.png

I'd try Target instead of Reference, in the condition

Link to comment
12 minutes ago, elleven117 said:

so in short i have to know coding in order too mod a pc game also nothing helps my issues my game freezes which FORCES ME to restard my computer EVERY FUCKING TIME

To mod a game, you have to know how to mod.

Link to comment
20 minutes ago, elleven117 said:

so in short i have to know coding in order too mod a pc game also nothing helps my issues my game freezes which FORCES ME to restard my computer EVERY FUCKING TIME

Depends on the mod for example if you want to make an armor you dont need scritping but you need to know how to make textures so photoshop skills, nothing creates itself you need some skills and motivation in everything you do 

Link to comment
  • 1 year later...

Howdy again I ran into a weird issue.
Basically  I wanted to convert Vikki & Vance gun from 9mm smg to 45 sub machine gun from honest hearths, everything went well until I tried to change the texture so it actually looks like Tommy gun from the DLC at first I couldn't find it in data folder that's when I learned everything is in BSA folders okay  I thought I extracted Honest Hearts BSA with MO2 to a folder on my desktop then i clicked to replce texture in GECK navigated to proper texture clicked accept and i get invalid directory error.

I assume solution would be to extract the BSA into new vegas data dir but my question now is this wouldn't that mess with anything? should I leave those files there or just leave the 45 smg texture? or am I wrong completely

Link to comment
3 hours ago, Dibella_Follower said:

Howdy again I ran into a weird issue.
Basically  I wanted to convert Vikki & Vance gun from 9mm smg to 45 sub machine gun from honest hearths, everything went well until I tried to change the texture so it actually looks like Tommy gun from the DLC at first I couldn't find it in data folder that's when I learned everything is in BSA folders okay  I thought I extracted Honest Hearts BSA with MO2 to a folder on my desktop then i clicked to replce texture in GECK navigated to proper texture clicked accept and i get invalid directory error.

I assume solution would be to extract the BSA into new vegas data dir but my question now is this wouldn't that mess with anything? should I leave those files there or just leave the 45 smg texture? or am I wrong completely

If it comes to textures, it should stay under Data\Textures, or some subfolder of that.

You assumed right: extracting inside NV folder is a good way to have right paths and be able to target these files inside the geck. However, if you already installed some mod which replaces vanilla (i.e. an armor replacer, just to say), this operation will overwrite everything.

 

Do you know how to use xEdit? imho it's the fastest way to write a path like that without extracting the files from the BSA and avoid to overwrite modded content.

Link to comment
10 minutes ago, A.J. said:

If it comes to textures, it should stay under Data\Textures, or some subfolder of that.

You assumed right: extracting inside NV folder is a good way to have right paths and be able to target these files inside the geck. However, if you already installed some mod which replaces vanilla (i.e. an armor replacer, just to say), this operation will overwrite everything.

 

Do you know how to use xEdit? imho it's the fastest way to write a path like that without extracting the files from the BSA and avoid to overwrite modded content.

Sadly im not familiar with xEdit.
And yes that could be a problem if it overwrites everything plus I don't think it would work for other people unless they would also extract BSA file to their data folder

Link to comment
1 hour ago, Dibella_Follower said:

Sadly im not familiar with xEdit.
And yes that could be a problem if it overwrites everything plus I don't think it would work for other people unless they would also extract BSA file to their data folder

Oh it will work! but I should explain better what there is behind, I'll do my best.

If you open a model in the GECK preview, that model will read the texture inside the BSA, and will show it, ok?

So more in general everything inside the BSA is still read from the GECK in a straight and transparent way, as if it was extracted.

But when you browse for a file because you need to put a path in the GECK, it will show the actual files you have in the folders, and NOT what's inside the BSA.

So, in the GECK you'll have troubles to specify a file and its path which is contained in a BSA, xEdit helps a lot with this.

 

I don't know if I explained you well, but the best deal in this specific case could be this: do not extract everything, to not overwrite your mods... but instead extract only the file/s you need, just be careful to make them end up in their vanilla position (which will be \Data\Textures etc.). After that, you'll be able to point them inside the GECK too. If a file is already present, because a mod is replacing it... well then you don't even need to extract it, just point to the replacer texture and you're good.

Link to comment
14 minutes ago, A.J. said:

Oh it will work! but I should explain better what there is behind, I'll do my best.

If you open a model in the GECK preview, that model will read the texture inside the BSA, and will show it, ok?

So more in general everything inside the BSA is still read from the GECK in a straight and transparent way, as if it was extracted.

But when you browse for a file because you need to put a path in the GECK, it will show the actual files you have in the folders, and NOT what's inside the BSA.

So, in the GECK you'll have troubles to specify a file and its path which is contained in a BSA, xEdit helps a lot with this.

 

I don't know if I explained you well, but the best deal in this specific case could be this: do not extract everything, to not overwrite your mods... but instead extract only the file/s you need, just be careful to make them end up in their vanilla position (which will be \Data\Textures etc.). After that, you'll be able to point them inside the GECK too. If a file is already present, because a mod is replacing it... well then you don't even need to extract it, just point to the replacer texture and you're good.

I think I understand now thanks

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