Jump to content

kauppapekka

Member
  • Content Count

    58
  • Joined

  • Last visited

  • Medals

Everything posted by kauppapekka

  1. kauppapekka

    Reverse Engineering EOS

    I'd say that you can see server side performance improvements with this. Now I don't know how performance heavy nearestLocations is, but I guess you've already tested it so client side performance impact is negligible. Activating: Now the client activating part should be quite straightforward, when a client computer deems it's close enough to the zone it sends the information to server and other clients that this zone is activated. To the server so it knows to activate the zone and to other clients that they don't spam the same message through the network. For server side activation easiest bulletproof method to know server side which sites are active and which are not is for the server to go through the array of all sites 3000 and check for true cases. This is maybe not the best method, but I'd say going through 3000 booleans is faster than the 3000 triggers. Other way I can think of is creating a personal variable regarding each client in the server and the client sends the information of zone activation to the server using that server-client variable. In other words one loop going through all the sites VS player amount of loops looking what they send. It might be also possible to put the server-client variables to an array and just have one loop going through that, but removal and creation of new server-client variables while going through the array might break it. So as it seems messages done with remoteExecCall are executed sequentially, so there will be no need to keep checking server side if anything has been updated, just check in the server side script if the zone has already been activated in the case of two or more clients arriving to the same zone at the same time. With the addPublicVariableEventHandler it might also be possible to make the 3000 booleans without looping. There might be some extra client side coding work regarding UAVs and drones depending how you want them to impact the sites, but you can also make it so that clients flying high or going fast enough don't trigger zones saving server performance. Deactivating: For this part creating a server side trigger checking for any clients in the designated zone is the easiest solution. When the conditions are met the server just deletes the trigger, deactivates the zone and sends the information to the clients. Triggers: Now the deactivating trigger can just be code you create yourself using spawn command as the 0.5 second trigger happens needlessly often. Server side zone deactivation check will work just fine with a 30 second sleep, and activation check with 3 second sleep for both client and server.
  2. kauppapekka

    Return value from function

    Well according to Killzone Kid's note it does double as a private.
  3. kauppapekka

    Return value from function

    https://community.bistudio.com/wiki/Function#Return_Values //Second function Units = { params["_marker", "_grp01"]; _grp01 = createGroup [civilian, true]; _grp01 createUnit [selectRandom ["C_Man_casual_1_F","C_Man_Fisherman_01_F","C_man_p_shorts_1_F","C_Man_UtilityWorker_01_F","C_man_polo_2_F","C_man_polo_5_F","C_Man_casual_6_F","C_Man_casual_4_F"], _marker, [], 10, "FORM"]; _grp01 }; You can only return values with call. When making functions it is usually desired that variables inside that function don't change variables that have been possibly named the same, that is why the params command. I also removed the _unit variable as it seems you don't use it inside the function. https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting#Must-read_articles Some good reading material.
  4. kauppapekka

    Zeus respawning issue.

    Use the templates for different sides https://community.bistudio.com/wiki/Arma_3_Respawn#Respawn_Templates. Or Turn it to respawnOnStart = -1; Then create a new file initPlayerLocal.sqf, in which you check if the player is the Zeus or not, and use https://community.bistudio.com/wiki/forceRespawn accordingly. https://community.bistudio.com/wiki/Event_Scripts
  5. Because you have script error(s) like: crew _vehicle addMPEventHandler when it should be _x addMPEventHandler There might be more, not starting to go through the whole code. https://en.wikipedia.org/wiki/Debugging#Debugging_process "- - The programmer will try to remove some parts of original test case and check if the problem still exists. - -" So comment /* line line line */ or //line all the stuff that is not used in spawning the tank and making it move, and work from there.
  6. You're making the units join the group you've created so you need to remove the earlier taskPatrol and put this after the forEach crew _vehicle. [_group1,_posVehicle,100] call BIS_fnc_taskPatrol; It might also work where the current taskPatrol line is as I haven't looked into empty groups and creating waypoints to them.
  7. If you don't get script errors showing up then from the Arma 3 Launcher go to Parameters -> All Parameters -> Author -> Show Script Errors and tick the box. https://community.bistudio.com/wiki/moveInCargo https://community.bistudio.com/wiki/assignAsCargo TaskDefend takes a group not a unit. If I put this into the debug and local exec the tank moves as planned. tank = createVehicle ["B_MBT_01_TUSK_F",getPos player,[],50,"NONE"]; createVehicleCrew tank; [group driver tank,getPos tank,100] call bis_fnc_taskPatrol; So you're getting a script error or doing something to the tank or group, as this is still not the whole code regarding the spawning. { _posVehicle = [_pos,3,20,1,0,5,0] call BIS_fnc_findSafePos; _vehicle = createVehicle [(_x select 0),_posVehicle,[],50,"NONE"]; _vehicle setPos [(_posVehicle select 0),(_posVehicle select 1), (_posVehicle select 2)]; _vehicle setVectorUp surfaceNormal position _vehicle; createVehicleCrew _vehicle; [group Crew _vehicle, _pos,100] call BIS_fnc_taskPatrol; clearMagazineCargoGlobal _vehicle; clearWeaponCargoGlobal _vehicle; clearItemCargoGlobal _vehicle;
  8. The group manning the vehicle does the driving, not the vehicle itself. _posVehicle = [_pos,3,20,1,0,5,0] call BIS_fnc_findSafePos; _vehicle = createVehicle [(_x select 0),_posVehicle,[],50,"NONE"]; _vehicle setPos [(_posVehicle select 0),(_posVehicle select 1), (_posVehicle select 2)]; _vehicle setVectorUp surfaceNormal position _vehicle; createVehicleCrew _vehicle; [group driver _vehicle, _posVehicle,100] call bis_fnc_taskPatrol;
  9. Hard to say what you are trying to store into the variable, if anything at all, as you don't have the whole line in there? But as grumpy said this is how you store a random marker into that variable, minus one too many (. mrk_1 = selectRandom (allMapMarkers select { _x find "m_"== 0});
  10. https://community.bistudio.com/wiki/BIS_fnc_ObjectsMapper Returns: Created objects (Array) _HQComp = [(_ObjPos), random 360, _Obj] call BIS_fnc_ObjectsMapper;
  11. kauppapekka

    Global variable - how to?

    I doubt you need to create a loop for this kind of thing as this line (allPlayers - switchableUnits) select {alive _x && isPlayer _x}; gives the same array as your loop's variable. And to my knowledge even this line: allPlayers select {alive _x}; https://community.bistudio.com/wiki/sleep A good rule of thumb is that when you call a code or a function there can't be any sleep or waitUntils as it needs to be completed with haste, and when there needs to be condition checks and waiting, or just waiting, you use spawn or execVM. But there seems to be an exception as well: "A called function may only use suspension (sleep, uiSleep, waitUntil) if it originates in a scheduled environment. If the called function originates in a non-scheduled environment it will return a generic error." https://community.bistudio.com/wiki/call
  12. kauppapekka

    Combat Realism Scripts

    https://community.bistudio.com/wiki/playAction
  13. Well at least my quick test showed that sorting worked with nearestObjects, so you might have accidentally used nearObjects. https://community.bistudio.com/wiki/nearestObjects https://community.bistudio.com/wiki/nearObjects But as I believe your only trying to check distances between players I'd use allPlayers or nearEntities with your sorting/distance check function. https://community.bistudio.com/wiki/allPlayers https://community.bistudio.com/wiki/nearEntities
  14. Error parsenumber: Type Number, expected Bool,String You sure your _value is not a number already? https://community.bistudio.com/wiki/parseNumber
  15. https://community.bistudio.com/wiki/params The strings in the params array are just names he wanted give to his variables, as the names represent the values the event handler gives. He could name them params ["_black","_fire","_monkey"]; if he wanted to and still contain the same value for each variable given by the event handler. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetOut • vehicle: Object - Vehicle the event handler is assigned to • position: String - Can be either "driver", "gunner" or "cargo" • unit: Object - Unit that left the vehicle
  16. The "redundant" functions were used to do the jobs that now have been incorporated to some commands. So I'd say better to just use the commands as usually they are faster and "cleaner" looking. BIS_fnc_buildingPositions: Introduced_with_Arma_3_version_1.00 buildingPos: Since Arma 3 v.155.133934 if index -1 is supplied, the command will return array with all available positions.
  17. kauppapekka

    explosives fix

    [_explosive,_nearVehicle,_unit,_random0,_random1, _charge] spawn { _explosive = _this select 0; _nearVehicle = _this select 1; _unit = _this select 2; _random0 = _this select 3; _random1 = _this select 4; _charge = _this select 5; sleep 1.5; _explosive attachTo [_nearVehicle]; sleep 0.1; if (!(isNull attachedTo _explosive) && {!(isNull _nearVehicle)}) then { _explosive setPosWorld getPosWorld _nearVehicle; }; [_explosive,_random0,_random1] call BIS_fnc_SetPitchBank; //_unit setVariable ["charges",(_unit getVariable ["charges",[]]) + [_explosive]]; //[_explosive,_unit] spawn EtV_TimedCharge; private ["_actionID"]; _actionID = 0; if (_nearVehicle isKindOf "LandVehicle" || _nearVehicle isKindOf "Air" || _nearVehicle isKindOf "Ship") then { _actionID = _unit addAction [ "Detonate " + getText (configfile >> "CfgMagazines" >> _charge >> "displayName") + " [" + getText (configfile >> "CfgVehicles" >> typeOf _nearVehicle >> "displayName") + "]", {_this select 3 setDamage 1}, _explosive ]; } else { _actionID = _unit addAction [ "Detonate " + getText (configfile >> "CfgMagazines" >> _charge >> "displayName") + " [" + mapGridPosition _explosive + "]", {_this select 3 setDamage 1}, _explosive ]; }; [_explosive, _unit, _actionID] spawn { waitUntil {sleep 0.5; !alive (_this select 0) || !alive (_this select 1)}; if (alive (_this select 1)) then { _this select 1 removeAction (_this select 2); }; }; };
  18. kauppapekka

    Support Requester Help

    The spoiler part was just an alternative way of doing 1. part. As the function only does this:
  19. kauppapekka

    Support Requester Help

    Well it works for the first one but as the first player of the slot disconnects that unit is also deleted and when the slot is used the second time it's a copy of the unit and the copy isn't perfect, or that's how I reason it. Tweaking the module settings? Otherwise I got two ideas: 1. Use the code you have and put for example ArtilleryRequester on every addSuportLink so there won't be multiple requesters linked to a unit. 2. You need to create an individual requester for each unit that wants to call supports. It's either related to the first part or you should lose support everytime you respawn, then you'd need to run the code also in onPlayerRespawn.sqf.
  20. kauppapekka

    explosives fix

    Yup attachTo doesn't seem to want to work with them map objects. One way would be to just place the object with the setPos commands and get the position you want with modelToWorld or lineIntersect, as it doesn't really need to be attached as the stuff won't move around. Also might want to take this part away from the script if you're placing stuff on other than vehicles: + " [" + getText (configfile >> "CfgVehicles" >> typeOf _nearVehicle >> "displayName") + "]"
  21. kauppapekka

    Support Requester Help

    I'd say the easiest way would be to just check the units class name and give the supports based on that. if (typeOf (_this select 0) isEqualTo "B_Soldier_TL_F") then { ... ... ... }; if (typeOf (_this select 0) isEqualTo "B_recon_JTAC_F") then { ... ... ... }; You can get the class names from https://community.bistudio.com/wiki/Arma_3_Assets Or in Eden editor by: • Hovering mouse over the object • Right clicking the object > Log > Log Classes to Clipboard
  22. kauppapekka

    Support Requester Help

    Hard to tell from that what went wrong but: I placed down a Support Requester module variable named ArtilleryRequester and a Support Provider: Artillery (Virtual) module variable named ArtilleryProvider. Created initPlayerLocal.sqf file and placed this: [_this select 0, ArtilleryRequester, ArtilleryProvider] call BIS_fnc_addSupportLink; And it works. Also the correct place for the function is initPlayerLocal.sqf if one wants that its synchronization checks work properly.
  23. kauppapekka

    Support Requester Help

    You name/define the modules and then just put this into one of the initPlayer: [_this select 0, yourRequesterModule, yourProviderModule] call BIS_fnc_addSupportLink; Of course if you don't want everyone to have supports you need to make some conditions.
  24. kauppapekka

    Support Requester Help

    https://community.bistudio.com/wiki/BIS_fnc_addSupportLink Using that function in initPlayerServer.sqf (or possibly initPlayerLocal.sqf) should do the job. https://community.bistudio.com/wiki/Event_Scripts
  25. How about onPlayerRespawn.sqf execVM "eze_join_nearest_group.sqf"; https://community.bistudio.com/wiki/Event_Scripts
×