Jump to content

Editing Workbench CHAmmoUtil won't work ?


surg23

Recommended Posts

Apologies for the vague title, but I'm not sure how to go about getting the Calibr Workbench quest script to display craftable items without having prerequisite materials.

 

 

In the Calibr integrated into FWE some of the Ammo topics were broken and contained invalid conditions, I fixed it so that ammo is now craftable but won't appear in the topic unless you have materials for it.

 

 

I was looking for a way to achieve this in the workbenchQuest but the item I am trying to fix shares the same conditions as items that display the topic/prompt correctly.

 

 

In the Workbench quest script there is a topic to expand the item list which references CHammoUtilQuest for item categories. My guess is there is something in here I need to change, but don't quite understand the variables.

 

 

short i
short n
ref item
ref ammo

set CHAmmoUtil.showAll to 0

; Vanilla
set CHAmmoUtil.showAmmo10mm to 0
set CHAmmoUtil.showAmmo308Caliber to 0
set CHAmmoUtil.showAmmo32Caliber to 0
set CHAmmoUtil.showAmmo44magnum to 0
set CHAmmoUtil.showAmmo556mm to 0
set CHAmmoUtil.showAmmo5mm to 0
set CHAmmoUtil.showAmmoBB to 0
set CHAmmoUtil.showAmmoFatMan to 0
set CHAmmoUtil.showAmmoMissile to 0
set CHAmmoUtil.showAmmoShotgunShell to 0
set CHAmmoUtil.showAmmoFlamerFuel to 0

; CALIBR
set CHAmmoUtil.showRifle762x51 to 0
set CHAmmoUtil.showPistol45ACP to 0
set CHAmmoUtil.showFO14mm to 0
set CHAmmoUtil.showFO2mmEC to 0
set CHAmmoUtil.showFOHNNeedler to 0
set CHAmmoUtil.showRifle473x33caseless to 0

; Energy Ammo
set CHAmmoUtil.showAmmoSmallEnergyCell to 0
set CHAmmoUtil.showAmmoElectronChargePack to 0
set CHAmmoUtil.showAmmoMicroFusionCell to 0

; Patch 4
set CHAmmoUtil.showPistol9x19 to 0
set CHAmmoUtil.showRifle3006 to 0
set CHAmmoUtil.show40mmgrenade to 0


set i to 0
set n to player.getNumItems

Label 1
if i < n
set item to player.getInventoryObject i

if getType item == 40

set ammo to getWeaponAmmo item

if ammo != 0

; Vanilla Ammo
if ammo == Ammo10mm
set CHAmmoUtil.showAmmo10mm to 1
elseif ammo == Ammo308Caliber
set CHAmmoUtil.showAmmo308Caliber to 1
elseif ammo == Ammo32Caliber
set CHAmmoUtil.showAmmo32Caliber to 1
elseif ammo == Ammo44magnum
set CHAmmoUtil.showAmmo44magnum to 1
elseif ammo == Ammo556mm
set CHAmmoUtil.showAmmo556mm to 1
elseif ammo == Ammo5mm
set CHAmmoUtil.showAmmo5mm to 1
elseif ammo == AmmoBB
set CHAmmoUtil.showAmmoBB to 1
elseif ammo == AmmoFatMan
set CHAmmoUtil.showAmmoFatMan to 1
elseif ammo == AmmoMissile
set CHAmmoUtil.showAmmoMissile to 1
elseif ammo == AmmoShotgunShell
set CHAmmoUtil.showAmmoShotgunShell to 1
elseif ammo == AmmoFlamerFuel
set CHAmmoUtil.showAmmoFlamerFuel to 1

; CALIBR Ammo
elseif ammo == CALIBRxAmmoRifle762x51
set CHAmmoUtil.showRifle762x51 to 1
elseif ammo == CALIBRxAmmoPistol45ACP
set CHAmmoUtil.showPistol45ACP to 1
elseif ammo == CALIBRxAmmoFO14mm
set CHAmmoUtil.showFO14mm to 1
elseif ammo == CALIBRxAmmoFO2mmEC
set CHAmmoUtil.showFO2mmEC to 1
elseif ammo == CALIBRxAmmoFOHNNeedler
set CHAmmoUtil.showFOHNNeedler to 1
elseif ammo == CALIBRxAmmoRifle473x33caseless
set CHAmmoUtil.showRifle473x33caseless to 1

; Energy Ammo
elseif ammo == AmmoSmallEnergyCell
set CHAmmoUtil.showAmmoSmallEnergyCell to 1
elseif ammo == AmmoElectronChargePack
set CHAmmoUtil.showAmmoElectronChargePack to 1
elseif ammo == AmmoMicroFusionCell
set CHAmmoUtil.showAmmoMicroFusionCell to 1

; Patch 4
elseif ammo == CALIBRxAmmoPistol9x19
set CHAmmoUtil.showPistol9x19 to 1
elseif ammo == CALIBRxAmmoRifle3006
set CHAmmoUtil.showRifle3006 to 1
elseif ammo == CALIBRxAmmo40mmgrenade
set CHAmmoUtil.show40mmgrenade to 1
endif


endif
endif

set i to i + 1
goto 1
endif

 

 

Where as only the green Items show without prerequisite materials in inventory. The Red items have or did have broken topics which I am in the process of fixing, but even the ones I have fixed won't display without the materials, specifically the Rifle3006 rounds.

 

 

I have tried changing set CHAmmoUtil.showAll to 0 to set CHAmmoUtil.showAll to 1 but the script refuses to save and gives the error message:

 

Default script compiler :line 42 [script command] label not found

 

 

Now I am looking at set item to player.getInventoryObject i - Though I am just playing guessing games at the moment. Does anyone know what the problem could be here ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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