Jump to content

kibaBG

Member
  • Content Count

    312
  • Joined

  • Last visited

  • Medals

Everything posted by kibaBG

  1. Unfortunately it doesn't spawn anything on my side. Maybe I am not executing it as it should? I simply use this line in initServer: [] execVM "smuggler.sqf";
  2. Hi guys, I am trying to do a script, which allow me to spawn a "fuel smuggler" (trader) who buys fuel crates only and gives the player 500 cash for every fuel barrel he buys. After 10 min he will disappear only to show 20 minutes later on another place. Monetary system is Grad Money Menu. while {true} do { sleep 1200; _pos1 = [1323.44,7742.14,0]; _pos2 = [11845.7,7733.76,0]; _pos3 = [2177.42,10840.1,0]; _pos4 = [2936.97,3438.3,0]; _rpos = [_pos1,_pos2,_pos3,_pos4] call BIS_fnc_selectRandom; _smugveh = "C_Truck_02_fuel_F" createVehicle _rpos; _smugveh setFuel 0; _spos = [_rpos, 3, 15, 3, 0, 0.5, 0] call BIS_fnc_findSafePos; private _grp = createGroup [civilian,true]; _smuggler = _grp createUnit ["CUP_C_TK_Man_02",_spos]; _smuggler enableAI "PATH"; _smugtrig = createTrigger ["EmptyDetector",_spos]; _smugtrig setTriggerArea [5,5,0,false]; _smugtrig setTriggerActivation ["STATIC","PRESENT",true]; _smugtrig setTriggerStatements ["{_x isKindOf "CargoNet_01_barrels_F"} count thisList == 1", "_delete = nearestObjects [_smuggler, ["CargoNet_01_barrels_F"],50]; {deleteVehicle _x;} forEach _delete; [player, 500] call grad_moneymenu_fnc_addFunds;",""]; _marker = createMarker ["Smuggler present!", _rpos]; _marker setMarkerType "loc_LetterS"; _marker setMarkerColor "colorCivilian"; sleep 600; deleteMarker "Smuggler present!" deleteVehicle _smugtrig; deleteVehicle _smugveh; deleteVehicle _smuggler; }; No luck so far, nothing spawns. ¯\_(ツ)_/¯ I wonder where my mistake is ...
  3. I didn't know any of this! Thank you so much. I will report back when I test it.
  4. I waited more than 20 minutes. 🙂 Ok, I got it working with preplaced objects in the editor. Trigger activation by player, on activation : _nobj = nearestObject [smuggler,"CargoNet_01_barrels_F"]; deleteVehicle _nobj; [player,500] call grad_moneymenu_fnc_addFunds; The fuel crate disappears and the player receives 500 Cr. But I think it will better with addAction on the smuggler itself instead of a trigger.
  5. Yes, this was my intent. I added addAction so the player can delete the crate manually after they use all fuel or vehicle rearming points. while {true} do { sleep 1800; _ammobox = "Box_NATO_AmmoVeh_F" CreateVehicle [5052.76,6887.21,0]; _ammobox addAction ["Destroy crate.", {deleteVehicle (_this select 0)}]; _marker = createMarker ["Ammo Produced!", [5050.66,6886.46,0]]; _marker setMarkerType "loc_Truck"; sleep 300; deleteMarker "Ammo Produced!"; }; But it will be interesting if I can read about editing objects config somewhere. @Larrow script for composition spawning is very interesting and I definitely try to use it in my mission.
  6. Hi, there. I am trying to make two "factories" in my mission - one producing fuel and the other vehicle ammo points. Both factories should produce a box filled with fuel and "ammo points" respectively. The fuel and ammo points use ACE3 framework. For the fuel factory I made these script and it works perfectly (executed via initServer) : while {true} do { sleep 1800; _fuel = "CargoNet_01_barrels_F" createVehicle [4694.33,9483.27,0]; [_fuel, 1000] call ace_refuel_fnc_makeSource; _marker = createMarker ["Fuel Produced!", [4697.51,9475.91,0]]; _marker setMarkerType "loc_Truck"; sleep 300; deleteMarker "Fuel Produced!" }; Every half hour it produces one barrel with 1000 fuel (ACE). I tried to make the same thing with ammo points for vehicle rearming but no success. I am trying to implement ACE3 Rearm framework code (taken from https://ace3.acemod.org/wiki/framework/rearm-framework.html) : while {true} do { sleep 600; _ammobox = "CargoNet_01_box_F" createVehicle [5058.03,6888.37,0]; _ammobox = setVariable ["ace_rearm_isSupplyVehicle",true]; [_ammobox, 1200] call ace_rearm_fnc_setSupplyCount; _marker = createMarker ["Ammo Produced!", [5056.13,6886.58,0]]; _marker setMarkerType "loc_Truck"; sleep 300; deleteMarker "Ammo Produced!" }; But it doesn't spawn anything, it doesn't show any error and I have no clue why isn't working. Big thanks to everyone who wants to help a big script nOOb like myself.
  7. Thank you for pointing out I am not using the properly configurated box. I just changed the classname to proper one -> "Box_NATO_AmmoVeh_F" and now "the factory" is producing one crate filled with 1200 vehicle rearming points as intended. Problem is solved, thanks to you. ☺️ Actually it spawns a crate, marks it on the map for 5 min, then deletes the marker. Its just a reminder for the player that a new crate with rearming points is produced. No markers or crates are spawning on top of each other as you can see on this screenshot: https://drive.google.com/file/d/1CZGhw7NjzXD9A21XZZJU8pMJRnkCX5UR/view?usp=sharing
  8. I corrected the syntax but still no avail. 😪 Can someone help me to integrate this : this setVariable ["ace_rearm_isSupplyVehicle", true]; ace_rearm_defaultSupply=6000; with this : while {true} do { sleep 600; _ammobox = "CargoNet_01_box_F" CreateVehicle [5052.76,6887.21,0]; //?? _marker = createMarker ["Ammo Produced!", [5050.66,6886.46,0]]; _marker setMarkerType "loc_Truck"; sleep 300; deleteMarker "Ammo Produced!"; };
  9. Thank you for trying to help me! I deleted my sqf, made a new one and pasted your code ... still no luck. 😢 It is strange because if I make a crate in the editor and paste this in the init field it's working like a charm: this setVariable ["ace_rearm_isSupplyVehicle", true]; ace_rearm_defaultSupply=6000; But obviously I need to implement pure script version of this.
  10. Ok, it spawns a crate but without any rearming points.
×