Jump to content

GECK ammo lists overwrite each other


Jendo02

Recommended Posts

I am having an issue where GECK/Fallout New Vegas seems to be overwriting the AmmoList of one mod if the other mod is loaded after.

 

Two mods were created (e.g. A and B), each of these added a new 20Ga round and added the new rounds to the 20Ga ammo list. However if B is loaded after A only B's round is added to the ammo list while if A is loaded first A's round is present. When viewed in the GECK the ammo list will not show the first loaded round in the ammo list.

 

How can one add an ammo type to an ammo list without the ammo list then breaking the ammo list for all subsequent mods?

 

 

Link to comment
Share on other sites

1. Make a quest with the Start Game Enabled box ticked.

 

2. Make a script for it that is as follows:

Begin MenuMode 4
    If GetGameRestarted
        If <Ammo Base ID>.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga <Ammo Base ID>
        EndIf
    EndIf
End

That needs to go in the mod that adds the ammo in your script, obviously. And it needs to be loaded before the other mod that adds ammo. It does require NVSE, but I more or less assume everyone uses that for things like NVAC anyway.

Edited by EPDGaffney
Link to comment
Share on other sites

1. Make a quest with the Start Game Enabled box ticked.

 

2. Make a script for it that is as follows:

Begin MenuMode 4
    If GetGameRestarted
        If <Ammo Base ID>.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga <Ammo Base ID>
        EndIf
    EndIf
End

That needs to go in the mod that adds the ammo in your script, obviously. And it needs to be loaded before the other mod that adds ammo. It does require NVSE, but I more or less assume everyone uses that for things like NVAC anyway.

Thank you. Is there a way which does not require scripts or is this a limitation of the GECK?

 

Additionally is there a way to run this script each time the game loads or similar so that they do not need to start a new game?

Edited by Jendo02
Link to comment
Share on other sites

My script would run every time the game launches, not every time the player starts a new game. I believe this is sufficient for Form List scripts, but you can copy all the text in my script, paste it afterwards, and in that copied text, change MenuMode 4 to GameMode and GetGameRestarted to GetGameLoaded. Should cover all your bases that way.

 

This isn't a limitation of the GECK so much as the system the engine uses to load plug-ins. Whatever loads last wins any record conflicts. In this case, the Form List that the 20-Gauge Shotgun uses to determine what ammo it can load is considered one record, as opposed to each item on that list being an individual record.

 

Similarly, if mods like this don't account for GRA by marking it as a master dependency and adding its ammo to the list (as GRA itself does, overwriting the vanilla game's record of this Ammo Form List), then any weapon that should be able to use GRA ammo won't be able to do that. The correct way to do this (for maximum compatibility and minimum dependencies) is therefore by modifying the Form List at run-time via script.

 

Also, the reason I used that function to add the ammo instead of the vanilla one is that it adds it to the end of the list by default (this can be changed by specifying that parameter in the script), whereas the vanilla function adds it to the beginning of the list, making it the new default ammo for the weapon's spawns and probably messing with a few mods.

 

There is probably a way to merge these two mods that would work this all out using FNVedit, though. I have never needed to do it, but I vaguely recall that being possible.

Link to comment
Share on other sites

My script would run every time the game launches, not every time the player starts a new game. I believe this is sufficient for Form List scripts, but you can copy all the text in my script, paste it afterwards, and in that copied text, change MenuMode 4 to GameMode and GetGameRestarted to GetGameLoaded. Should cover all your bases that way.

I seem to be having problems either writing the correct script or getting it to run as the item is not being added to the ammo list (not usable in game). I am using the following script which should add the item to the ammo list:

Scriptname JendoUraniumRoundAmmoListInsertionScript

Begin MenuMode 4
    If GetGameRestarted
        If Ammo20GaUraniumSlug.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga Ammo20GaUraniumSlug
        EndIf
    EndIf
End

I am starting it with a quest derived from AchivementQuest with start game enabled and the above script selected.

 

However the round is not added to the ammo list (greyed out). I am not to sure what I am doing incorrectly.

Thank you for your help.

Edited by Jendo02
Link to comment
Share on other sites

I did mention you could add stuff afterwards:

 

 

Scriptname JendoUraniumRoundAmmoListInsertionScript

Begin MenuMode 4
    If GetGameRestarted
        If Ammo20GaUraniumSlug.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga Ammo20GaUraniumSlug
            Print "Ammo20GaUraniumSlug added, MenuMode 4, GetGameRestarted."
        EndIf
    EndIf
    If GetGameLoaded
        If Ammo20GaUraniumSlug.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga Ammo20GaUraniumSlug
            Print "Ammo20GaUraniumSlug added, MenuMode 4, GetGameLoaded."
        EndIf
    EndIf
End
Begin GameMode
    If GetGameRestarted
        If Ammo20GaUraniumSlug.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga Ammo20GaUraniumSlug
            Print "Ammo20GaUraniumSlug added, GameMode, GetGameRestarted."
        EndIf
    EndIf
    If GetGameLoaded
        If Ammo20GaUraniumSlug.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga Ammo20GaUraniumSlug
            Print "Ammo20GaUraniumSlug added, GameMode, GetGameLoaded."
        EndIf
    EndIf
End

 

 

 

I never use form lists and always stick to arrays, so I'm a little unfamiliar with how they work (in terms of script modification) beyond the fact that they're fickle. In this instance, you are forced to use form lists, so we'll see what we need to do to make the modifications stick. The majority of alterations like this (adding an effect to an ingestible, setting an event handler, basically stuff that isn't baked into the save data or doesn't have to be) can be made on the main menu screen, which is what my original script tries to do. It's possible that form lists need to be modified once the game is started, which my additions above should account for.

 

