Jump to content

alleycat

Member
  • Content Count

    1003
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by alleycat

  1. Thanks for the tip. BIS_fnc_objectSide works, it checks the side the player is before any dynamic change.
  2. How can I check if a variable is <null>? Because when I updated my script to write more variables on an existing entry my array looked like this: _SP_PLAYER_="["cat",0,<null>,<null>]" Because that entry already existed in my database, and the array was small and had only 2 entries instead of 4. Which caused a division by zero error. I would like to add in a check for <null> to prevent that.
  3. I have an array of strings (items) that I would like to print in a coherent text with a linebreak. This is easy to do in diag_log text but not for diary records or dialogs. array = ["item1","item1","item1","item1","item1"]; If I just print it out in any known game format it ends up like that. If I use { diag_log text _x; } forEach array; I get a new line of text for each entry, but only for console log. Is it possible to build a string like this that can be used in parse text? https://community.bistudio.com/wiki/composeTextlooks interesting but I am not sure how to modify the syntax to iterate through a loop.
  4. Thanks. A lot. I was trying to figure that out for two weeks.
  5. Placed an UGV as a blufor UAV operator with a script, but it still has to be "hacked" to be accessible. Why, the unit and drone are already blufor. _veh = createVehicle ["B_UGV_01_rcws_F", getpos _caller, [], 5, "NONE"];
  6. Thanks, I should be more attentive to return vaues.
  7. Wait, I see you added the possibility to use custom return values. I will just give a non existing entry the default return of -1. That should fix it I hope. EDIT, yes return value array then it works. To repeat my other question. When I write a section (player id) do I have to write the whole array or can I just manipulate one entry of the array? and if so, can I add new elements to the array? Example. I track player kills. So the array has 2 entries, name and kills. If I want to add in a deaths element, does that work? or do I have to consider that early in the creation _return = ["write", ["playerstats", _id, [_name,_missions]]] call _inidbi; 1.Can I adress only _missions and leave out _name?
  8. So I have to check whether the return variable is a boolean or an array without breaking the script.
  9. Not sure where to use that. The problem I have is that I need a check whether a section exists. The code with !_retrieved_id works the first time a new player connects(when no entry exists). But the script breaks because it expects a bool, which it is not if it finds something. So, not really sure where to put your example for it to work. Here is the script with attempting your fix. It is a initplayerserver.sqf _playerobject = _this select 0; _isjip = _this select 1; systemchat format ["_playerobject: %1 | _isjip: %2", _playerobject, _isjip]; //return_value = function; _inidbi = ["new", "stat_0001"] call OO_INIDBI; _id = getplayeruid _playerobject; _name = name _playerobject; //attempt to get player UID from database //_retrieved_id = ["read", ["playerstats", _id]] call _inidbi; _retrieved_id = ["read", ["playerstats", _id, false]] call _inidbi; //check if id exists in database if (!_retrieved_id) then { _missions = 0; systemchat format ["_retrieved_id does not exist. Creating entry UID: %1", _id]; _return = ["write", ["playerstats", _id, [_name,_missions]]] call _inidbi; systemchat format ["Write successful? %1", _return]; } else { systemchat "_retrieved_id exists"; }; //get UID again //_retrieved_id = ["read", ["playerstats", _id]] call _inidbi; _retrieved_id = ["read", ["playerstats", _id, false]] call _inidbi; if (_retrieved_id) then { _retrieved_missions = _retrieved_id select 1; systemchat format ["_retrieved_missions: %1", _retrieved_missions]; _retrieved_missions = _retrieved_missions +1; _return = ["write", ["playerstats", _id, [_name,_missions]]] call _inidbi; systemchat format ["Write successful? %1", _return]; };
  10. Can remoteexec be used as a client on a server without admin rights? For example. if I start a script: "hello" remoteExec ["hint"]; will that broadcast on all clients it the script is run on a non-admin client?
  11. Thanks for the example. Another question. If I only define _id and _name for a player, but later add other entries like deaths, will that work? or do I have to establish the array of all possible variables I want to write when creating the section? 2. How to check if an entry exists? !_retrieved_id does only work if the read-attempt does not find anything because its a boolean false. But if I check and find something then !_retrieved_id is not a boolean anymore and breaks script //return_value = function; _inidbi = ["new", "stat_0001"] call OO_INIDBI; _id = getplayeruid _playerobject; _name = name _playerobject; //attempt to get player UID from database _retrieved_id = ["read", ["playerstats", _id]] call _inidbi; //check if id exists in database if (!_retrieved_id) then { _missions = 0; systemchat format ["_retrieved_id does not exist. Creating entry UID: %1", _id]; _return = ["write", ["playerstats", _id, [_name,_missions]]] call _inidbi; systemchat format ["Write successful? %1", _return]; } else { systemchat "_retrieved_id exists"; }; //get UID again _retrieved_id = ["read", ["playerstats", _id]] call _inidbi; if (_retrieved_id) then { _retrieved_missions = _retrieved_id select 1; systemchat format ["_retrieved_missions: %1", _retrieved_missions]; _retrieved_missions = _retrieved_missions +1; _return = ["write", ["playerstats", _id, [_name,_missions]]] call _inidbi; systemchat format ["Write successful? %1", _return]; };
  12. I would like to add a new question: _vehicle = createVehicleCrew (createVehicle ["I_UAV_02_CAS_F",_pos, [], 1, "NONE"]);_vehicle flyinheight 300; Produces error about _vehicle being unknown.
  13. This is the most useful script command since 2001
  14. I think there is a major bug in the eden mission editor. Out of the blue, I started the mission in the editor. The game reported error: no curator synced to gamemaster mission module But everything was synced and has been so for weeks. So I removed all traces of Zeus modules. Starting the mission in SP editor mode, player gets stuck in a bird's view looking down, like on a bugged zeus mode. Only by right click -> play as character it works normally. However it gets even weirder. If I manage to load into the mission normally, some markers refuse to appear, and addactions on objects do not exist. It feels like a zeus mission desyncing, but in eden. I think some bug is corrupting sqm files. All on stable branch. I have double checked all the scripts, but nothing could have caused it. Also rpt log looks normal. EDIT: Narrowed the problem down to having deleted marker variable names. The game gives each placed marker a default name like "marker3453". I deleted some variable names. Appears the game does break missions when there are markers without variable names
  15. { _id = getplayeruid _x; ["write", ["players", "id", _id]] call _inidbi; _id = ["read", ["players", "id"]] call _inidbi; _id remoteExec ["systemchat"]; } foreach playableunits; This works for me, it saves the players id and reads it to systemchat. But what if I want to have an array containing different player variables? Does not, I accidently used same _id variable so it looked like it was working. { _id = getplayeruid _x; _name = name _x; ["write", ["playerstats", "id", [_id,_name]]] call _inidbi; _id = ["read", ["playerstats", "id"]] call _inidbi; _id remoteExec ["systemchat"]; } foreach playableunits; This does not work, nothing gets to systemchat. Works on MP, but only with one variable. How do I save an array per key? Also am I doing this right? If I want to save player stats like so section = playerstats unique_id = key array of player variables = value 2. Where do I find the database on my HD to manually edit it? 3. Can we get an example of how it is supposed to work?
  16. I dont like the new font, it appears to have no antialiasing although I have MSAA on an ultra setting. But the letters are still jagged. Is that a known bug or intended to look like this?
  17. Created an addaction to spawn a remote designator, but the script ignores my check for player side. It compiles but never places the right one. onMapSingleClick " global_pos=_pos; if (alive player) then { _vehicle = ""O_Static_Designator_02_F""; if ((side player) == east) then {_vehicle = ""O_Static_Designator_02_F""}; if ((side player) == resistance) then {_vehicle = ""I_Static_Designator_02_F""}; if ((side player) == west) then {_vehicle = ""B_Static_Designator_02_F""}; _posmk = getmarkerpos ""strat_circle_target""; _distance = _posmk distance _pos; if (_distance < _limit) then { player setpos _pos; hint format [""Placing remote designator \nDistance:%1"", _distance]; createVehicleCrew (createVehicle [_vehicle, getpos player, [], 5, ""NONE""]); completed = 1; } else { hint format [""Placing failed.\n\nLocation not inside the combat zone.\nDistance:%1"", _distance]; }; openMap false; finished = true; }; true "; waitUntil {finished}; onMapSingleClick '';
  18. Trying to use description.ext parameters to control wether an object appears in the mission. So far I got this: description.ext: (params) class Defender { title = "Defending side"; values[] = {0,1,2}; texts[] = {"CSAT","AAF","NATO"}; default = 0; }; Then I tried in the presence condition: (paramsArray select 2 == 0) Did not work. Then I thought perhaps things intitialized in the editor might have issues with params so I wrote in the initserver.sqf def_csat = false; def_aaf = false; def_nato = false; if (paramsArray select 2 == 0) then { def_csat = true; }; Then in the presence condition: def_csat Did not work. What am I doing wrong?
  19. Thanks for the tip, it appears to work in MP. About your script, how does one call and use it?
  20. alleycat

    POOK CAMONETS

    The instructions are confusing me. - Vehicle script usage: 1. Add these lines to the vehicle's init line in the editor: this setVariable ["vehicle_camonetDeployed", false, true]; this addAction ["Deploy Camo Net", "camonetvehicle.sqf", ["Deploy"], 51, false, true, "", "!(_target getVariable 'vehicle_camonetDeployed')"]; this addAction ["Stow Camo Net", "camonetvehicle.sqf", ["Stow"], 50, false, true, "", "(_target getVariable 'vehicle_camonetDeployed')"]; 2. Edit the THREE (3) lines marked in the script with any other type of net you desire. Use the net types listed at the bottom of this readme document. 3. Save and copy the script into the mission folder. what 3 lines in what script?
  21. Also tried hideobjectglobal, but that completely does not work at all: strat_csat_a hideObjectGlobal true; it can not find the object, but it is there.
  22. I would like to send debug messages from the server that only a logged in admin player can see. https://community.bistudio.com/wiki/remoteExecis useful for sending messages, but I have not found an elegant way to filter for admin clients on the server side. I think I could have the server force a client to runa script on the client which then filters for admins, but that seems not smooth. I would like to filter out whether a player is an admin on the server
  23. alleycat

    [R3F] Logistics

    I have followed this guide but a specific object I blacklisted is still showing. This is in my config_creation_factory.sqf R3F_LOG_CF_blacklist_objects = [ "Land_HBarrierWall_corridor_F" ];
×