Jump to content

Larrow

Member
  • Content Count

    3599
  • Joined

  • Last visited

  • Medals

Everything posted by Larrow

  1. Oops my mistake, as pierremgi says I forgot to add the heli as an array.
  2. Something to get you started/learn from. It's basically your code from OP just reordered and made to handle east or west markers rather than dependent on a single side. Untested
  3. As @Harzach says initPlayerLocal is passed params of whom the player is, just add the params line as shown back in. Whenever you update the rating manually ( via addRating, VAS / your CUP money trigger ) you need to call the function. The rating EH only fires when the engine changes the rating (i.e for things like killing units). e.g Activation: player addRating 2000; player removeItem "CUP_item_Money"; 0 call TAG_fnc_updatePlayerRating; Change this line in ui\playerStatsUI.hpp... From onLoad = "uinamespace setVariable [ 'playerRatingText', _this select 0 ]; _this select 0 call TAG_fnc_updatePlayerRating"; To onLoad = "uinamespace setVariable [ 'playerRatingText', _this select 0 ]; 0 call TAG_fnc_updatePlayerRating"; As there is no need to pass the control from the onLoad as we use the uiNamespace variable to get it, and we have changed the parameter to the rating amount to add instead.
  4. vectorFromTo ( getPosASLVisual object_2 vectorAdd [0,0,1] ) Nothing wrong with what you wrote, just pointing out something that is easier to write/read.
  5. ^^this. See \a3\functions_f_mp_mark\revive\defines.inc which you can include into your own scripts to access revive macros/state enumerations. These are likely the most useful from that file.
  6. Provide a simple stripped down test mission. The helicopter, slingload jeep, two players and the object with action on it, so we can see where you are going wrong.
  7. They were removed when the whole revive system was rewritten, A3 1.62 2016 I believe. spotrep-00058
  8. Of course, you have "PlayerName" as STRING for the title. What do you want? each player to have an action named... ? What exactly is SupplyTransport_1 ? Should be a group as you adding a waypoint to it.
  9. This will only ever happen if the host uses the action because of the isServer. A waypoint only has one waypointStatement, all you're doing here is immediately replacing the first with the second. Same for both waypoints. Separate out the slingLoading stuff into its own function and remoteExec it on the server/where the vehicle is local. //Description.ext class CfgFunctions { class supportFunctions { tag = "TAG"; class sling { file = "functions"; class slingSupport {}; }; }; }; //functions\fn_slingSupport.sqf params[ "_caller" ]; _success1 = Supply_Heli_1 setSlingLoad SJeep_1; _POS11 = getPosATL _caller; _POS13 = getMarkerPos "Supp_WP3"; _Supp1wp1 = SupplyTransport_1 addWaypoint [_POS11, 0]; _Supp1wp1 setWaypointType "UNHOOK"; _Supp1wp1 setWaypointSpeed "FULL"; _Supp1wp1 setWaypointBehaviour "CARELESS"; _Supp1wp1 setWaypointCombatMode "GREEN"; _Supp1wp1 setWaypointStatements ["true", "Supply_Heli_1 flyInHeight 10;"]; //Make sure heli is at a decent height before dropping the sling load _Supp1wp1 setWaypointStatements ["true", " [] spawn { Supply_Heli_1 flyInHeight 10; waituntil{ getPosATL Supply_Heli_1 select 2 <= 11 }; _success1 = Supply_Heli_1 setSlingLoad objNull; }; "]; _Supp1wp3 = SupplyTransport_1 addWaypoint [_POS13, 0]; _Supp1wp3 setWaypointType "MOVE"; _Supp1wp3 setWaypointSpeed "FULL"; _Supp1wp3 setWaypointBehaviour "CARELESS"; _Supp1wp3 setWaypointCombatMode "GREEN"; _Supp1wp3 setWaypointStatements ["true", "{deleteVehicle _x;}forEach ( crew Supply_Heli_1 + Supply_Heli_1 );"]; //Object Init this addAction [ ("<t color=""#00FF00"">" + ("PlayerName") +"</t>"), { params ["_target", "_caller", "_actionId", "_arguments"]; [_caller] execVM "PlayerName.sqf"; }, nil, 1, false, true ]; //PlayerName.sqf params ["_caller"]; //As you were using Alpha_1/Bravo_1 global vars I presume this is set in the unit var field so will be their vehicleVarName _caller sideChat format[ "%1 requesting vehicle support!", vehicleVarName _caller ]; sleep 5; //This will only be seen by the caller ["VEHICLE SUPPORT STARTED"] spawn BIS_fnc_infoText; //Call the function handling the sling support on the server( 2 ) //As its an AI vehicle this is more than likely where it is located [ _caller ] remoteExec[ "TAG_fnc_slingSupport", 2 ]; Untested
  10. What happens if you pass the 'to be added' rating value from the event? rather than relying on just the current value of the rating command. Is it just the event fires before rating is updated, seeing as you can change the rating value through the event. So would make sense the return from the rating command is not updated to reflect the new value until the event finishes, which involves the call to the function, so will not happen until after to UI text is updated. //initPlayerLocal.sqf _player addEventHandler ["HandleRating", { params ["_unit", "_rating"]; _rating call TAG_fnc_updatePlayerRating; }]; //functions\fn_updatePlayerRating.sqf uiNamespace getVariable "playerRatingText" ctrlSetText format[ "MONEY: %1", _this + rating player ];
  11. As well as what @Harzach mentions... You changed the name of the script file in CfgFunctions but have not updated the actual file name. These need to match for CfgFunctions to find the file and compile it.
  12. I doubt it does this as you check _name which is undefined. At the most, all its doing is this... _playerName = name player; hint str _playerName;
  13. vectorFromTo _dir = getPosASL object_1 vectorFromTo ( getPosASL object_2 );
  14. Show the contents of these two files, please.
  15. I presume you are talking about my test mission here. Check the FlagPoles init, have you updated the marker name in the call to NUP_fnc_initFlag for the copy and pasted flag?
  16. See the download in the previous post. I fixed some things that were not quite working correctly in MP.
  17. EDIT: Fixed some MP anomalies
  18. Maybe this is something that should be brought up on the feedback tracker, as the waypoint is never completed so the statement condition should really never even be checked, let alone the statement executed. What happens if you skip several waypoints that have statements like this? Are they all executed, or only the current? Sounds like a logic error to me in the waypoint code. I suppose a quick user fix would be before using setCurrentWaypoint to check if the current waypoints statement condition is false or the statement is blank and if not then set it so.
  19. You can also use NetID to do the same thing. buttonSetAction [_idc, format ["player moveInDriver ( '%1' call BIS_fnc_objectFromNetId );", [ _vehicle ] call BIS_fnc_netId]];
  20. Format of an OBJECT to STRING produces erroneous results like "B Alpha 1-1:1 (Dev)" ( <- this is an example format of a player object ) unless the object has a vehicleVarName where format will return the variable name. So player moveInDriver B SomeRubbish 1-1-:1 makes no sense and results in a error. Use the function BIS_fnc_objectVar to return a vehicleVarName for the OBJECT. If the object already has a vehicle var name it will be returned, if it does not one will be set and returned. buttonSetAction [_idc, format ["player moveInDriver %1;", [ _vehicle ] call BIS_fnc_objectVar]];
  21. As mentioned above index 0 is not the first move, it is their initial starting point. If you set the group's current waypoint to the waypoint just added then they will ignore trying to reach their current, as it is no longer their current, you have just overridden this by changing their current. params[ "_grp" ]; //Give group an unreachable waypoint _wp1 = _grp addWaypoint[ /*some unreachable pos*/, 0 ]; //Give group a secondary waypoint _wp2 = _grp addWaypoint[ /*some other pos*/, 0 ]; //Group will ignore _wp1 and move straight to _wp2 _grp setCurrentWaypoint _wp2; Again, use setCurrentWaypoint. No need to try and make the group reach their current one by changing the completion radius, just skip it completely by giving them a new current.
  22. The waypoint at index 0 is not an added waypoint per se. Just the act of placing a group in the editor/spawning automatically gives the group an index 0 waypoint relative to the position they were placed/spawned. Adding a single waypoint to a group would in fact add index 1. I have seen deleting every waypoint including index 0 cause oddities before, I am not sure I've ever read anything official just based on my own experiences.
  23. What does this entail? Never ever delete the waypoint at index 0. In fact, I'd say never delete the waypoints at all. Instead, give the group new waypoints and then set their current to the first new one you want them to follow.
  24. Ive already done this and is available here... ...your welcome to go through it see what helps.
  25. // Creating cosmetic impact craters with smokes: if ( ETH_cosmeticSmokesUXO ) then { // Looping: for "_i" from 1 to 10 do { // each crater and debris: _impactPos = [_kzPos, _kzRadius] call THY_fnc_ETH_cosmetic_UXO_impact_area_crater; //you cannot spawn it as you require a return value of impact pos // local particle effect for all clients [_impactPos] remoteExec [ "THY_fnc_ETH_cosmetic_UXO_impact_area_smoke", [ 0, -2 ] select isDedicated ]; }; }; Remote execute the particle function on all machines (0) or every client (-2) if it's a dedicated server. May want to include JIP? EDIT: Not the tidiest way to achieve it as each time you are creating 10 remote calls (and possibly 10 items in the JIP queue) but quickest as an example using your code. No need to know the player in the function so removed from the above remoteExec for THY_fnc_ETH_cosmetic_UXO_impact_area_smoke, so function params need to change to match... THY_fnc_ETH_cosmetic_UXO_impact_area_smoke = { // This function creates a smoke source in a limited area pre-configured. Smoke templates: https://community.bistudio.com/wiki/Particles_Tutorial#Full_examples // Returns nothing. params ["_impactPos"]; //snip [_impactPos] remoteExec [ "THY_fnc_ETH_cosmetic_UXO_impact_area_smoke", [ 0, -2 ] select isDedicated, true ]; passed params function to call where to call also for JIP
×