cj525 5 Posted March 14, 2006 Okay before I go into my problem my first question is, other than removing the mags is there away I can stop the gun from firing? okay I've got a gun jam script that when activated, it removes the mags runs a unjam animation then you have to reload the weapon. Now what I'm trying to do is modifly the script buy counting the rounds and if the jam activates, I want this to happen -Run unjam anim "SPORTS" -then auto reload the weapon with a mag minus the amount of bullets already used. Now in the weapon config.cpp you setup the mag capacity with the "count = ##;" line is there anyway I can config a mag ingame with a different count? now to autoload I'm thinking of removing the weapon and mags and adding the mags (one modified with remaining bullets) then adding the weapon to have the weapon appear with a mag loaded ....same as in the unit Init line. I hope this is clear Share this post Link to post Share on other sites
chris330 0 Posted March 14, 2006 It is to me very clear, but off the top of my head I don't think it is possible. It would mean redefining something that I think the game will not want to call again once it has been loaded (i.e. the magazine bullet count). I think you'd be better off just settling for dispensing with that magazine and loading a new one in. Although I accept if it's something you have your heart set on you will want to find a more realistic solution Share this post Link to post Share on other sites
General Barron 0 Posted March 14, 2006 Hmm... I had been working on a weapon jamming system with another person a while ago, but ended up never finishing it. Anyway, my first idea was to do basically what you are doing--that is, when a jam occurs, I just remove the magazine and add another one back in. No animations mind you--I didn't want to FORCE the player to stop and clear his weapon; I'd rather he choose when to clear it, represented by him reloading. You could get around the ammo problem by configuring, for example, 29 different mags for an M16--one for each number of rounds in the chamber. Before you remove the mag, you use the 'ammo' command to find out how many bullets he had in his mag. Then you just reequip him with the appropriate magazine. -------------- Now, I don't remember the specifics, but I think this method runs into serious problems when you try to apply it to weapons that can use a variety of different magazines. Take JAM3-compatible weapons for example--they come in two variant mags for each weapon. Again, I don't remember the specifics, but I think it had to do with problems with the 'ammo' command. So anyway, Kammak, who I was working with, ended up using a different approach, which I don't remember exactly. I think he ended up configuring a second weapon, which could not fire. When your weapon jams, it is replaced with this (non-functioning) weapon, which would say something like "M16--JAMMED" in the little ammo count on the HUD. Once you hit an action, everything is switched back (plus anims of course). You would prolly have to reload at this point as well, but since no mags were ever removed, you should have the same ammo count. IIRC, it worked pretty well, but we never got around to making a final version, or getting any addonmakers to actually incorporate the system into their addons (that is, by configuring jammed weapons). I hope that helped. Share this post Link to post Share on other sites
cj525 5 Posted March 15, 2006 we are on the same page Barron, I made a dud weapon which I switch out when the jam occurs I make available the option to clear the jam and run a random script to see if it will clear. thanks for the advise Share this post Link to post Share on other sites