Jump to content

Harzach

Member
  • Content Count

    4933
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Harzach

  1. Don't cross/double-post: Where did you get the screenshot?
  2. Harzach

    CfgORBAT missing `}` bug

    Line 301 is missing a closing bracket: Assets[] = {{I_Truck_02_transport_F,2},{I_MRAP_03_hmg_F,1}; // should be Assets[] = {{I_Truck_02_transport_F,2},{I_MRAP_03_hmg_F,1}};
  3. Harzach

    Calling function from trigger in script

    Your syntax here is incorrect: { private _trigger = createTrigger ["EmptyDetector", getMarkerPos _smallSettlementAreas]; _trigger setTriggerArea [1000, 1000, 100, false]; _trigger setTriggerActivation ["WEST", "PRESENT", true]; _trigger setTriggerStatements ["", "thistrigger call spawnSmallSettlement", ""]; } forEach _smallSettlementAreas; Instead of iterating through your marker array, you are calling getMarkerPos on the array itself multiple times. https://community.bistudio.com/wiki/forEach { private _trigger = createTrigger ["EmptyDetector", getMarkerPos _x]; // USE MAGIC VARIABLE "_X" HERE _trigger setTriggerArea [1000, 1000, 100, false]; _trigger setTriggerActivation ["WEST", "PRESENT", true]; _trigger setTriggerStatements ["", "thistrigger call spawnSmallSettlement", ""]; } forEach _smallSettlementAreas; Also, regarding BIS_fnc_relPos:
  4. No reason why it shouldn't. [*EDIT* - of course, you mean your second example.] Regardless, you could use forEach: {[_x, 1500] execVM "fn_taskRush.sqf"} forEach [p0_1, p0_2, p0_3]; But again, this is just a fancy way of writing what you started with above.
  5. Init.sqf executes on server and all clients as they join. remoteExec ["bis_fnc_holdactionadd", 0, true]; When your server starts, it remoteExecs to all clients, current and future (the third param is JIP, which you have set to "true"). When a client joins, they receive the remoteExec'd code and also run it themselves locally. Hence the doubling. Try using initServer.sqf instead.
  6. Harzach

    Get POS Set POS

    getPos returns an array with three elements. For example, [0,0,0] where: [ 0, // X-coordinate or "east-west" 0, // Y-coordinate, or "north-south" 0 // Z-coordinate, or "up-down" ]; If you want something in that exact position, you could do: _pos = getPos _thing1; _thing2 setPos _pos; // or _thing2 setPos (getpos _thing1); If you want something offset from that position, you will need to change the relevant values. If we expand Joe's code vertically we can see things a little easier: green1 setPos [ (getPos truck1 select 0) +20, (getPos truck1 select 1) +30 ]; So, we're changing index 0 (X-coordinate) by +20 and index 1 (Y-coordinate) by +30. If we don't specify index 2 (Z-coordinate) it will assume 0 meters over the surface below. Another way to do the same thing would be: green1 setPos (getPos truck1 vectorAdd [20,30]);
  7. Here on the forums, they will appear as red dots when pasted into a code block - but only while editing: Offline editors might display them as you see in @mrcurry's post.
  8. It's expected, see my signature. Glad you're sorted!
  9. First, get rid of the outer curly brackets in your script. Second, you pass no params via execVM, so the param "_unit" in your script is nil. For example: [] execVM "myscript.sqf"; //should be [this] execVM "myscript.sqf"; params ["_unit"]; // _unit is now whatever "this" is Third, it's not a dynamic system. Your script ostensibly adds actions only to the vehicles that are being passed to it on execution. Your comments suggest you want all vehicles created during mission time to have these actions added. Since addAction is local, we want to run your code on each player's machine. Running it on the server is unnecessary. We can use initPlayerLocal.sqf for this. initPlayerLocal.sqf: while {true} do { sleep 10; { if ((typeOf _x) in ["B_GEN_Van_02_vehicle_F"]) then { if (!(_x getVariable ["FED_hasActions", false])) then { _x setVariable ["FED_hasActions", true]; _unit enableVehicleCargo false; _unit addAction [ "Placeholder text", { params ["_target", "_caller", "_actionId", "_arguments"]; _target enableVehicleCargo true; _target lockCargo true; _target lockCargo [0, false] }, nil, 1.5, true, true, "", "(vehicleCargoEnabled _target) == false && count crew _target == 0", 5, false, "", "" ]; _unit addAction [ "Placeholder text 2", { params ["_target", "_caller", "_actionId", "_arguments"]; _target enableVehicleCargo false; _target lockCargo false }, nil, 1.5, true, true, "", "(vehicleCargoEnabled _target) == true && count crew _target == 0 && (getVehicleCargo _target) isEqualTo []", 5, false, "", "" ] }; }; } forEach vehicles; }; There is likely a more performance-optimal way to do this. Also, untested. To explain: if ((typeOf _x) in ["B_GEN_Van_02_vehicle_F"]) then { Now instead of a 1:1 comparison, we can add actions to multiple classes, just add them to the array: if ((typeOf _x) in ["B_GEN_Van_02_vehicle_F", "B_GEN_Van_02_transport_F", "B_GEN_Offroad_01_covered_F"]) then { Also: if (!(_x getVariable ["FED_hasActions", false])) then { _x setVariable ["FED_hasAction", true]; We don't want to add actions to a vehicle that already has them, so we set a variable on each vehicle as it receives its actions. Now, when we iterate through vehicles every 10 seconds, the vehicles that already have actions are ignored.
  10. Harzach

    what is this addon? [Bomb hole]

    Where did you get the screenshot from? I would guess it's Havoc's Simple Craters (or Improved Craters) but comments on the Workshop page suggest it's no longer working.
  11. Also, it would seem to me that ACE_ApplyHandcuffs is in ACE_Actions, not ACE_MainActions, as shown in the config path you posted. That said, I've been fiddling with this for a while now to no avail. You might want to ask over on the ACE Discord. https://acemod.org/discord
  12. execVM "initBucks.sqf"; You are not passing any arguments to your script. It is running in a vacuum. In init: this execVM "initBucks.sqf"; Now, in initbucks.sqf, the object can be referenced as "_this."
  13. Check your arguments: * Arguments: * 0: Object the action is assigned to <OBJECT> * 1: Type of action, 0 for actions, 1 for self-actions <NUMBER> * 2: Full path of the action to remove <ARRAY> Your second argument is set to "1' which defines a self-action. You want to define a plain action.
  14. Harzach

    Taget Acquiered but NO ATGM LOCKON

    I see the same result as @POLPOX - with AI gunner (but using manual fire) I have no problem engaging with the Skalpel ATGM, or any other precision weapons. Without the gunner, no joy.
  15. Harzach

    Scripting for Pub Zeus

    Why? This isn't 'Nam, there are rules. https://community.bistudio.com/wiki/createUnit Though you actually seem to be mixing syntaxes.
  16. Harzach

    Alleged"s/Bailing_outs finds and stuff

    In an object's init, which is the context to which you replied, "_this' is meaningless.
  17. Condition: ({alive _x} count units grp1) == ({_x inArea thisTrigger} count units grp1) Basically, this says "the number of units from grp1 that are still alive are also all in the trigger area."
  18. Harzach

    DeleteGroup work or?

    The problem here isn't that you need to delete some groups. The problem is that your mission has reached the group limit. You should be asking why this is happening. Share your mission file and any mods required.
  19. Ah, sorry. That keyword is used in caching.sqf. As far as I can tell, it is only used to create a safety condition(?): //SNIP if ((count (crew _obj)) > 0) then { // Assume all crew will automatically cache private ["_group", "_endWait", "_res"]; _group = group ((crew _obj) select 0); _endWait = diag_tickTime + CACHE_VEH_TIMEOUT; _res = false; while {true} do { if (isNull _obj || {!alive _obj} || {!local _obj}) exitWith {}; // Exit with failure _res = (count (crew _obj)) == 0; if (_res || {diag_tickTime > _endWait}) exitWith {}; // Final exit check, only possibility of true uisleep CACHE_MONITOR_DELAY; }; if (_res) then { _cacheObj = true; }; } else {_cacheObj = true}; But for diag_tickTime > _endWait to evaluate true, CACHE_VEH_TIMEOUT would need to be defined as less than 0 - any value greater than 0 would evaluate false, so I'm not sure what the point of using any value other than 1 is. There are notes regarding the experimental nature of vehicle caching, so perhaps the keyword is not fully implemented. That or I am simply not understanding something, which is entirely possible, if not likely. The author hasn't been on the forums for six years, so don't hold your breath waiting to hear their explanation.
  20. #define is a preprocessor command that is used to define (!) config keywords.
  21. Harzach

    VLS Multiple Strikes

    It's a more "function rich" syntax of for: You are correct to question it, as you are simply iterating through a known value. The AI used it because whatever script it scraped it from used it. AI does not understand context.
  22. If it is even possible, you need to make an addon that overwrites the terrain. You can't do this via scripting/Description.ext.
  23. No closing semicolon and a few corrupted characters: When you paste code into a code block, corrupted/invisible characters show up as red dots. You can just delete them then recopy your code out of the code block.
×