Jump to content

kauppapekka

Member
  • Content Count

    58
  • Joined

  • Last visited

  • Medals

Community Reputation

27 Excellent

1 Follower

About kauppapekka

  • Rank
    Lance Corporal

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  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
×