felixk4 Posted March 13, 2017 Share Posted March 13, 2017 Is there any way of getting an actors loaded ammo count and modifying it? Link to comment Share on other sites More sharing options...
DoctorKaizeld Posted March 13, 2017 Share Posted March 13, 2017 What do you mean? Link to comment Share on other sites More sharing options...
shavkacagarikia Posted March 13, 2017 Share Posted March 13, 2017 There is only the condition function GetLoadedAmmoCount(). You cannot do much to weapons with papyrus. Link to comment Share on other sites More sharing options...
felixk4 Posted March 13, 2017 Author Share Posted March 13, 2017 What do you mean? I'm trying to set the players current loaded magazine size to 0. Link to comment Share on other sites More sharing options...
montky Posted March 13, 2017 Share Posted March 13, 2017 @felixk4howdy, thanks for asking an awesome questiona little more info for your hypothetical, and what you're envisaging,will help folks to find a way to get to what you're envisaging.Why are you trying to override the magazine size to 0? You might find looking at the Junk Jet, Any Mod Any Fail (if you can still find it)and several weapon overhaul or standalones, very insightful for how they make a magazine 0.a lot of cool stuff is achieved via using containers and arrays. is there a particular reason you are overriding the get.that.loadedammocount to 0?are you making that say, a situational node in an environment?ie, around a node, no-one can use Electrical weapons, because of 'interference' from an environmental effect?you'd want to do it from a node ref otherwise you could have a floating conditional flying around, reducing the player's ammo to 0 hehe.you can merely not allow user inputs to fire for electrical type weapons around that node, and then use HUDui to display the ammo counter on HUD as 0,but the inventory as full.This will indicate to the player that, a dampening field or environmental effect is interfering with their energy shield or electrical weapons. or, are you making a charging-handle for use with the Power Backpack system,so that you can infini-crank whilst you're going to a fetchquest or something, and switch to it?sneaky. are you trying to apply the weapon-mod slot perk/legendary modifier "unending magazine" to your weapon,like Wazer Wifle or the Prototype Lazer? but, without that taking up an extra slot? are you trying to make an 'unreliable' energy weapon that randomly chews through power-cores or energy cells?perhaps, a power-armor suit that has variable and inefficient power consumption? are you making a revolver or single-shot weapon (which would have a magazine of 1)?you can also override that instance to not read from a pipboy player inventory array...perhaps, you are making a china-lake or junkjet like weapon, and you want to force the player to a menu or something? I recommend using the node approach, if you wanted to confiscate the player's ammo while transiting a region.I use a similar approach for the Red Rocket Settlements mod,learning from Caesars Legion in FONV, when you enter the settlement boundary, an NPC approaches and asks you to check your weapon or leave etc.then, when you leave the node,you get your weapons and ammo and all back.Settlements are 'gun-free zones' inside city limits (think The New Vegas strip, and how many weapons you could bring in with stealth hehe), until the end-game when you're mayor of everywhere hehe. I hope I have given some ideas in the meantime, and there was something of use there,and I look forward to what mods you might have in mind and what you can do withthe GetLoadedAmmoCount variable. Link to comment Share on other sites More sharing options...
felixk4 Posted March 13, 2017 Author Share Posted March 13, 2017 (edited) @felixk4howdy, thanks for asking an awesome questiona little more info for your hypothetical, and what you're envisaging,will help folks to find a way to get to what you're envisaging.Why are you trying to override the magazine size to 0? You might find looking at the Junk Jet, Any Mod Any Fail (if you can still find it)and several weapon overhaul or standalones, very insightful for how they make a magazine 0.a lot of cool stuff is achieved via using containers and arrays. is there a particular reason you are overriding the get.that.loadedammocount to 0?are you making that say, a situational node in an environment?ie, around a node, no-one can use Electrical weapons, because of 'interference' from an environmental effect?you'd want to do it from a node ref otherwise you could have a floating conditional flying around, reducing the player's ammo to 0 hehe.you can merely not allow user inputs to fire for electrical type weapons around that node, and then use HUDui to display the ammo counter on HUD as 0,but the inventory as full.This will indicate to the player that, a dampening field or environmental effect is interfering with their energy shield or electrical weapons. or, are you making a charging-handle for use with the Power Backpack system,so that you can infini-crank whilst you're going to a fetchquest or something, and switch to it?sneaky. are you trying to apply the weapon-mod slot perk/legendary modifier "unending magazine" to your weapon,like Wazer Wifle or the Prototype Lazer? but, without that taking up an extra slot? are you trying to make an 'unreliable' energy weapon that randomly chews through power-cores or energy cells?perhaps, a power-armor suit that has variable and inefficient power consumption? are you making a revolver or single-shot weapon (which would have a magazine of 1)?you can also override that instance to not read from a pipboy player inventory array...perhaps, you are making a china-lake or junkjet like weapon, and you want to force the player to a menu or something? I recommend using the node approach, if you wanted to confiscate the player's ammo while transiting a region.I use a similar approach for the Red Rocket Settlements mod,learning from Caesars Legion in FONV, when you enter the settlement boundary, an NPC approaches and asks you to check your weapon or leave etc.then, when you leave the node,you get your weapons and ammo and all back.Settlements are 'gun-free zones' inside city limits (think The New Vegas strip, and how many weapons you could bring in with stealth hehe), until the end-game when you're mayor of everywhere hehe. I hope I have given some ideas in the meantime, and there was something of use there,and I look forward to what mods you might have in mind and what you can do withthe GetLoadedAmmoCount variable. I'm basically trying to cause a reverse reload to simulate a weapon jam through a magic effect, which would force the player to reload their weapon to clear the 'jam'. This is the script code I have so far which does nothing. Scriptname FelixWeaponJam:FelixWeaponJamTest extends activemagiceffect Keyword Property MyKeyword Auto Const Ammo Property akAmmo Auto Const Event OnEffectStart(Actor akTarget, Actor akCaster) akAmmo set to akCaster.GetWeaponAmmo() If actorCurrentWeapon.HasKeyword(MyKeyword) akCaster.UnequipItem(akAmmo, False, True) EndIf EndEvent Edited March 13, 2017 by felixk4 Link to comment Share on other sites More sharing options...
ablindm4n Posted March 14, 2017 Share Posted March 14, 2017 There's a few of us holding out for this functionality in F4SE, but it seems like it'll be a while before we have it. Link to comment Share on other sites More sharing options...
montky Posted March 14, 2017 Share Posted March 14, 2017 @felixk4AHA! now that makes a lot more sense...(one of my 20 odd guesses wasn't too far from the mark hehe)cool! the present block might not work as it is an undefined conditional global akCaster.right, so you might find "Any Mod Any Fail" and "weapons maintenance overhaul"ammunition accurizing mod etc. projects to be very interesting in how they achieve it. Basically, they set the mod attachment to a weapon as damaged,and assign durability to each mod attachment of an overall weapon.when it is broken, different effects happen, and these can be dealt with or fixed at a weapons work bench.you have to repair the weapon components with parts that increase in time and difficulty the more busted your weapon is.the Vendors node global is also updated... so, you can't just go buy a new weapon so easily... hehe.so, it'll pop up with the pipboy and a prompt saying "oh noes, looks like your weapon is busted, visit a workbench or time to procure a new firearm" I think Any Mod Any Fail is basically a fractal update counter and an .xml or papyrus "Table of Fail" hehe.when you fire, a counter is updated. several, really.the weapon-instance counter, and the "table of fail" counter... similar to how critical hits function in FO4. -----will you be making the 'jam' (jam/seized action is old school nomenclature, hehe malfunction: failure to feed. Malfunction: stovepipe etc) effect dependent on -the weapon condition (Barrel, Muzzle, Fire Control Group),the quality of the ammunition?operation of the weapon (improper use of a belt-fed chaingun in semi-auto mod instead of full auto etc)"break-in period" "peak useful lifetime" "near to breaking/old life" etc? if so, that will be 2 floatingpoint variables and a fractal/random chance function... how frequently do you want jams to occur? consider your probability distribution per half hour or per hour of gameplay,and frame it around that. pseudo-random approaches will ensure at minimum a few per hour block,but you wouldn't want it to be some 'everything jams all the time" -that'd be like a ghost-perk "Unlucky with Technology - everything fails around you, and you don't know why"or "whacky wasteland" Pipe weapons jam around 8 or more times per hour of gameplay, assuming normal use and ammunition.whereas 5.56 etc jam around 3 or 4 times per hour of gameplay.Lazers and Plasmas can jam/'fail' at whatever rate you'd like, but for Wattz, say 12 times per hour,and for institute stuff around 4 times per hour. Pipe Gatlings and antique weapons jam a lot more. they might jam/malfunction 30 or more times per hour. Will malfunctions eat the ammunition?will malfunctions for the china lake, rocket launcher or plasma weapons or the junk jet be lethal to the operator? hehe Link to comment Share on other sites More sharing options...
TrickyVein Posted March 14, 2017 Share Posted March 14, 2017 How I've managed to track ammo count is to basically create a virtual ammo counter, starting with the known clip size of the equipped weapon and subtracting 1 for every shot fired. You have to keep track of reloading and resetting it back to whatever number it is, but I think it works pretty well. Link to comment Share on other sites More sharing options...
Recommended Posts