Jump to content
Sign in to follow this  
cyop

Reload ONE round, instead of magazine ?

Recommended Posts

OK, I decided to do this (for the sake of fun)...

this addeventhandler ["fired", {(_this select 0) addMagazine "MAAWS_HEDP"}];

instead of going back to 'base' every few minutes to reload 2 cartridge's.

So, how can I make the 84 reload only ONE round, instead of a magazine?

EDIT: Thread title would be better suited as...

Reload just ONE round after firing launcher (MAAWS).

Edited by CyOp

Share this post


Link to post
Share on other sites

Not sure what you mean. AddMagazine should give you one rocket. You made an addon where MAAWS ammo are magazines with two projectiles? There are no commands to manipulate magazine contents (not yet anyway).

To be an effective MAAWS gunner, you need to team up with a buddy teammate (asst. AT gunner) who can carry your ammo, and pick out and prioritize targets while you reload out of his backpack. Or setup a defensive firing position where you put a number of backpacks. Should never be as magical and powerful as I believe you are trying to set it up.

And AT-4 is supposedly a play on 84. Try to use something else for the MAAWS, M3 or CG or whatever - anything except 84 (AT-4, which is M136) :p

Share this post


Link to post
Share on other sites
Not sure what you mean. AddMagazine should give you one rocket. You made an addon where MAAWS ammo are magazines with two projectiles? There are no commands to manipulate magazine contents (not yet anyway).

First, this is something I just did for a 'quick' SP mission I use when I have just a little time to jump in-game and play (as infantry on patrol). I usually let my AI AT handle armor, but, hey, sometimes I just have to jump in to keep from being annihilated.

Well, I cannot call it a bug (because it is a 'cheat'), but, yes, the line I use is suppose to give me a reload of one round after I fire. However, I was getting many, many rounds after firing. I tried to figure a way to alleviate that, but, no go.

To be an effective MAAWS gunner, you need to team up with a buddy teammate (asst. AT gunner) who can carry your ammo, and pick out and prioritize targets while you reload out of his backpack. Or setup a defensive firing position where you put a number of backpacks. Should never be as magical and powerful as I believe you are trying to set it up.

Again, this is just for a 'quick' SP mission. Also, thanks, but I have had plenty of gunnery training! :p - BTW, what's with the magical and powerful statement? This is just a game (and I did say, "fun")!

And AT-4 is supposedly a play on 84. Try to use something else for the MAAWS, M3 or CG or whatever - anything except 84 (AT-4, which is M136) :p

Huh? If you are saying what I think you are saying, you obviously are not as old as me (lucky you, heh). Are you referring to me saying, "84"? Do you know how long the 84, MAAWS, (whatever) has been around? Anyway, I guess where a person is from, and their experience, will have something to do with how they refer to the 'MAAWS'.

EDIT: BTW, '84' came to my mind because while I was testing, sometimes I would drop the weapon, and there would be a 127mm round, also. Funny, huh. -- Also, sorry, that last sentence in my OP was not very clear.

---------- Post added at 05:22 PM ---------- Previous post was at 04:54 PM ----------

OK, I think I know what is happening, sooo...

I need an addeventhandler for just the MAAWS wep, exclusively. How would that be 'written'?

Edited by CyOp

Share this post


Link to post
Share on other sites
Well, I cannot call it a bug (because it is a 'cheat'), but, yes, the line I use is suppose to give me a reload of one round after I fire. However, I was getting many, many rounds after firing. I tried to figure a way to alleviate that, but, no go.

player addEventHandler ["fired",{player addMagazine (_this select 5)}];

works for me, only one round added. You have to make it more advanced though so it only deals with those kinds of ammo. And it needs later beta versions to work, as _this select 5, magazine (and 6, projectile) isn't defined in the full version just yet.

Again, this is just for a 'quick' SP mission. Also, thanks, but I have had plenty of gunnery training! :p - BTW, what's with the magical and powerful statement? This is just a game (and I did say, "fun")!

Sorry, habit of mine. Probably a bad one. I tend to define fun = realism. And realism != endless ammo. Bring with you an AI to carry ammo, you can access his ruck.

Huh? If you are saying what I think you are saying, you obviously are not as old as me (lucky you, heh). Are you referring to me saying, "84"? Do you know how long the 84, MAAWS, (whatever) has been around? Anyway, I guess where a person is from, and their experience, will have something to do with how they refer to the 'MAAWS'.

I'm old enough. Not as old as the M3/CG though ;) To the modern player, I expect AT-4 to have a single meaning. Few says M136/136, and I'm also basing it on this. But alas, it was only meant as a side note :)