Now, I went a little bit further than my suggestion to you and I accounted for every possibility, so it's redundant but should work. I've added Print checks as well, so open up the console and see does the game believe it's added the ammo to the list and when does it think it did it; then make sure it worked.

 

However, I looked at the quest you mentioned and it has the default Script Processing Delay (five seconds unless you modify the Game Settings variable that governs that), and a Priority of 5. Try making the delay a fair bit lower, so that the game can never be started before the script is run, and try turning up the priority to something like 55. It could just be placebo but I swear modifying Priority has made my quest scripts actually take priority over other scripts, despite the general consensus that it just determines where quest dialogue is listed when talking to an NPC with other quests' dialogue available in the player responses.

Edited by EPDGaffney
Link to comment
Share on other sites

Now, I went a little bit further than my suggestion to you and I accounted for every possibility, so it's redundant but should work. I've added Print checks as well, so open up the console and see does the game believe it's added the ammo to the list and when does it think it did it; then make sure it worked.

 

Using the print statements I think I have narrowed the issue down to the If statement regarding the IsInList function. Using the script below only the first two print statments occur, neither of the IsInList branches print as well as the final one. What could be causing the issue?

Scriptname JendoUraniumRoundAmmoListInsertionScript

Begin GameMode
    Print "Game mode working"
    If GetGameRestarted
        Print "Game was restarted"
        If Ammo20GaUraniumSlug.IsInList AmmoList20Ga
            Print " Why are you in a list??"
        Else
            Print " Should now add to list"
            ListAddForm AmmoList20Ga Ammo20GaUraniumSlug
        EndIf
        Print "Well then"
    EndIf
End
Edited by Jendo02
Link to comment
Share on other sites

Well...I'm frankly flabbergasted. As far as I can tell, there is literally no function that does what I thought IsInList this did, whether from the vanilla game or any of the normal extenders. It seems you need the NX plug-in for NVSE to do what I thought it did.

 

So, to explain, IsInList requires an in-game reference object to act as its calling reference, but then checks for its base form on the form list. None of the many additions in FOSE, NVSE, or JIP LN seem to let you use the base ID as the calling reference and then check the form list for that base ID. NX offers a function called NX_IsInList which does this.

 

I'm still open to the possibility that I've missed it somehow. In my view, the easiest workaround for you is to drop your uranium ammo in a custom cell, double-click it to bring up the Reference window, tick the Persistent Reference box, assign it a reference ID (just type the ID in the very top text field labelled accordingly), and then use that reference ID in place of every instance of Ammo20GaUraniumSlug in your script. Note that you can't name a reference object the same as its base ID. More accurately, nothing in the GECK can have the same ID as anything else. So call it Ammo20GaUraniumSlugRef, if you want to grow up to be like me (you don't, but you should still do this).

 

There are better ways that I would probably use, but we'd get into arrays or make your mod require NX. Also, I'm still a little sceptical that there's no function to do what I thought IsInList could do, so I'm leery to go mad complicating this.

Link to comment
Share on other sites

 

My script would run every time the game launches, not every time the player starts a new game. I believe this is sufficient for Form List scripts, but you can copy all the text in my script, paste it afterwards, and in that copied text, change MenuMode 4 to GameMode and GetGameRestarted to GetGameLoaded. Should cover all your bases that way.

I seem to be having problems either writing the correct script or getting it to run as the item is not being added to the ammo list (not usable in game). I am using the following script which should add the item to the ammo list:

Scriptname JendoUraniumRoundAmmoListInsertionScript

Begin MenuMode 4
    If GetGameRestarted
        If Ammo20GaUraniumSlug.IsInList AmmoList20Ga
        Else
            ListAddForm AmmoList20Ga Ammo20GaUraniumSlug
        EndIf
    EndIf
End

I am starting it with a quest derived from AchivementQuest with start game enabled and the above script selected.

 

However the round is not added to the ammo list (greyed out). I am not to sure what I am doing incorrectly.

Thank you for your help.

 

 

This sounds almost like the ammo item is not flagged as playable.

Just a mention incase.

 

On a side note about dropping ammo in a cell to create a reference ... could also use containers as proxy lists ... then drop the container in the world somewhere.

 

Also some times I have found passing the form-ID created from dropping in a reference. Found next to the place you name them in parenthesis.

Seems to work better in some situations ... although not sure what they are specifically.

Link to comment
Share on other sites

I've discovered something interesting since commenting here: unless I'm mistaken, when you call a script on a base ID, it's never before the dot, and that spot before the dot is always reserved for a reference. A ref variable can store either, so scripts will compile in either situation, but an object/actor instance in the game world goes before the dot if it's the calling reference, whereas the base ID goes after the name of the function if the base ID is what you're calling the script on.

 

So, for example, SetWeather, StartQuest, GetRefsInCell, GetInCell, and any function I can think of that is run on a base ID, always uses syntax that starts with the function name and then wants the base ID after that.

 

I realised this when working with this function:

https://geckwiki.com/index.php/GetObjectEffect

 

It takes this syntax:

(ref) ref.GetObjectEffect item:ref

So, in this case, you can use the function by having a reference call it or running it on a base object. In the former case, it's ref.GetObjectEffect, but in the latter case it's GetObjectEffect ref. I never see anyone mention this but I think it's an actual syntax rule.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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