OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: trooper543 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
-
//<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:
-
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
-
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:
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.
-
Would only work if I removed this line...
/*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?
-
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
-
@ 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
-
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.