Jump to content

sarogahtyp

Member
  • Content Count

    2074
  • Joined

  • Last visited

  • Medals

Everything posted by sarogahtyp

  1. I did this on Altis builings: getText (configFile >> "Vehicles" >> (typeOf cursorObject) >> "DestructionEffects" >> "Ruin1" >> "type") giving me back empty strings: "" I tried that code I posted in biki on those buidlings and it is working. Maybe the behaviour you describe is not a problem anymore? Also the wreck models are deleted automatically after setting damage to 0. Edit:I did a mistake with crawling the config. I will try it again later.
  2. As this is the first post coming up with google on "arma 3 repair houses" and I had to fiddle out how it works, I now digging this up and referring to the solution which is now added as comment in biki: https://community.bistudio.com/wiki/setDamage
  3. private _classnames = ["your_object_type_1_classname", "your_object_type_2_classname", "your_object_type_3_classname", "your_object_type_4_classname" ]; creates a local array named _classnames which contents have to be strings which should be the classnames of your specific object types. You can get those classnames if you start your mission, go to such object, point on it and open debug console and execute this: copyToClipboard ( typeOf cursorObject ); now you have the classname of the object in your clipboard and you can just paste it in the array. For some random houses on Altis it would look like this: private _classnames = ["Land_u_House_Big_02_V1_F", "Land_Metal_Shed_F", "Land_i_Stone_HouseBig_V2_F", "Land_u_Addon_02_V1_F" ]; private _position_trigger = position your_trigger_name; here you just have to substitute your_trigger_name with the variable name of your trigger. It defines just the center position for the circle within nearestObjects looks for the given object types. private _radius = your_search_radius; same but with search radius. Read the link bout nearestObjects I posted. Its all explained there. If you have questions after that then just ask.
  4. https://community.bistudio.com/wiki/nearestObjects private _classnames = ["your_object_type_1_classname", "your_object_type_2_classname", "your_object_type_3_classname", "your_object_type_4_classname" ]; private _position_trigger = position your_trigger_name; private _radius = your_search_radius; if ( nearestObjects [_position_trigger, _classnames, _radius, true] isEqualTo [] ) then { hint "Everything is clean now."; };
  5. sarogahtyp

    About distances

    I tried to measure the difference between distance, distanceSqr and distance2D in the debug console but without success. I could not see any difference in performance between these 3 commands.
  6. the file is damaged, I cant open it ...
  7. sarogahtyp

    About distances

    mostly I use distanceSqr. I thought bout if distance2D is faster but never tested it. With nearestObjects I use 2d mode as well.
  8. do you have any remote execution restrictions in your description.ext as described here? https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec
  9. I found this: https://steamcommunity.com/sharedfiles/filedetails/?id=2484775180 did you try it already? Edit: For me it seems to be a good port but its vanilla only.
  10. I did not fully understand what you want to do exactly but I guess you need to enable/disable the EH behaviour related on actions taken by clients. The important thing is to execute the event handler where the popups are local. This should be on server. If you need other behaviour then the event handler provides then you have to remove the EH from those targets. Therefore you should apply the EH everytime you need the behaviour and remove it after that. If a client decides on which popups the EH should get applied then you have to remoteExec the EH on the server. This can be done by first creating a sqf file with the EH. You could name it apply_EH.sqf apply_EH.sqf params ["_popup"]; //apply EH private _eh_index = _popup addEventHandler ["Hit", { private _hit_num = 10; private _down_time = 5; params ["_unit"]; private _phase = _unit animationPhase "Terc"; if ( _phase isNotEqualTo 0 ) exitWith { }; private ["_dummy"]; private _hit_already = _unit getVariable ["saro_hit_num", 0]; if ( _hit_already < _hit_num - 1) exitWith { _unit setVariable ["saro_hit_num", (_hit_already + 1) ]; _dummy = _unit spawn { sleep diag_deltaTime; _this animateSource ["Terc", 0]; }; }; _dummy = [_unit, _down_time] spawn { params [ "_unit", "_down_time" ]; private ["_phase"]; private _down_start = 0; sleep diag_deltaTime; waitUntil { _phase = _unit animationPhase "Terc"; if ( _phase isEqualTo 1 && _down_start isEqualTo 0 ) then { _down_start = diag_tickTime }; _unit animateSource ["Terc", 1]; _down_start > 0 and (diag_tickTime - _down_start) > _down_time }; _unit animateSource ["Terc", 0]; _unit setVariable ["saro_hit_num", 0]; }; }]; //store the EH index on popup to be able to remove the EH later _popup setVariable ["saro_eh_index", _eh_index]; for one specific popup (I call it _one_popup here) chosen by a client to get the EH behaviour on it you can do now: [_one_popup, "apply_EH.sqf"] remoteExec ["execVM", 2]; next thing you need a sqf file to remove that behaviour. remove_EH.sqf params [_popup]; //get the prior stored Index of the EH private _eh_index = _popup getVariable "saro_eh_index"; // no index found, just leave if (isNil "_eh_index") exitWith {}; //remove the EH _popup removeEventHandler ["Hit", _eh_index]; //destroy the index variable on popup _popup setVariable ["saro_eh_index", nil]; After that on the time a client decides to not need the EH behaviour anymore you can just do [_one_popup, "remove_EH.sqf"] remoteExec ["execVM", 2]; not tested but should work...
  11. sarogahtyp

    Deleting simple objects

    Try https://community.bistudio.com/wiki/nearObjects
  12. This is tested in init field of popup in SP only and working. Its a long thing and maybe there is a shorter solution. Should work in MP as well but not testet it there: if !(local this) exitWith {}; this addEventHandler ["Hit", { private _hit_num = 10; private _down_time = 5; params ["_unit"]; private _phase = _unit animationPhase "Terc"; if ( _phase isNotEqualTo 0 ) exitWith { }; private ["_dummy"]; private _hit_already = _unit getVariable ["saro_hit_num", 0]; if ( _hit_already < _hit_num - 1) exitWith { _unit setVariable ["saro_hit_num", (_hit_already + 1) ]; _dummy = _unit spawn { sleep diag_deltaTime; _this animateSource ["Terc", 0]; }; }; _dummy = [_unit, _down_time] spawn { params [ "_unit", "_down_time" ]; private ["_phase"]; private _down_start = 0; sleep diag_deltaTime; waitUntil { _phase = _unit animationPhase "Terc"; if ( _phase isEqualTo 1 && _down_start isEqualTo 0 ) then { _down_start = diag_tickTime }; _unit animateSource ["Terc", 1]; _down_start > 0 and (diag_tickTime - _down_start) > _down_time }; _unit animateSource ["Terc", 0]; _unit setVariable ["saro_hit_num", 0]; }; }]; you are able to adjust needed number of hits with variable _hit_num and the time the target is down with _down_time
  13. No need to use MP event handler. The Hit event handler executed where popups are local (most likely on server) should be enough. The problem is to suppress the engine animation for popping up again, but I m on it...
  14. Reading the faster topics first post helps...
  15. sarogahtyp

    MP scripting issues

    MP scripting is the higher level. One has to read the biki entries for each command carefully to get it done.
  16. sarogahtyp

    MP scripting issues

    missionNamespace setVariable ["sorted_locations", _sortedLocations]; creates the global variable sorted_locations on the machine where that line is executed. To get it a public variable (known by all machines) you have to set the third parameter of setVariable to true as stated in biki and shown in Example 1 there. therefore u should use this to get it public: missionNamespace setVariable ["sorted_locations", _sortedLocations, true]; but I did not verify if that solves your problems...
  17. i wrote and tested the script in above post. Should work for you.
  18. sarogahtyp

    how to count ai casualties?

    No, I'm out of here. This is too exhausting for me with you.
  19. sarogahtyp

    how to count ai casualties?

    no need to post that twice. Which way do you want to do this if you can't script anything? What have you done yet? If you write another "One-Short-Sentence-Answer" then I am outta here...
  20. sarogahtyp

    how to count ai casualties?

    If I remember correct then you can just open the map then click on a specific player and then you will see which AI was killed by that player.
  21. sarogahtyp

    how to count ai casualties?

    if u don't script, what for do u need it? Describe what u want to do!
  22. sarogahtyp

    how to count ai casualties?

    what casualties? what topic did u read? what did u try yet?
  23. sarogahtyp

    force spawned Ai to move on roads

    just in case someone is looking for something similar. spawning quad (near road) and driver - adding 2 random waypoints - endless driving between both waypoints: tested in initServer.sqf on Altis in Kavala: waitUntil { sleep 1; time > 0 }; //center position of waypoint and spawn position search private _center_pos = getPos saro_trigger; // maximum distance between center and waypoints/vehicle spawn private _waypoint_search_radius = 500; //minimum distance between both waypoints private _wp_min_distance = 50; //move player into vehicle (for testing) _player_move_in = true; //speed for moving ( "LIMITED" "NORMAL" "FULL" ) private _wp_speed = "FULL"; private ["_pos1", "_pos2", "_road1", "_road2", "_wp2"]; private _posvec = [0,0,8000]; private _wp_min_distanceSqr = _wp_min_distance^2; while { (_posvec nearRoads 15) isEqualTo [] } do { _posvec = [_center_pos, 0, _waypoint_search_radius, 7] call BIS_fnc_findSafePos; }; //spawn hunter _veh = createVehicle ["B_G_Quadbike_01_F", _posvec, [], 0, "NONE"]; //spawn unit and make driver _unit = (createGroup west) createUnit ["B_crew_F", [0, 0, 8000] , [], 0, "CAN_COLLIDE"]; _unit assignAsDriver _veh; _unit moveInDriver _veh; if ( _player_move_in ) then { player moveInAny _veh; }; while { isNil "_road1" || isNil "_road2" || { _road1 distanceSqr _road2 < _wp_min_distanceSqr } } do { _pos1 = _center_pos getPos [ (random _waypoint_search_radius) , (random 360) ]; _pos2 = _center_pos getPos [ (random _waypoint_search_radius) , (random 360) ]; _road1 = (_pos1 nearRoads 50) select 0; _road2 = (_pos2 nearRoads 50) select 0; }; saro_wp1 = (group _unit) addWaypoint [(position _road1), 0]; _wp2 = (group _unit) addWaypoint [(position _road2), 0]; saro_wp1 setWaypointType "MOVE"; _wp2 setWaypointType "MOVE"; saro_wp1 setWaypointCompletionRadius 10; _wp2 setWaypointCompletionRadius 10; saro_wp1 setWaypointSpeed _wp_speed; _wp2 setWaypointSpeed _wp_speed; _wp2 setWaypointStatements ["true", "(saro_wp1 select 0) setCurrentWaypoint saro_wp1;"];
  24. Why naming multiple units? Your code let AISoldier_1 join players group if player is near. nothing else. no reason to name the other AI.
×