Jump to content
Sign in to follow this  
Ruskiesrule

Men who carry extra ammo

Recommended Posts

is it possible to add ammo to a person so that other units can get it from them, just like in WW2 when people would run around carring ammo for machine gunners and spare mags!

Share this post


Link to post
Share on other sites

This would be real good for if you want to make a mission involving alot of Kozlices or alot more combat than usualy in missions and you don't want to be trailing an ammo truck around that could easily be taken out by air or RPG!

Share this post


Link to post
Share on other sites

Actually thinking about it you could give a person ammo and have them drop it, but you could only tell them to do that if you were the leader.

Share this post


Link to post
Share on other sites

Indeed, that would be nice (like in Return to Castle Wolfenstein). One ques.:

Does command "this addmagazinecargo ["name", #]" work with soldiers? If it does then the problem is resolved...

Share this post


Link to post
Share on other sites

It can be done via rather simple scripting. You should have a repeated script which checks the distance between you and your ammo carrier. When you're close enough the script creates an option in action menu for you get more ammo (addMagazine) by clicking it. You can remove the ammo from the soldier via "removeMagazine" -command to make it feel realistic.

Share this post


Link to post
Share on other sites

i wonder if its possible if yo create a new unit, like just a normal soldier with an ammo belt round his neck!

I don't want to actualy take the ammo from him, cuz that just means he'll use up the ammo too!

I want him to have his own ammo, and some more in 'cargo' that he can dish out and somthing the AI leaders can tell people to go to!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Ruskiesrule @ Sep. 30 2002,19:18)</td></tr><tr><td id="QUOTE">I don't want to actualy take the ammo from him, cuz that just means he'll use up the ammo too!

I want him to have his own ammo, and some more in 'cargo' that he can dish out and somthing the AI leaders can tell people to go to!<span id='postcolor'>

You can simulate nearly anything by making a script.

It's possible to make an invisible weapon holder which can be easily scripted to follow a soldier. The only problem is that you can actually see the ammo floating around the soldier.

I'll try some scripting if I can come up with something. I'll post my findings here.

Share this post


Link to post
Share on other sites

Maybe looping setpos for an ammocrate underneath the soldier that U want to carry extra ammo. The shadow will probably look stupid but its an easy solution compared to other better solutions.

Share this post


Link to post
Share on other sites

OK got it working. The ammo bag casts no shadows so this script works well except in multistory buildings and vehicles where the bag can be seen below the soldier.

This is what you need to do. First you make a soldier called "ammoMan". Then you have to make 2 script files:

weaponholder.sqs

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

xpos = getpos ammoMan select 0

ypos = getpos ammoMan select 1

zpos = getpos ammoMan select 2

weapon = "WeaponHolder" createVehicle [xpos,ypos,zpos - 0.2]

weapon addMagazineCargo ["HandGrenade",10]

<span id='postcolor'>

trigfollow.sqs

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#update

weapon setPos [getpos ammoMan select 0, getpos ammoMan select 1, (getpos ammoMan select 2) - 0.2]

~1

goto "update"

<span id='postcolor'>

Then all you have to do is execute both scripts in the init field of ammoMan: [] exec "weaponholder.sqs"; [] exec "trigfollow.sqs"

Now you have a soldier-following ammo bag buried 20cm below the ground which you can use. The drawback is that you can't put any ammo back into the bag, you can only take from it.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Ruskiesrule @ Sep. 30 2002,20:08)</td></tr><tr><td id="QUOTE">thats no problem for me, i turned shadows off to speed up the game!<span id='postcolor'>

If the shadow isn't a problem then you can replace the "WeaponHolder" with "AmmoCrate" or whatever the correct name for the object is, you have to look it up yourself.

That way you can even put ammo/weapons into it in Resistance.

Share this post


Link to post
Share on other sites

With all that extra codeing would it not lag a multiplayer game thats already heavy in scripting and other stuff? Im refering to haveing a ammocrate or something like that following you arround constantly... :\

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (4C3 @ Sep. 30 2002,20:47)</td></tr><tr><td id="QUOTE">With all that extra codeing would it not lag a multiplayer game thats already heavy in scripting and other stuff? Im refering to haveing a ammocrate or something like that following you arround constantly... :\<span id='postcolor'>

Yes, every script causes more bandwidth usage in MP. However the script above is executed only once per second, and I think you can get along fine by executing it once per two or three seconds as well. It doesn't affect that much.

edit:

Actually, I get that back confused.gif. In MP the same script is always executed in every machine. It doesn't lag the net traffic but naturally it loads the CPU. However, nearly every mission has lots of scripts like this.

Share this post


Link to post
Share on other sites

now, i wonder if anybody is willing to make a Resistance soldier with an ammo belt round his neck!

This script should make them Machine gun support troops more usefull!

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  

×