Technical > Editing & Coding

Add specific item in lootcrate (refillbox)

(1/2) > >>

Blackcircle:
Hello,

I try to add specific object in crate for a mission, but impossible to make this object spawning in box:

 case "mission_boxSunken":
   {
      _boxItems =
      [
         // Item type, Item class(es), # of items, # of magazines per weapon
         ["itm", "NVGoggles", 5],
                        ["itm", "Land_File_research_F", 5],
         ["wep", ["rhs_weap_makarov_pmm", "rhsusf_weap_glock17g4"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(3,5)],
         ["mag", "rhs_30Rnd_545x39_AK", RANDOM_BETWEEN(4,8)],
         ["mag", "rhsusf_mag_15Rnd_9x19_FMJ", RANDOM_BETWEEN(4,8)],
         ["mag", "rhs_mag_30Rnd_556x45_Mk318_Stanag", RANDOM_BETWEEN(4,8)]
      ];

This line:

["itm", "Land_File_research_F", 5],

Don't work

Any idea?

All others items/weapon/mag works

GriffinZS:
I have few missions with special, not available equipment, inside. Maybe this helps ..


--- Code: ---_box1 addItemCargoGlobal ["launch_O_Vorona_brown_F",2];
--- End code ---

h4wk:
you can only add inventory items to a crate.

you are trying to add a object, you have to make the object to a virtual item and add it as a virtual item. (drugs, spawn beacon, etc are virtual items)


--- Code: ---
private _itemsInBox = [];

{
for "_i" from 0 to (round random (_x select 1)) do {
_itemsInBox pushBack (_x select 0);
};
} forEach [
["repairkit",2],
["ammokit",1],
["jerrycanfull",2],
["spawnbeacon",1],
["camonet",2],
["syphonhose",2]
];

_box1 setVariable ["virtualItems",[_itemsInBox,count _itemsInBox],true];


--- End code ---

GriffinZS:
I don't know exactly how it works, but .. with this at the end of the sqf, the tablet for an airstrike is available randomly  on mousewheel at the specific crate:


--- Code: ---if (["A3W_artilleryStrike"] call isConfigOn) then
{
if (random 1.0 < ["A3W_artilleryCrateOdds", 1/10] call getPublicVar) then
{
_box setVariable ["artillery", 1, true];
};
};
--- End code ---

Blackcircle:
ok thanks guys!! I will try both solutions ;)

Navigation

[0] Message Index

[#] Next page

Go to full version