OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Canukausiuka on 18 Oct 2005, 05:43:31
-
I'm having trouble with a script I'm trying to get working. It is supposed to give an empty vehicle all the weapons and ammunition that a soldier has, so that when the soldier gets in, he can still fire his weapons (as opposed to a pre-existing weapon). However, so far all I can come up with is reading the magazines the guy holds (magazines _unit), and then using addMagazine to give the vehicles the right amount. But if the guy has fired some, he gets a full magazine back!
I know that there is an "action" command for dropping and taking magazines. Does anyone have any more information about that command and how to use it?
-
Try here (http://www.ofpec.com/editors/resource_view.php?id=862) for a list of working action commands.
Planck
-
I have a horrible feeling there is not much you can do about part-used mags.
-
Well, I know you can force a unit to drop a magazine, using an action. What I want is to force them to drop their magazines, then force something else to pick them up. Seems to me that if that works, we should be able to transfer all the ammunition intact. The trick is, how exactly to do it. Of course, it may not be possible (which would explain why I'm having trouble with it) ::)
-
bedges was having the same problem IIRC, and it was decieded there really wasn't any solution...
-
Seems to me that if that works, we should be able to transfer all the ammunition intact.
Yes that's the problem: transferring a magazine is no problem, but the information as to how many rounds have been fired is lost. When its picked up its always full. At least that is my suspicion.
-
Force a unit to drop weapons into vehicles:
{unit action ["DROP WEAPON",vehicle,0,0,_X]} foreach (weapons unit)
{unit action ["DROP MAGAZINE",vehicle,0,0,_X]} foreach (magazines unit)
It will work at any distance from the vehicle, but it will also cause the unit to play the "Put" animation.