Jump to content


  • Content count

  • Joined

  • Last visited

  • Medals

Community Reputation

60 Excellent


About Muzzleflash

  • Rank
    First Sergeant


  • Interests
    Little of everything
  1. A couple of things. Is the file present in the mission folder/pbo? In that case, don't send the entire script, rather just the path: [[], "folder\costTable.sqf"] remoteExec ["execVM", ....]; Also, your remoteExec is non-sensical. Say zeusUnit is a variable referring to object X. Then remoteExec ["spawn", zeusUnit, true] tells it to run now where X is local, and for future players, if X is local, to also run it. So imagine the player owning X disconnects, now X is deleted. Later, another Zeus player takes the slot and gets the player object Y. When it processes the JIP commands, it sees one pertaining to object X. Well X is not local to the joining zeus player (in fact X is nowhere). So nothing happens. From the BIKI, maybe you want to try remoteExec ["spawn","zeusUnit",true]; notice it is a string now. But I haven't tried that, and the BIKI does not specify whether it only resolves the string once, or each time.
  2. Return value problem

    Think this might be simpler: setDate (numberToDate [2018 + (floor random 23), random 1]); Also, in your code it is extremely unlikely that random 22 will be a whole number, thus it will never match in your _bissextile. In fact none of your randoms will.
  3. Vehicle cargo capacity

    That's how the numbers are. If transportMaxWeapons is 64, then you can put up to 64 small arms weapons into the truck. It doesn't matter how the 3d model looks, whether it is already a "box" loaded.
  4. Wiki offiline

    Just made one for you: http://s000.tinyupload.com/index.php?file_id=99681293229700810150 . It is the command list, and all commands commands linked to directly. Unzip and open index.html.
  5. Math Issues

    This seems to consistently hit: MakeArtyStrike = { params ["_targetASL", "_fromDir", ["_shellClass", "Sh_120mm_HE"]]; private _altitude = 1500; private _horizDist = 900; private _horizSpeed = 202.8; private _vertSpeedCorrectionFactor = 0.908; private _flightTime = _horizDist / _horizSpeed; private _spawnPosASL = _targetASL getPos [_horizDist, _fromDir]; _spawnPosASL set [2, (_targetASL select 2) + _altitude]; private _shellVelocity = [0,0,0] getPos [_horizSpeed, _fromDir-180]; _shellVelocity set [2, -(_altitude / _flightTime * _vertSpeedCorrectionFactor)]; private _shell = _shellClass createVehicle _spawnPosASL; _shell setPosASL _spawnPosASL; private _upDir = _spawnPosASL vectorFromTo _targetASL; _upDir set [2, 1 + (_upDir select 2)]; _shell setVectorDirAndUp [ (_targetASL vectorDiff _spawnPosASL), _upDir ]; _shell setVelocity _shellVelocity; _shell }; [getposasl target, 280] call MakeArtyStrike;
  6. Place unit in front of vehicle

    Not sure if the bounding box is defined the same for each vehicle. But something like this then: private _bbox = boundingBoxReal damagedVehicle; private _frontDist = _bbox select 1 select 1; //This seems to be the edge of the front of the bounding box private _worldPos = damageVehicle modelToWorld [0, _frontDist, 0]; _worldPos set [2, 0]; // Ensure we placed on ground mechanic setPos _worldPos;
  7. There is nothing called "t" in createDiaryRecord. You probably meant to use <font>. If that doesn't work, try to remove the space between color and =.
  8. Enums, are they possible

    In program terms an enum is an enumerated type. That is you enumerate (specify exactly) the values that belong to the type. They don't have to integers, although it is common in C-like languages. Since we can't make custom types in SQF, we will have to make do with what we got. Basically the current values possible, e.g. number, string or array. And since SQF is not object oriented, we do not have methods, on however, we make our enum. What exactly you you mean by this? Do you mean you wan't to able to type something like: Dlc.Apex , if so you can't. How do you wan't to treat your values? Maybe something like this is closer to what you had in mind: Enum_fnc_MakeEnum = { params ["_name", "_values"]; private _result = []; { _x params ["_key", "_value"]; _result pushBack _value; private _varName = format ["%1_%2", _name, _key]; missionNamespace setVariable [_varName, _forEachIndex]; } forEach _values; missionNamespace setVariable [_name, _result]; _result }; ["DLC", [ ["VANILLA", "Vanilla"], ["LAWS_OF_WAR", "Laws of War"] ]] call Enum_fnc_MakeEnum; // Now you have all values in: { systemChat str _x; //Will output Vanilla, then "Laws of War" } forEach DLC; // Or pick a specific value: private _LoW = DLC select DLC_LAWS_OF_WAR; systemChat str _LoW; //Will output "Laws Of War"
  9. Enums, are they possible

    You can just do: MyEnum_ValA = 10; MyEnum_ValB = 20; MyEnum_ValC = 99;
  10. JIP Function

    The preInit runs the file. You want to compile the file so that is is ready for execution as a function. So there is no need for preInit. Tried what with isNil? My suggestion is, at the top of the script where you have something like: params ["_unit"]; if (isNull _unit) exitWith {}; //... rest below, e.g. add action to _unit I would expect it to. Because otherwise the whole scheme is basically useless. But ultimately the whole JIP part of remote execution is under documented, and nowhere, (I have found at least), it is clarified when JIP invocations occur.
  11. JIP Function

    Remove the preInit. And I would remove the part you added to the top of your script (this is the part that made it not working for everybody?). Instead just check in your script whether the argument is null or not.
  12. gc8, the machine on which you use publicVariable will not run any handlers.
  13. Question about AddAction and RemoteExec

    Yes, you would to ensure it runs for all players. You could do [_this select 1, "looks like ..."] remoteExec ["sideChat", 0]; .. You could also listen for the "intelFound" publicVariable broadcast and do it there instead.
  14. I recently wrote a hash function as a proof of concept for how to apply the same random global state changes using only local efficient commands. For example: using the same "key" -- an input value to the hash function -- I could apply damage to some the buildings on map without having to transmit over the network. This could be one way to handle randomization, and ensure it is always the same, without storing a lot of data or doing a lot of synchronizing (only the key - basically a number - would be synchronized to clients).
  15. Help with Items Respawning

    You can use HazJ approach, just remember to add the event handler to the replenishment item you create (mentioned under etc... :) ).