Edit: Quick revised version. Put this in your init line:

player addEventHandler ["fired",{_ply = _this select 0; _rnd=_this select 4; _mag=_this select 5; if (_rnd in ["R_MEEWS_HEAT","R_MEEWS_HEDP"]) then {_ply addMagazine _mag}}];

You don't want to create them on the ground, as they have no model (BIS, we could really use that! Filling up a vehicle that is already full, which we don't know about, and the MAAWS rounds are lost). You were getting many magazines because you got one each time you fired your rifle ;)

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites
Sorry, habit of mine. Probably a bad one. I tend to define fun = realism. And realism != endless ammo.

/me Shakes head kicks dirt onto the fire and sprints off into the darkness again.

Share this post


Link to post
Share on other sites

Carl, the whole realism thing is pretty much how I play. However, when I have maybe 15 minutes to play, fun for me is not having to reload the mission 'cus we got wiped out at the start by a group of T-72's. Thus, the quickie cheat mission. (I only play as infantry with a smaller than 'normal' rifle squad.)

Anywho, my ammo mess came about because I was actually trying to use TWO event handler lines. That's why I was getting the extra rounds, like the 127mm. I did not want to carry a launcher at all. So, I would carry a HEAT in the 12 slot area, and a STINGER or 47 round in a pack. When I could/would retrieve a launcher from a downed squad member, I wanted at least TWO rounds. Thus, the cheat lines/s. Which brings me back to, egads, the '84'.

While testing, I dropped my launcher and saw a 127mm round with an 84mm round. When posting, that was stuck in my head. You get it now. :) That's the main reason I said 84(mm). (Before I figured out what was happening, I'm like, WTHell, an 84(mm) AND a 127(mm) round, but I have the MAAWS!)

The above is why I asked for a weapon specific code line.

EDIT: Oh, and thank you! :) I will try that out.

Edited by CyOp

Share this post


Link to post
Share on other sites

It did not work. Well, no prob. I will just go back to carrying one less grenade and one less mag. (Although, that was not working out so good.)

Unless, you want to try a rewrite. Did that code work for you?

This is what I tried:

{this addMagazine "MAAWS_HEDP"} forEach [1];
{this addMagazine "HandGrenade_West"} forEach [1,2];
{this addMagazine "20Rnd_762x51_B_SCAR"} forEach [1,2,3,4,5,6,7,8];
{this addMagazine "15Rnd_9x19_M9"} forEach [1,2,3,4];

this addEventHandler ["fired", {_ply = _this select 0; _rnd=_this select 4; _mag=_this select 5; if (_rnd in ["R_MEEWS_HEAT","R_MEEWS_HEDP"]) then {_ply addMagazine _mag}}];

this addWeapon "SCAR_H_CQC_CCO";
this addWeapon "M9";

this addWeapon "NVGoggles";
this addWeapon "Binocular";

I tried 'player', too.

EDIT: Ooops! What is the time limit on new posts?

EDIT LATE: I did not notice I left out the... removeAllWeapons this; ...when I pasted. But, yes, I was using that.

Edited by CyOp

Share this post


Link to post
Share on other sites

Don't want to try the code right now, but as it is a script, call it with:

player execVM "yourscript.sqf"

and then replace all "this" with "_this" (without the quotes) in the script.

A script doesn't know what "this" is, only "_this".

Not sure why "player" didn't work, I think it should. You should do a "removeAllWeapons _this" too btw.

Share this post


Link to post
Share on other sites

This code, from pogoman, is for the M136 but you could probably just change the class names around for the MAWWS.

Function to refill ammo:

oneShotM136 = { 
if (currentWeapon player == "M136" && !("M136" in magazines player)) then { 
	player removeWeapon "M136"; 
	player addMagazine "M136"; 
	player addWeapon "M136"; 
	player selectWeapon "M136"; 
}; 
if (currentWeapon player != "M136" && "M136" in magazines player) then { player removeMagazine "M136"; }; 
}; 

Loop to avoid having to hold ammo:

while { true } do { 
call oneShotM136; 
sleep 0.1; 
};

Include this to make it "one shot":

EH to remove weapon:

player addEventHandler ["fired",{ 
if ((_this select 1) == "M136") then { [] spawn { sleep 0.5; player removeWeapon "M136"; }; }; 
}];

Share this post


Link to post
Share on other sites

Nevermind... testing more.

Carl, nope, can't get it to work, trying dif methods. ... by script, loading just the line... starting with and without the MAAWS... loading the whole loadout in sqf... using player or this, or _player or _this.

kylania, I will try and get that to work, and give me one extra round.

Edited by CyOp

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×