Jump to content

Integrating custom ammo to leveled lists using scripts - need help


EmeraldHaze

Recommended Posts

Greetings fellow mod-makers. I'm currently working on a mod that will add a new type of custom ammo to the game. While crafting and form lists are done with, I've hit a bump with leveled lists and can't progress forward. My goal is to add new ammo to leveled lists (so they would appear for sale and as loot) using a quest script for maximum compatibility (an in-development version of the script is presented below):

 

scn NLASCPTListsModification

Begin GameMode

If GetGameRestarted

LeveledListAddForm Ammo10mm75 NLAAMMONL10mm 1 1 0.0
LeveledListAddForm Ammo10mmRounds50 NLAAMMONL10mm 1 3 0.0
LeveledListAddForm Ammo10mmRounds50 NLAAMMONL10mm 1 5 0.0
LeveledListAddForm Ammo10mmScrounger NLAAMMONL10mm 1 1 0.0

LeveledListAddForm Ammo127mm75 NLAAMMONL127mm 1 1 0.0
LeveledListAddForm Ammo127mmScrounger NLAAMMONL127mm 1 1 0.0

LeveledListAddForm Ammo12ga75 NLAAMMONL12Ga 1 1 0.0
LeveledListAddForm Ammo12GaScrounger NLAAMMONL12Ga 1 1 0.0

LeveledListAddForm Ammo20ga75 NLAAMMONL20Ga 1 1 0.0
LeveledListAddForm Ammo20GaScrounger NLAAMMONL20Ga 1 1 0.0

LeveledListAddForm Ammo22375 NLAAMMONL223 1 1 0.0

LeveledListAddForm Ammo22LR75 NLAAMMONL22LR 1 1 0.0
LeveledListAddForm Ammo22LRScrounger NLAAMMONL22LR 1 1 0.0

LeveledListAddForm Ammo25mmGrenade75 NLAAMMONL25mmGrenade 1 1 0.0
LeveledListAddForm Ammo25mmGrenade100 NLAAMMONL25mmGrenade 1 1 0.0
LeveledListAddForm Ammo25mmGrenadeScrounger NLAAMMONL25mmGrenade 1 1 0.0

LeveledListAddForm Ammo357magnum75 NLAAMMONL357 1 1 0.0
LeveledListAddForm Ammo357magnumScrounger NLAAMMONL357 1 1 0.0

LeveledListAddForm Ammo38special75 NLAAMMONL357 1 1 0.0

LeveledListAddForm Ammo40mmGrenade75 NLAAMMONL40mmGrenade 1 1 0.0
LeveledListAddForm Ammo40mmGrenade100 NLAAMMONL40mmGrenade 1 1 0.0
LeveledListAddForm Ammo40mmGrenadeScrounger NLAAMMONL40mmGrenade 1 1 0.0

LeveledListAddForm Ammo44magnum75 NLAAMMONL44 1 1 0.0
LeveledListAddForm Ammo44magnumScrounger NLAAMMONL44 1 1 0.0

LeveledListAddForm Ammo44special25 NLAAMMONL44 1 1 0.0
LeveledListAddForm Ammo44special75 NLAAMMONL44 1 1 0.0

LeveledListAddForm Ammo457075 NLAAMMONL4570 1 1 0.0
LeveledListAddForm Ammo4570Scrounger NLAAMMONL4570 1 1 0.0

LeveledListAddForm Ammo556mm75 NLAAMMONL223 1 1 0.0
LeveledListAddForm Ammo556mmScrounger NLAAMMONL223 1 1 0.0

LeveledListAddForm Ammo9mm75 NLAAMMONL9mm 1 1 0.0
LeveledListAddForm Ammo9mmScrounger NLAAMMONL9mm 1 1 0.0

LeveledListAddForm AmmoElectronChargePack75 NLAAMMONLECP 1 1 0.0
LeveledListAddForm AmmoElectronChargePackScrounger NLAAMMONLECP 1 1 0.0

LeveledListAddForm AmmoMicroFusionCell75 NLAAMMONLMFC 1 1 0.0
LeveledListAddForm AmmoMicroFusionCellScrounger NLAAMMONLMFC 1 1 0.0

LeveledListAddForm AmmoSmallEnergyCell75 NLAAMMONLSEC 1 1 0.0
LeveledListAddForm AmmoSmallEnergyCellScrounger NLAAMMONLSEC 1 1 0.0

LeveledListAddForm VendorAmmo9mm NLAAMMONL9mm 1 1 0.0
LeveledListAddForm VendorAmmo10mm NLAAMMONL10mm 1 1 0.0
LeveledListAddForm VendorAmmo127mm NLAAMMONL127mm 1 1 0.0
LeveledListAddForm VendorAmmo12Ga NLAAMMONL12Ga 1 1 0.0
LeveledListAddForm VendorAmmo20Ga NLAAMMONL20Ga 1 1 0.0
LeveledListAddForm VendorAmmo22LR NLAAMMONL22LR 1 1 0.0
LeveledListAddForm VendorAmmo25mmGrenade NLAAMMONL25mmGrenade 1 1 0.0
LeveledListAddForm VendorAmmo40mmGrenade NLAAMMONL40mmGrenade 1 1 0.0
LeveledListAddForm VendorAmmo357magnum NLAAMMONL357 1 1 0.0
LeveledListAddForm VendorAmmo44magnum NLAAMMONL44 1 1 0.0
LeveledListAddForm VendorAmmo556mm NLAAMMONL223 1 1 0.0
LeveledListAddForm VendorAmmo4570 NLAAMMONL4570 1 1 0.0
LeveledListAddForm VendorAmmoElectronChargePack NLAAMMONLECP 1 1 0.0
LeveledListAddForm VendorAmmoMicroFusionCell NLAAMMONLMFC 1 1 0.0
LeveledListAddForm VendorAmmoSmallEnergyCell NLAAMMONLSEC 1 1 0.0

