Home   Help Search Login Register  

Author Topic: MP Logistics Question - Regarding Ammo Boxes  (Read 2253 times)

0 Members and 1 Guest are viewing this topic.

Offline trooper543

  • Members
  • *
MP Logistics Question - Regarding Ammo Boxes
« on: 13 Feb 2009, 22:59:27 »
Hi there all

Did a search of the forums and came up a bit empty handed however a little wiser as well (Many thanks)

Anyway on too the question.... What i would very much like assistance with or maybe somone has done this already

We we want to do in MP Clan is be able to set the amount of ammo in each box (which is simple enough) however what we are after is an additional script that will allow us to replenish the ammo box once it has depleted its contents.

The idea is then to call in the chopper / Truck and have the ammo boxe returned to a place where it gets refilled.

Is there anyone out there that will be able to assist ?

Many thanks in advaance



Offline Rommel92

  • Members
  • *
Re: MP Logistics Question - Regarding Ammo Boxes
« Reply #1 on: 14 Feb 2009, 04:44:06 »
Code: [Select]
//<box_name> spawn compile preprocessfile "this_script.sqf"

while {alive _this} do {
private"_t";
_t = time + 600; //10 minutes
waitUntil {sleep 0.6667; time > _t};

clearWeaponscargo _this;
clearMagazinescargo _this;

_this spawn compile preprocessfile <your ammo box script filler>};
hope that makes sense.  :good:

Offline trooper543

  • Members
  • *
Re: MP Logistics Question - Regarding Ammo Boxes
« Reply #2 on: 14 Feb 2009, 15:26:45 »
Rommel again Sir

Your are Master , a Scholar and a Gent

Many thanks for this mate, most appreciated

Sorry but can you provide this idiot with a guide to set it up

Many thanks in advance


Offline Rommel92

  • Members
  • *
Re: MP Logistics Question - Regarding Ammo Boxes
« Reply #3 on: 14 Feb 2009, 22:53:59 »
Haha no point mate, your no idiot. I've just played this too long.
Heres a mockup example mission that I created in notepad, so forgive me if the mission doesn't work, but I'm guessing the script layouts will.  :D

If the mission doesn't work, just note that the box in question executes from the init line like so:
Code: [Select]
nul = this spawn compile preprocessfile "ammobox_1.sqf"
You may also want to add in your ammo_box script to it, I have provided one for you.

Offline Sparticus76

  • Members
  • *
Re: MP Logistics Question - Regarding Ammo Boxes
« Reply #4 on: 15 Feb 2009, 01:15:56 »
Would only work if I removed this line...

Code: [Select]
/*author(s): rommel
15-02-2009 */

waitUntil {time > 1.5};

if(isnull player)exitwith{}; //note will not work in SP with this un-commented

_type = typeOf _this;
_pos = position _this;
_dir = direction _this;

sleep 600;
hint "new box created";

if (!isNull _this) then {deleteVehicle _this};

while {true} do {
private"_box";
_box = _type createVehicleLocal _pos;
_box setDir _dir;
             _box setpos _this; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< removed this.
_box spawn compile preprocessFile "ammobox_1a.sqf";
sleep 600;
if (!isNull _box) then {deleteVehicle _box};
};

Also, is there a way to load, or simulate loading a crate onto the truck, and then unloading it at a destination with exactly what it had in it when you loaded it?

Offline Rommel92

  • Members
  • *
Re: MP Logistics Question - Regarding Ammo Boxes
« Reply #5 on: 15 Feb 2009, 01:18:51 »
Sorry for that error! It was a copy paste from some of my scripts, and I forgot to remove/alter that.  ;)
Yes, its easily possible via alternating it via two positions, but I can't write it up at the moment.

But the mission worked? Huzzah.  :P

Offline trooper543

  • Members
  • *
Re: MP Logistics Question - Regarding Ammo Boxes
« Reply #6 on: 15 Feb 2009, 01:22:03 »
@ Rommel

Many thanks for the example mission most appreciated and again i cannot thank you enough.

Would you mind if i asked you to maybe develop this with a few twists and turns?

Please let me know if you are intrested in the concept and i can let you know.


Many thanks in advance

Cheers

Offline Rommel92

  • Members
  • *
Re: MP Logistics Question - Regarding Ammo Boxes
« Reply #7 on: 15 Feb 2009, 02:18:10 »
Yeah mate I'm happy to help, but I've just realised I got to fix that error for Ace King, so If you post up any problems/questions for this now, I'll get back to you.