OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: zonker3210 on 16 Jul 2011, 13:54:38
-
In my "init.sqf" file, the following code does not add magazines for either the RHIB and CRRC (Zodiac) vehicles....
_boat addMagazineCargo ["30Rnd_556x45_Stanag", 10];
Am I doing something wrong or do these vehicles simply have no cargo capacity? The following post on the BI forums suggests attaching an ammo crate to the boat so I guess that's an option...
http://forums.bistudio.com/showthread.php?t=84937#post1466511
Anyhow, I'd appreciate any suggestions for handling this. Thanks!
- z
-
try just doing it in the units init: this addmagazinecargo ["stanag",10]
-
I tried that...although the name you used in your example "stanag" isn't what I tried. Is that some sort of super-class name that is needed or was that just a placeholder for your example? In any event, using the actual magazine class names, the INIT field approach works for cars, trucks and other vehicles but not for boats such as RHIB's and CRRC's.
-
I don't know when it changed, but currently vanilla CRRC's cannot hold any weapon or magazine cargo. I know this wasn't always the case since I have a mission where you start out in one and use Gear to equip what you need.
The ACE2 mod includes CRRC's (and other boats) which can carry ammo and weapons.
-
Okay, thanks for the info!
-
You can add a fake ammobox to any object.
Just place an ammobox on the map and name it ammobox and in the init put this hideobject true
In the boats init put this
this addaction ["CRRC-Gear","ammobox.sqf",[], 6, true, true, "", "(_this distance (_target))<2 and !(player in _target)"];
and for the code it's just this
_Player = _this select 1;
ammobox setpos position _player;
_Player action ["Gear", ammobox];
-
Thanks, F2kSel...that's a really nice solution. The "CRRC-Gear" action doesn't always appear unless the player is positioned just right but in many ways it's much nicer than using the "attachTo" function. I'd been using the latter but it causes the CRRC to bounce a lot when using single-player mode's 2x and 4x Fast Time modes. When using a hidden ammobox, I don't run into that problem.
Thanks again!
-
You can extend the the range which may make it easier to see by changing this bit.
from
(_this distance (_target))<2
to
(_this distance (_target))<4