Add specific item in lootcrate (refillbox)

Add specific item in lootcrate (refillbox)

« posted: Apr 04, 2022, 08:58 PM »
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

Re: Add specific item in lootcrate (refillbox)

« Reply #1 posted: Apr 04, 2022, 09:26 PM »
I have few missions with special, not available equipment, inside. Maybe this helps ..

Code: [Select]
_box1 addItemCargoGlobal ["launch_O_Vorona_brown_F",2];
  • Offline h4wk
  • Geared Up
  • **
  • Posts: 22

Re: Add specific item in lootcrate (refillbox)

« Reply #2 posted: Apr 05, 2022, 04:26 AM »
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: [Select]

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];

Re: Add specific item in lootcrate (refillbox)

« Reply #3 posted: Apr 05, 2022, 07:54 AM »
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: [Select]
if (["A3W_artilleryStrike"] call isConfigOn) then
{
if (random 1.0 < ["A3W_artilleryCrateOdds", 1/10] call getPublicVar) then
{
_box setVariable ["artillery", 1, true];
};
};

Re: Add specific item in lootcrate (refillbox)

« Reply #4 posted: Apr 05, 2022, 11:02 AM »
ok thanks guys!! I will try both solutions ;)
  • Offline LeonZ
  • github.com/LeonZ2019/Lucky-s-Wasteland-Server
  • Geared Up
  • **
  • Posts: 35

Re: Add specific item in lootcrate (refillbox)

« Reply #5 posted: Apr 05, 2022, 08:34 PM »
You are adding an editor object instead of item object, try without land or just start with item_ something

Re: Add specific item in lootcrate (refillbox)

« Reply #6 posted: Apr 07, 2022, 02:01 PM »
OK , I think i could use "repair kit", we don't use it on server and the idea is to add "secret files" in loot on mission to let players sell it at general store.

A briefcase could be fine, but I search on mission file where to create or edit "repair kit" . The idea is to use it for mission but without the repair function and with other name, "top secret briefcase".

If you have an idea of witch files need to be edited, or if I can create a new objet with this name and "Land_SuitCase_F" object or something else.

Thank you ;)
  • Offline LeonZ
  • github.com/LeonZ2019/Lucky-s-Wasteland-Server
  • Geared Up
  • **
  • Posts: 35

Re: Add specific item in lootcrate (refillbox)

« Reply #7 posted: Apr 07, 2022, 09:51 PM »
Here is the explain about the class name, editor class name is meant to using it on editor, so you cant just copy and paste, you gotta find what is the actual class name in item or container, so here is what i found for File (Top Secret) is FileTopSecret, which you gonna replace from this
Code: [Select]
["itm", "Land_File_research_F", 5],to this
Code: [Select]
["itm", "FileTopSecret", 5],

Re: Add specific item in lootcrate (refillbox)

« Reply #8 posted: Apr 08, 2022, 06:04 PM »
It works!!

But now selling don't work correctly :(

Quote
genItemArray = compileFinal str
[
   //["Quadrotor UAV (NATO)", "B_UAV_01_backpack_F", 4000, "backpack"],
   //["UAV Terminal (NATO)", "B_UavTerminal", 700, "gps"],
   ["Files Top Secret", "FileTopSecret", 30000, "item"],
   ["Showel (for trenches)", "ACE_EntrenchingTool", 100, "item"],   
   ["Diving Goggles", "G_Diving", 200, "gogg"],
   ["Compass/Boussole", "ItemCompass", 20, "item"],
   ["Map", "ItemMap", 20, "item"],   
   ["GPS", "ItemGPS", 200, "item"],   
   ["First Aid Kit", "FirstAidKit", 100, "item"],
   ["Medikit", "Medikit", 2000, "item"],
   ["Toolkit", "ToolKit", 1050, "item"],
   ["Mine Detector", "MineDetector", 100, "item"],
   ["AN/PVS-14", "rhsusf_ANPVS_14", 400, "nvg"],
   ["AN/PVS-15", "rhsusf_ANPVS_15", 600, "nvg"],
   ["Rhino mount", "rhsusf_Rhino", 50, "nvg"],   
   ["Binoculars", "Binocular", 50, "binoc"],
   ["M151 Spotting Scope", "Leupold_Mk4", 50, "binoc"],
   ["Laser designator", "Laserdesignator", 1500, "binoc"],
   ["Vector 21-B", "rhsusf_bino_lrf_Vector21", 250, "binoc"],   
   ["Lerca 1200 black", "lerca_1200_black", 250, "binoc"],
   ["Lerca 1200 Tan", "lerca_1200_tan", 250, "binoc"]
];

Normally the item could be sell at half price so 15 000$  I don't understand why it doesn't work