Home   Help Search Login Register  

Author Topic: Adding ammo to cargo area of boats  (Read 3185 times)

0 Members and 1 Guest are viewing this topic.

Offline zonker3210

  • Members
  • *
Adding ammo to cargo area of boats
« 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....

Code: [Select]
_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

Offline punisher

  • Members
  • *
Re: Adding ammo to cargo area of boats
« Reply #1 on: 16 Jul 2011, 14:55:42 »
try just doing it in the units init: this addmagazinecargo ["stanag",10]
The Gimp clan- pushing the limits of OFP
http://www.youtube.com/user/Pigdogmeat

Offline zonker3210

  • Members
  • *
Re: Adding ammo to cargo area of boats
« Reply #2 on: 16 Jul 2011, 23:07:27 »
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.

Offline Pirin

  • Members
  • *
Re: Adding ammo to cargo area of boats
« Reply #3 on: 17 Jul 2011, 00:32:44 »
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.

Offline zonker3210

  • Members
  • *
Re: Adding ammo to cargo area of boats
« Reply #4 on: 17 Jul 2011, 01:16:39 »
Okay, thanks for the info!

Offline F2kSel

  • Members
  • *
Re: Adding ammo to cargo area of boats
« Reply #5 on: 17 Jul 2011, 01:23:45 »
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
Code: [Select]
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

Code: [Select]
_Player = _this select 1;
ammobox setpos position _player;
_Player action ["Gear", ammobox];



Offline zonker3210

  • Members
  • *
Re: Adding ammo to cargo area of boats
« Reply #6 on: 19 Jul 2011, 06:47:09 »
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!

Offline F2kSel

  • Members
  • *
Re: Adding ammo to cargo area of boats
« Reply #7 on: 19 Jul 2011, 11:28:11 »
You can extend the the range which may make it easier to see by changing this bit.

from
Code: [Select]
(_this distance (_target))<2
to
Code: [Select]
(_this distance (_target))<4


« Last Edit: 19 Jul 2011, 11:32:48 by F2kSel »