LeveledListAddForm LootAmmo9mm NLAAMMONL9mm 1 1 0.0
LeveledListAddForm LootAmmo10mm NLAAMMONL10mm 1 1 0.0
LeveledListAddForm LootAmmo127mm NLAAMMONL127mm 1 1 0.0
LeveledListAddForm LootAmmo12Ga NLAAMMONL12Ga 1 1 0.0
LeveledListAddForm LootAmmo20Ga NLAAMMONL20Ga 1 1 0.0
LeveledListAddForm LootAmmo22LR NLAAMMONL22LR 1 1 0.0
LeveledListAddForm LootAmmo25mmGrenade NLAAMMONL25mmGrenade 1 1 0.0
LeveledListAddForm LootAmmo40mmGrenade NLAAMMONL40mmGrenade 1 1 0.0
LeveledListAddForm LootAmmo357magnum NLAAMMONL357 1 1 0.0
LeveledListAddForm LootAmmo44magnum NLAAMMONL44 1 1 0.0
LeveledListAddForm LootAmmo556mm NLAAMMONL223 1 1 0.0
LeveledListAddForm LootAmmo4570 NLAAMMONL4570 1 1 0.0
LeveledListAddForm LootAmmoElectronChargePack NLAAMMONLECP 1 1 0.0
LeveledListAddForm LootAmmoMicroFusionCell NLAAMMONLMFC 1 1 0.0
LeveledListAddForm LootAmmoSmallEnergyCell NLAAMMONLSEC 1 1 0.0

LeveledListAddForm NVDLC02Ammo45Auto75 NLAAMMONL45 1 1 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 1 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 2 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 3 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 4 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 5 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 6 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 7 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 8 0.0
LeveledListAddForm NVDLC02Ammo45Auto100 NLAAMMONL45 1 9 0.0
LeveledListAddForm NVDLC02Ammo45AutoScrounger NLAAMMONL45 1 1 0.0

LeveledListAddForm NVDLC02VendorAmmo45Auto NLAAMMONL45 1 1 0.0
LeveledListAddForm NVDLC02VendorAmmo45Auto50 NLAAMMONL45 1 1 0.0

LeveledListAddForm NVDLC02VendorAmmo45AutoHigh NLAAMMONL45 1 1 0.0
LeveledListAddForm NVDLC02VendorAmmo45AutoHigh50 NLAAMMONL45 1 1 0.0

Endif

End

 

When I check a leveled list with dumplevlist it indicates that my ammo was added to the list and appears alongside standard ammo in the same quantities in the dump. The ammo is for sale from 2 separate vendors, but the problem is, when I try to buy some of my custom ammo from a vendor, the game puts less ammo in my inventory than it should. Example - I'm buying 25 custom rounds, all 25 rounds are gone from merchant's inventory, but only 8 spawned in my inventory. I guess I'm not seeing the whole picture here as I'm not very experienced and could not find any info on this. I would be very grateful if someone could chime in with a suggestion as to what may be my oversight in this case.

Link to comment
Share on other sites

Thanks for your input. Unfortunately, changing item health value didn't help. In fact, I'm trying to inject my custom ammo into vanilla existing leveled lists, and all the vanilla ammo inside them has 0% health too. What I'm currently doing is just adding my custom ammo inside vanilla lists in the same amount as vanilla ammo that is already added there. Still, when I buy 20 Custom Energy Cells I get 3 in my inventory, when I buy 20 Custom .223 rounds - I get 11, so no consistency there. I've seen ammo added into lists with fancy NVSE functions, but that just simplifies scripts and makes them less laborous to edit, so my approach should work the same way, yet it doesn't. Oh well, just going to try to make my script to work as intended for a while longer before resorting to other methods.

 

Well, no matter what I tried, my custom ammo would not integrate properly into vanilla leveled lists through scripts. Maybe there is a way using NVSE functions, but I don't have the time or motivation to figure it out. Instead i decided to use ammo boxes, wich I integrated into vanilla lists without any problems. When a player buys one - a bunch of ammo gets added to his inventory. Clean and simple, case closed.

Edited by EmeraldHaze
Link to comment
Share on other sites

Yeah, very well may be. I use a heavy enough load order of about 90 plugins. Granted, most of them are bug-fixes and ease of life stuff plus scripted to boot, but conflicts creep in with scripted mods too. Or maybe it's just our old "pal" Gamebryo being a "solid" engine that it is =)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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