corsta Posted August 13, 2013 Share Posted August 13, 2013 Wondering if anyone can help with my script problems - I can't save the script, which tells me there's an issue somewhere. However, Script Validator couldn't pick up on anything and all references made in the script are as mentioned. Other than that, I have no idea what it may be, and yet that's fine. I've tried different variations of SCN to see if that may be it, but nope. Here's my script - can anyone recommend a fix please? SCN VAmmoSortingScript int AmmoCount Begin OnActivate Player Activate ;10 mmset AmmoCount to Player.GetItemCount Ammo10mmAmmoBox10mmRef.AddItem Ammo10mm AmmoCountPlayer.RemoveItem Ammo10mm AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo10mmHollowPointAmmoBox10mmRef.AddItem Ammo10mmHollowPoint AmmoCountPlayer.RemoveItem Ammo10mmHollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo10mmJHPHandLoadAmmoBox10mmRef.AddItem Ammo10mmJHPHandLoad AmmoCountPlayer.RemoveItem Ammo10mmJHPHandLoad AmmoCount 1 ;9mmset AmmoCount to Player.GetItemCount Ammo9mmAmmoBox9mmRef.AddItem Ammo9mm AmmoCountPlayer.RemoveItem Ammo9mm AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo9mmHollowPointAmmoBox9mmRef.AddItem Ammo9mmHollowPoint AmmoCountPlayer.RemoveItem Ammo9mmHollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo9mmPAmmoBox9mmRef.AddItem Ammo9mmP AmmoCountPlayer.RemoveItem Ammo9mmP AmmoCount 1 ;22LRset AmmoCount to Player.GetItemCount Ammo22LRAmmoBox22LRRef.AddItem Ammo22LR AmmoCountPlayer.RemoveItem Ammo22LR AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo22LRHollowPointAmmoBox22LRRef.AddItem Ammo22LRHollowPoint AmmoCountPlayer.RemoveItem Ammo22LRHollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo22LRPlinkingAmmoBox22LRRef.AddItem Ammo22LRPlinking AmmoCountPlayer.RemoveItem Ammo22LRPlinking AmmoCount 1 ;BBsset AmmoCount to Player.GetItemCount AmmoBBAmmoBoxBBRef.AddItem AmmoBB AmmoCountPlayer.RemoveItem AmmoBB AmmoCount 1 ;357set AmmoCount to Player.GetItemCount Ammo357MagnumAmmoBox357MagnumREF.AddItem Ammo357Magnum AmmoCountPlayer.RemoveItem Ammo357Magnum AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo357MagnumJFPHandLoadAmmoBox357MagnumREF.AddItem Ammo357MagnumJFPHandLoad AmmoCountPlayer.RemoveItem Ammo357MagnumJFPHandLoad AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo357MagnumHollowPointAmmoBox357MagnumREF.AddItem Ammo357MagnumHollowPoint AmmoCountPlayer.RemoveItem Ammo357MagnumHollowPoint AmmoCount 1 ;44magset AmmoCount to Player.GetItemCount Ammo44magnumAmmoBox44MagnumREF.AddItem Ammo44magnum AmmoCountPlayer.RemoveItem Ammo44magnum AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo44MagnumHollowPointAmmoBox44MagnumREF.AddItem Ammo44MagnumHollowPoint AmmoCountPlayer.RemoveItem Ammo44MagnumHollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo44MagnumSWCHandLoadAmmoBox44MagnumREF.AddItem Ammo44MagnumSWCHandLoad AmmoCountPlayer.RemoveItem Ammo44MagnumSWCHandLoad AmmoCount 1 ;38specialset AmmoCount to Player.GetItemCount Ammo38SpecialAmmoBox357MagnumREF.AddItem Ammo38Special AmmoCountPlayer.RemoveItem Ammo38Special AmmoCount 1 ;44specialset AmmoCount to Player.GetItemCount Ammo44SpecialAmmoBox44MagnumREF.AddItem Ammo44Special AmmoCountPlayer.RemoveItem Ammo44Special AmmoCount 1 ;12gaugeset AmmoCount to Player.GetItemCount Ammo12GaAmmoBox12GaREF.AddItem Ammo12Ga AmmoCountPlayer.RemoveItem Ammo12Ga AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo12GaMagnumAmmoBox12GaREF.AddItem Ammo12GaMagnum AmmoCountPlayer.RemoveItem Ammo12GaMagnum AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo12GaSlugAmmoBox12GaREF.AddItem Ammo12GaSlug AmmoCountPlayer.RemoveItem Ammo12GaSlug AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo12GaBeanBagAmmoBox12GaREF.AddItem Ammo12GaBeanBag AmmoCountPlayer.RemoveItem Ammo12GaBeanBag AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo12GaCoinShotAmmoBox12GaREF.AddItem Ammo12GaCoinShot AmmoCountPlayer.RemoveItem Ammo12GaCoinShot AmmoCount 1 ;20Gaugeset AmmoCount to Player.GetItemCount Ammo20GaAmmoBox20GaREF.AddItem Ammo20Ga AmmoCountPlayer.RemoveItem Ammo20Ga AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo20GaMagnumAmmoBox20GaREF.AddItem Ammo20GaMagnum AmmoCountPlayer.RemoveItem Ammo20GaMagnum AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo20GaSlugAmmoBox20GaREF.AddItem Ammo20GaSlug AmmoCountPlayer.RemoveItem Ammo20GaSlug AmmoCount 1 ;556mmset AmmoCount to Player.GetItemCount Ammo556mmAmmoBox556mmREF.AddItem Ammo556mm AmmoCountPlayer.RemoveItem Ammo556mm AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo556mmHollowPointAmmoBox556mmREF.AddItem Ammo556mmHollowPoint AmmoCountPlayer.RemoveItem Ammo556mmHollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo556mmArmorPiercingAmmoBox556mmREF.AddItem Ammo556mmArmorPiercing AmmoCountPlayer.RemoveItem Ammo556mmArmorPiercing AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo556mmSurplusAmmoBox556mmREF.AddItem Ammo556mmSurplus AmmoCountPlayer.RemoveItem Ammo556mmSurplus AmmoCount 1 ;223set AmmoCount to Player.GetItemCount Ammo223AmmoBox556mmREF.AddItem Ammo223 AmmoCountPlayer.RemoveItem Ammo223 AmmoCount 1 ;127mmset AmmoCount to Player.GetItemCount Ammo127mmAmmoBox127REF.AddItem Ammo127mm AmmoCountPlayer.RemoveItem Ammo127mm AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo127mmHollowPointAmmoBox127REF.AddItem Ammo127mmHollowPoint AmmoCountPlayer.RemoveItem Ammo127mmHollowPoint AmmoCount 1 ;4570set AmmoCount to Player.GetItemCount Ammo4570AmmoBox4570REF.AddItem Ammo4570 AmmoCountPlayer.RemoveItem Ammo4570 AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo4570HollowPointAmmoBox4570REF.AddItem Ammo4570HollowPoint AmmoCountPlayer.RemoveItem Ammo4570HollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo4570SWCHandLoadAmmoBox4570REF.AddItem Ammo4570SWCHandLoad AmmoCountPlayer.RemoveItem Ammo4570SWCHandLoad AmmoCount 1 ;308set AmmoCount to Player.GetItemCount Ammo308AmmoBox308REF.AddItem Ammo308 AmmoCountPlayer.RemoveItem Ammo308 AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo308ArmorPiercingAmmoBox308REF.AddItem Ammo308ArmorPiercing AmmoCountPlayer.RemoveItem Ammo308ArmorPiercing AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo308HollowPointAmmoBox308REF.AddItem Ammo308HollowPoint AmmoCountPlayer.RemoveItem Ammo308HollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo308JSPHandLoadAmmoBox308REF.AddItem Ammo308JSPHandLoad AmmoCountPlayer.RemoveItem Ammo308JSPHandLoad AmmoCount 1 ;50mgset AmmoCount to Player.GetItemCount Ammo50MGAmmoBox50calREF.AddItem Ammo50MG AmmoCountPlayer.RemoveItem Ammo50MG AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo50MGArmorPiercingAmmoBox50calREF.AddItem Ammo50MGArmorPiercing AmmoCountPlayer.RemoveItem Ammo50MGArmorPiercing AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo50MGHandLoadAmmoBox50calREF.AddItem Ammo50MGHandLoad AmmoCountPlayer.RemoveItem Ammo50MGHandLoad AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo50MGIncendiaryAmmoBox50calREF.AddItem Ammo50MGIncendiary AmmoCountPlayer.RemoveItem Ammo50MGIncendiary AmmoCount 1 ;5mmset AmmoCount to Player.GetItemCount Ammo5mmAmmoBox5mmREF.AddItem Ammo5mm AmmoCountPlayer.RemoveItem Ammo5mm AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo5mmArmorPiercingAmmoBox5mmREF.AddItem Ammo5mmArmorPiercing AmmoCountPlayer.RemoveItem Ammo5mmArmorPiercing AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo5mmHollowPointAmmoBox5mmREF.AddItem Ammo5mmHollowPoint AmmoCountPlayer.RemoveItem Ammo5mmHollowPoint AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo5mmSurplusAmmoBox5mmREF.AddItem Ammo5mmSurplus AmmoCountPlayer.RemoveItem Ammo5mmSurplus AmmoCount 1 ;ECPset AmmoCount to Player.GetItemCount AmmoElectronChargePackAmmoBoxElectronChargePacksREF.AddItem AmmoElectronChargePack AmmoCountPlayer.RemoveItem AmmoElectronChargePack AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoElectronChargePackBulkAmmoBoxElectronChargePacksREF.AddItem AmmoElectronChargePackBulk AmmoCountPlayer.RemoveItem AmmoElectronChargePackBulk AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoElectronChargePackMaxChargeAmmoBoxElectronChargePacksREF.AddItem AmmoElectronChargePackMaxCharge AmmoCountPlayer.RemoveItem AmmoElectronChargePackMaxCharge AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoElectronChargePackOverChargeAmmoBoxElectronChargePacksREF.AddItem AmmoElectronChargePackOverCharge AmmoCountPlayer.RemoveItem AmmoElectronChargePackOverCharge AmmoCount 1 ;MFCset AmmoCount to Player.GetItemCount AmmoMicroFusionCellAmmoBoxMicroFusionCellsREF.AddItem AmmoMicroFusionCell AmmoCountPlayer.RemoveItem AmmoMicroFusionCell AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoMicroFusionCellBulkAmmoBoxMicroFusionCellsREF.AddItem AmmoMicroFusionCellBulk AmmoCountPlayer.RemoveItem AmmoMicroFusionCellBulk AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoMicroFusionCellMaxChargeAmmoBoxMicroFusionCellsREF.AddItem AmmoMicroFusionCellMaxCharge AmmoCountPlayer.RemoveItem AmmoMicroFusionCellMaxCharge AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoMicroFusionCellOverChargeAmmoBoxMicroFusionCellsREF.AddItem AmmoMicroFusionCellOverCharge AmmoCountPlayer.RemoveItem AmmoMicroFusionCellOverCharge AmmoCount 1 ;SECset AmmoCount to Player.GetItemCount AmmoSmallEnergyCellAmmoBoxSmallEnergyCellsREF.AddItem AmmoSmallEnergyCell AmmoCountPlayer.RemoveItem AmmoSmallEnergyCell AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoSmallEnergyCellBulkAmmoBoxSmallEnergyCellsREF.AddItem AmmoSmallEnergyCellBulk AmmoCountPlayer.RemoveItem AmmoSmallEnergyCellBulk AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoSmallEnergyCellMaxChargeAmmoBoxSmallEnergyCellsREF.AddItem AmmoSmallEnergyCellMaxCharge AmmoCountPlayer.RemoveItem AmmoSmallEnergyCellMaxCharge AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoSmallEnergyCellOverChargeAmmoBoxSmallEnergyCellsREF.AddItem AmmoSmallEnergyCellOverCharge AmmoCountPlayer.RemoveItem AmmoSmallEnergyCellOverCharge AmmoCount 1 ;Alienset AmmoCount to Player.GetItemCount AmmoAlienPowerCellAmmoBoxAlienPowerCellsREF.AddItem AmmoAlienPowerCell AmmoCountPlayer.RemoveItem AmmoAlienPowerCell AmmoCount 1 ;Messet AmmoCount to Player.GetItemCount AmmoMesmetronPowerCellAmmoBoxMiscREF.AddItem AmmoMesmetronPowerCell AmmoCountPlayer.RemoveItem AmmoMesmetronPowerCell AmmoCount 1 ;Explosives set AmmoCount to Player.GetItemCount AmmoFatMansAmmoBoxMiniNukeREF.AddItem AmmoFatMans AmmoCountPlayer.RemoveItem AmmoFatMans AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoMissileAmmoBoxMissilesREF.AddItem AmmoMissile AmmoCountPlayer.RemoveItem AmmoMissile AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoMissileHighExplosiveAmmoBoxMissilesREF.AddItem AmmoMissileHighExplosive AmmoCountPlayer.RemoveItem AmmoMissileHighExplosive AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoMissileHighVelocityAmmoBoxMissilesREF.AddItem AmmoMissileHighVelocity AmmoCountPlayer.RemoveItem AmmoMissileHighVelocity AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo25mmGrenadeAmmoBox25mmGrenadeREF.AddItem Ammo25mmGrenade AmmoCountPlayer.RemoveItem Ammo25mmGrenade AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo25mmGrenadeHighExplosiveAmmoBox25mmGrenadeREF.AddItem Ammo25mmGrenadeHighExplosive AmmoCountPlayer.RemoveItem Ammo25mmGrenadeHighExplosive AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo40mmGrenadeAmmoBox40mmGrenadeREF.AddItem Ammo40mmGrenade AmmoCountPlayer.RemoveItem Ammo40mmGrenade AmmoCount 1 set AmmoCount to Player.GetItemCount Ammo40mmGrenadeIncendiaryAmmoBox40mmGrenadeREF.AddItem Ammo40mmGrenadeIncendiary AmmoCountPlayer.RemoveItem Ammo40mmGrenadeIncendiary AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoFlamerFuelAmmoBoxFlamerFuelREF.AddItem AmmoFlamerFuel AmmoCountPlayer.RemoveItem AmmoFlamerFuel AmmoCount 1 set AmmoCount to Player.GetItemCount AmmoFlamerFuelHomemadeAmmoBoxFlamerFuelREF.AddItem AmmoFlamerFuelHomemade AmmoCountPlayer.RemoveItem AmmoFlamerFuelHomemade AmmoCount 1 set AmmoCount to Player.GetItemCount WeapNVDynamiteAmmoBoxExplosivesREF.AddItem WeapNVDynamite AmmoCountPlayer.RemoveItem WeapNVDynamite AmmoCount 1 set AmmoCount to Player.GetItemCount WeapNVLongFuseDynamiteAmmoBoxExplosivesREF.AddItem WeapNVLongFuseDynamite AmmoCountPlayer.RemoveItem WeapNVLongFuseDynamite AmmoCount 1 set AmmoCount to Player.GetItemCount WeapNVTimeBombAmmoBoxExplosivesREF.AddItem WeapNVTimeBomb AmmoCountPlayer.RemoveItem WeapNVTimeBomb AmmoCount 1 set AmmoCount to Player.GetItemCount WeapGrenadeFragAmmoBoxExplosivesREF.AddItem WeapGrenadeFrag AmmoCountPlayer.RemoveItem WeapGrenadeFrag AmmoCount 1 set AmmoCount to Player.GetItemCount WeapGrenadePlasmaAmmoBoxExplosivesREF.AddItem WeapGrenadePlasma AmmoCountPlayer.RemoveItem WeapGrenadePlasma AmmoCount 1 set AmmoCount to Player.GetItemCount WeapGrenadePulseAmmoBoxExplosivesREF.AddItem WeapGrenadePulse AmmoCountPlayer.RemoveItem WeapGrenadePulse AmmoCount 1 set AmmoCount to Player.GetItemCount WeapNVGrenadeIncendiaryAmmoBoxExplosivesREF.AddItem WeapNVGrenadeIncendiary AmmoCountPlayer.RemoveItem WeapNVGrenadeIncendiary AmmoCount 1 set AmmoCount to Player.GetItemCount WeapNVGrenadeStunAmmoBoxExplosivesREF.AddItem WeapNVGrenadeStun AmmoCountPlayer.RemoveItem WeapNVGrenadeStun AmmoCount 1 set AmmoCount to Player.GetItemCount WeapMineFragAmmoBoxExplosivesREF.AddItem WeapMineFrag AmmoCountPlayer.RemoveItem WeapMineFrag AmmoCount 1 set AmmoCount to Player.GetItemCount WeapMinePlasmaAmmoBoxExplosivesREF.AddItem WeapMinePlasma AmmoCountPlayer.RemoveItem WeapMinePlasma AmmoCount 1 set AmmoCount to Player.GetItemCount WeapMinePulseAmmoBoxExplosivesREF.AddItem WeapMinePulse AmmoCountPlayer.RemoveItem WeapMinePulse AmmoCount 1 set AmmoCount to Player.GetItemCount WeapNVMinePowderChargeAmmoBoxExplosivesREF.AddItem WeapNVMinePowderCharge AmmoCountPlayer.RemoveItem WeapNVMinePowderCharge AmmoCount 1 set AmmoCount to Player.GetItemCount WeapMineBottlecapAmmoBoxExplosivesREF.AddItem WeapMineBottlecap AmmoCountPlayer.RemoveItem WeapMineBottlecap AmmoCount 1 set AmmoCount to Player.GetItemCount WeapNVC4PlasticExplosiveAmmoBoxExplosivesREF.AddItem WeapNVC4PlasticExplosive AmmoCountPlayer.RemoveItem WeapNVC4PlasticExplosive AmmoCount 1 ShowMessage VAmmoSorterDoneMsg End Link to comment Share on other sites More sharing options...
corsta Posted August 13, 2013 Author Share Posted August 13, 2013 Note - in the GECK, everything is fully and correctly indented. Just wouldn't paste that way... Link to comment Share on other sites More sharing options...
jazzisparis Posted August 13, 2013 Share Posted August 13, 2013 Make sure all the containers that are referenced in the script are set to Persistent Reference. Link to comment Share on other sites More sharing options...
luthienanarion Posted August 13, 2013 Share Posted August 13, 2013 This script could be greatly simplified by using RemoveAllTypedItems. Link to comment Share on other sites More sharing options...
corsta Posted August 15, 2013 Author Share Posted August 15, 2013 Thank you for the suggestions, but neither one fixed the issue. I still can't save the script... Link to comment Share on other sites More sharing options...
Kurzusseus Posted August 18, 2013 Share Posted August 18, 2013 The problem may be in the way the script has been written. I noticed that scripts need a specific amount of spacing before the script can save properly. That's all I can say, I'm still a novice at scripting. Link to comment Share on other sites More sharing options...
Kurzusseus Posted August 18, 2013 Share Posted August 18, 2013 The problem may be in the way the script has been written. I noticed that scripts need a specific amount of spacing before the script can save properly. That's all I can say, I'm still a novice at scripting. Link to comment Share on other sites More sharing options...
blove Posted August 18, 2013 Share Posted August 18, 2013 Either a REF or MSG does not exist or has a different EditorID. Link to comment Share on other sites More sharing options...
corsta Posted August 18, 2013 Author Share Posted August 18, 2013 Checked every single one - even the ammo names to be sure. Still won't save... Link to comment Share on other sites More sharing options...
blove Posted August 18, 2013 Share Posted August 18, 2013 Check them again. I remarked everyone of your REFs and your MSG and the script saved without issue. Link to comment Share on other sites More sharing options...
Recommended Posts