Jump to content

ammo lists


TheBlob2

Recommended Posts

There's two ways, manually and by script.

 

To do it manually, open the ammo list in question in the GECK and simply add or remove as you see fit. When you save it, your plugin will contain a new record of the ammo list that will override any previous ones. The flipside is that any later instances of that form list in your load order will override your plugin. As you can see, this approach is prone to conflicts, unless the user makes sure to build a merged patch. That means you put part of the workload in the hands of the user, which, in my opinion, should be avoided if at all possible.

 

To do it by script, you'll need NVSE. The vanilla AddFormToFormList function makes permanent changes to your savefile, so it should be used very sparingly. It also adds items at the 0th index, which may not be optimal for ammo lists. There's also no function to remove items from form lists in vanilla, that is only possible with NVSE.

 

You'll need to use ListAddForm and ListRemoveForm form to add and remove items, respectively. These functions make no permanent changes, they apply only for the current game session. That means they must be called once each time the game is loaded, which is where the function GetGameLoaded comes in (also NVSE.)

 

This is the recommended way to do it, since you'll avoid any possible conflicts (between form lists, at least.) Here's a template you can use:

Begin GameMode
    If GetGameLoaded
        ListAddForm [FORM_LIST] [ITEM_TO_ADD]
        ListRemoveForm [FORM_LIST] [ITEM_TO_ADD]
    EndIf
End
Link to comment
Share on other sites

  • Recently Browsing   0 members

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