Jump to content

cuel

Member
  • Content Count

    1592
  • Joined

  • Last visited

  • Medals

Everything posted by cuel

  1. An API function was added so that other spectator systems can call ACRE API if they block keybind events. In this case, to mute other spectators.
  2. It's a better version of BIS_fnc_param, and yes it declares them. There's no reason to use _this select anymore
  3. You could introduce some bugs doing by removing all EHs (e.g mods). I'd suggest just checking if the unit is alive before doing anything.
  4. initPlayerLocal assures that the player object exists so he most certainly is spawned. Either do waitUntil {time > 0}; // mission has started Or set a publicVariable on the server and wait for that on the clients
  5. No, everyone runs init fields. Including JIP @OP I suggest you upload your server .rpt to pastebin and share it here
  6. https://community.bistudio.com/wiki/Code_Optimisation#Threads SQF has scheduled and non-scheduled environments. Non-scheduled can not "suspend", e.g use waitUntil, sleep, uiSleep.
  7. Destroy the towns when needed (player approaches). Don't destroy them all at once
  8. I don't get the second code snippet at all. You set index to 1 and then the if will always be true and you only do setCtrlText on 66311. Besides the 1st snippet just clears the text while the 2nd snippet sets the control text to a .paa so yeah I'd expect it to be slower
  9. https://community.bistudio.com/wiki/allowDamage Note the "AL" icon, The thing you're executing it on has to be local, in your example you're using player, which is the current "player" object on each client. Player object is always local (for each client, on a dedicated it does not exist - objNull). Note the "EG" icon, that means that it's broadcasted, so no, you would not have to execute it on every machine. You should post the script and how it's called
  10. "local player" is true on every client, you only want the client that gets the loadout to run the script params ["_unit", "_loadout"]; if (!hasInterface) exitWith {}; waitUntil {!isNull player}; if (!local _unit) exitWith {};
  11. NetStats=0; in your server difficulty https://community.bistudio.com/wiki/server.armaprofile
  12. Not really, select is used to filter array elements, while apply is normally used to transform the array elements into something else. Select can return less elements while apply will ways return the same amount of elements What I wrote can be explained like this _plrs = allPlayers; _alivePlrs = _plrs select {alive _x}; // we filter out dead players. the resulting array can be smaller _alivePlrsUID = _alivePlrs apply {getPlayerUID _x}; // returns an array of playerUids for each element in the _alivePlrs
  13. Apply is inherited from a concept in functional programming, namely functor. Normally it's called map Or in SQF "it takes an array and code, applies code to each element and returns a new array" E.g _playerUIDS = allPlayers apply {getPlayerUID _x}; // ["12345"; "54321"] It can also be chained which is where it's real power comes in, in combination with select (which is often called filter in programming languages) _alivePlayersUID = allPlayers select {alive _x} apply {getPlayerUID _x}; // apply {} select {} apply {}; This can be done indefinitely. So no, apply is not like forEach and count. If you're not interested in the resulting array, use count or forEach
  14. All bis_fnc_taskPatrol does it to create a few random waypoints. while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); }; Should do the trick.
  15. Well not really, it's more AI related. It increases the knowsAbout value, read more here https://community.bistudio.com/wiki/knowsAbout esp. the comments
  16. That example "reveals" the current object under the cursor on the client. The reveal increases the knowsAbout value, which it what make AI see / know about each other. And essentially go into combat
  17. Yes. It is a local command. On a dedicated server it will return objNull. But it doesn't have a interface so the GUI is useless there anyway
  18. So all I had to do was remove the repository (settings) in A3S and add it back again, same settings., Then it worked. Edit: christ why is there no auto-merge on posts
  19. If I remove everything and just put an empty folder with a few files inside \addons, it works fine. (Like you did). Moving the files back and it doesn't work, 550 error
×