Jump to content

Elite IV

Member
  • Content Count

    17
  • Joined

  • Last visited

  • Medals

Community Reputation

2 Neutral

About Elite IV

  • Rank
    Private First Class

Contact Methods

  • Website URL
    http://www.xtgcommunity.net/forums
  • Skype
    xtgcentrelink
  • Google+
    xtgeliteiv
  • Youtube
    xtgeliteiv

Profile Information

  • Gender
    Male
  • Location
    Brisbane, Queensland, Australia
  • Interests
    Arma 3 Scripting / C# Coding / Community Director @ [XtG] - Xtreme Tier Gaming Community AU/NZ

Recent Profile Visitors

752 profile views
  1. Okay thank you, I just wanted to confirm as I'm trying to use data from a global variable that was defined in another addon in the server. Seems I am doing something wrong, but Just wanted to confirm that the scope wasn't limited to just the addon it was defined in. Thanks Tankbuster! Appreciate it
  2. Hello, I am trying to share global variables between addons and want to know how I can achieve this, are they automatically shared in the server ? or will I have to pass it through params by calling a file. I was assuming that addons on the server side would share the same scope but I am not sure. Thank you.
  3. Hello, I can't seem to find any reference that will help me with this, I want to set this "colorBar[]" property/member from CT_PROGRESS class in another script. My goal is to change the bar's color depending on the level it's on, 100 being green, 60 being orange and 30 being red. How can i manipulate colorBar outside of it's class. I found "lbSetColor" and it takes in a param: index which is a number but I don't know if that index number colors colorBar as this might a seperate group / class it's apart of. I have been trying to find reference on this through the wiki but no luck, could someone point my in the right direction? This is my code: #define CONTROL(disp,ctrl) ((findDisplay ##disp) displayCtrl ##ctrl) //in another file that's included around the mission. Thought i would put it here so ya'll can see private _thirstBar = CONTROL(500,513); if (playerThirst > 60) then { _thirstBar lbSetColor [0, [0.9,0,0,1]]; //Green }; Any help would be nice, I am trying to modify "colorBar[]" in a script that's run through a loop in the mission. Probably not the cleanest way but it's the way I know. I just realized upon writing this that lb actually stands for listBox i believe and lbSetColor only manipulates Listbox / CT_LISTBOX and CT_COMBO controls. Which what I am doing is not part of the list boxes lol What command could i use to manipulate the "colorBar[]" property? Thanks everyone. EDIT: i just found this: ctrlSetTextColor Since Arma 3 v1.40 the fill color can be changed via the ctrlSetTextColor command. Prior to Arma 2 there were no means to manipulate a progress bar. Sets text color of given control. Color is in format Color (RGBA). As of Arma 3 v1.40 this command can also be used to change fill-color of a CT_PROGRESS control. I might be on the money here, I'll update the thread with solution if I manage to work it out! still no luck, any help would be nice
  4. Yes, Thanks for your reply. I have done this already - Sorry I didn't post the entire file as the other code above isn't an issue. This is how I've done it: private["_time","_playerPaidBail","_playerEscaped","_playerJailTimeAdjusted","_playerReleasedEarly","_countDown"]; _playerEscaped = false; _playerPaidBail = false; _playerJailTimeAdjusted = false; _playerReleasedEarly = false; So they are defined outside of those loops and switch blocks and are private to the entire file instead of private to that loop The problem still persists. It's very strange that when i use "getVariable" in the conditional statement it just exits the loops and completely ignores the code in the "exitWith" braces and the switch block thats below to.
  5. Hello everyone, I've tried to avoid posting this topic, But I've reached my capabilities in scripting in arma 3. I don't know any other approaches to do this in Arma Scripting. I am still new so any help and pointers are all appreciated and your effort to reply to this post will no go wasted. Thank you. So the issue I am having is that the player has "setVariables" on the player and is adjusted from another player on the server via a listbox dialog via "setVariable" command. Once the player's "jailTimeAdjusted" or "jailReleasedEarly" variable has been set to true from another player on the server, the loop that checks if the variables have changed (conditional statement) exits and no code is executed after the "exitWith" braces or the "switch" block below. When I was debugging this and trying to see where I was at, I added a simple hint with no other code in the exitWith to see if execution goes past that but strangely it does not. I've checked server and client RPT logs, No errors, Even though i was very sure there were no errors I still checked but to my luck, nothing in the rpts were of any help. I've looked up "exitWith" on the scripting wiki and how it's used in loops, It leaves the scope of where it was defined in but will continue the rest of the script (if i reworded that right) but over here it does not seem to do that. What confuses me is that these other conditional statements work, They are checked and return true or false, then they exitWith if true and leaves the loop and executes the rest of the code I want it to in the switch block depending on the case of course ----->> "if (player distance (getMarkerPos "my_marker") > 60)" and "if (my_global_var) exitWith {...};" <<-------- They work in the while loop. But it seems "getVariable" in the conditional statement seems to just not execute code after the exitWith command in the while loop. Maybe it's something to do with how it's being set from the other machine / player ? via the dialog maybe? I added a hint to display the data to see if the variables are set and they indeed are. This is how the variables are set on the player. The first player opens a dialog, selects a player and then either adjusts their prison time or release them from prison. Either way, it'll set the variables accordingly. Then on the other player, when he's in jail - the "while" loop happens for his counter but also monitors his player variables to see if any changes happened, once the changes do happen, the loop exits but no code is executed after. Here is the code for the script function of the dialog: #include "..\..\system\macroDefinitions.hpp" if (!alive player) exitWith {}; _adjustTimeBox = ctrlText 9459; _Characters = toArray (_adjustTimeBox); _allowed = toArray("0123456789"); _letters = false; { if (!(_x in _allowed)) exitWith { _letters = true; }; } forEach _Characters; if (_letters) exitwith { hint "You cannot put letters into the box, only numbers."; }; if (_adjustTimeBox isEqualTo "") exitwith { hint "You need to put a value into the box." }; //Turn the string into integer (number). _adjustTimeBoxValue = parseNumber(_adjustTimeBox); _adjustTimeBoxValue = round _adjustTimeBoxValue; if(_adjustTimeBoxValue < 1 || _adjustTimeBoxValue > 120) exitWith { hint "You can only adjust criminals prison time between 1 - 60 minutes!"; }; //Compile the data of the object that's selected in the dialog. private _currentSelectedPlayer = call compile format["%1",(lbData[8459,(lbCurSel 8459)])]; _currentSelectedPlayer setVariable ["newJailTime", _adjustTimeBoxValue,true]; _currentSelectedPlayer setVariable ["jailTimeAdjusted",true,true]; _ret1 = _currentSelectedPlayer getVariable ["newJailTime",0]; _ret2 = _currentSelectedPlayer getVariable ["jailTimeAdjusted",false]; hint format ["The is CSP: %1 - New Jail Time: %2 Jail Time Adjusted: %3", _currentSelectedPlayer, _ret1, _ret2]; //hint "This feature has not been fully developed yet, should be implemented in the near future."; Here is the code I have for the loop i mentioned before: #include "..\..\script_macros.hpp" private["_time","_playerPaidBail","_playerEscaped","_playerJailTimeAdjusted","_playerReleasedEarly","_countDown"]; params [ ["_ret",[],[[]]], ["_bad",false,[false]], ["_time",15,[0]] ]; _time = time + (_time * 60); if (count _ret > 0) then { life_bail_amount = (_ret select 2); } else { life_bail_amount = 1500; }; _playerEscaped = false; _playerPaidBail = false; _playerJailTimeAdjusted = false; _playerReleasedEarly = false; if(_time <= 0) then { _time = time + (15 * 60); hintC "Please Report to Elite IV: _time var failed to receive a number, 15 minute added by default - fn_jailMe.sqf"; }; [_bad,_time] spawn { life_canpay_bail = false; life_bail_amount = life_bail_amount * 5; if(_this select 0) then { sleep ( (_this select 1) * 0.5 ); } else { sleep ( (_this select 1) * 0.2 ); }; life_canpay_bail = nil; }; while {true} do { if (round(_time - time) > 0) then { _countDown = [(_time - time), "MM:SS"] call BIS_fnc_secondsToString; hintSilent parseText format [(localize "STR_Jail_Time") + "<br/> <t size='2'><t color='#FF0000'>%1</t></t><br/><br/>" + (localize "STR_Jail_Pay") + " %3<br/>" + (localize "STR_Jail_Price") + " $%2", _countDown, [life_bail_amount] call life_fnc_numberText, if (isNil "life_canpay_bail") then {"Yes"} else {"No"}]; }; if (player getVariable ["jailTimeAdjusted",false]) exitWith { _playerJailTimeAdjusted = true; }; if (player getVariable ["jailReleasedEarly",false]) exitWith { _playerReleasedEarly = true; }; if(player distance (getMarkerPos "jail_marker") > 60) exitWith { _playerEscaped = true; }; if(life_bail_paid) exitWith { _playerPaidBail = true; }; if (LIFE_SETTINGS(getNumber,"jail_forceWalk") isEqualTo 1) then { player forceWalk true; }; if((round(_time - time)) < 1) exitWith {hint ""}; if(!alive player && ((round(_time - time)) > 0)) exitWith {}; sleep 1; }; switch (true) do { case (_playerPaidBail): { life_is_arrested = false; life_bail_paid = false; player setVariable ["playerInJail", false,true]; player setVariable ["jailTimeAdjusted", false,true]; hint localize "STR_Jail_Paid"; serv_wanted_remove = [player]; player setPos (getMarkerPos "xtg_jailRelease_SPAWN"); [getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV]; [5] call XTGALRPG_MYSQL_fnc_updatePartial; }; case (_playerEscaped): { life_is_arrested = false; player setVariable ["playerInJail", false,true]; player setVariable ["jailTimeAdjusted", false,true]; hint localize "STR_Jail_EscapeSelf"; [0,"STR_Jail_EscapeNOTF",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT]; [getPlayerUID player,profileName,"D12"] remoteExecCall ["life_fnc_wantedAdd",RSERV]; [5] call XTGALRPG_MYSQL_fnc_updatePartial; }; case (_playerJailTimeAdjusted): { life_is_arrested = false; player setVariable ["playerInJail", false,true]; player setVariable ["jailTimeAdjusted", false,true]; hint ["Your time in prison was adjusted by the government, You're being assigned your new time now..."]; systemChat ["Your time in prison was adjusted by the government, You're being assigned your new time now..."]; [0,"STR_Jail_TimeAdjusted",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT]; [5] call XTGALRPG_MYSQL_fnc_updatePartial; //_newJailTime = player getVariable ["newJailTime",0]; _newJailTime = 60; [player, _newJailTime] call life_fnc_arrestAction; }; case (_playerReleasedEarly): { life_is_arrested = false; player setVariable ["playerInJail", false,true]; player setVariable ["jailReleasedEarly",false,true]; player setVariable ["jailTimeAdjusted", false,true]; hint ["You were released from prison early by the government."]; systemChat ["You were released from prison early by the government."]; [0,"STR_Jail_ReleasedEarly",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT]; player setPos (getMarkerPos "xtg_jailRelease_SPAWN"); [5] call XTGALRPG_MYSQL_fnc_updatePartial; }; case (alive player && !_playerEscaped && !_playerPaidBail): { life_is_arrested = false; player setVariable ["playerInJail", false,true]; player setVariable ["jailTimeAdjusted", false,true]; hint localize "STR_Jail_Released"; [getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV]; player setPos (getMarkerPos "xtg_jailRelease_SPAWN"); [5] call XTGALRPG_MYSQL_fnc_updatePartial; }; }; player forceWalk false;
  6. Thank you, I'll actually take a look at this after work.
  7. It was a MX series gun, It was equipped on the player when I was using the debug console. Also when I do: (primaryWeapon player) BIS_fnc_compatibleItems I get the list of array of compatible items for weapon. So far I am just using that command as a fix but I would like to maintain Tonic's code as there was nothing wrong with it until recently. You go into debug console and type in: hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems")); with any weapon you choose and it will always return empty and if you try to use it as a condition with "isArray" - it will always return false as if there isn't an array that exists when compatibleItems function is called.
  8. Hello everyone, I was just wondering if anyone knew if the developers changed anything in CfgWeapons. (isArray (configFile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems")) This returns false in the debug console, I swear it never returned false before? This still returns true so I'm glad that's okay but can anyone tell me if anything has changed in the CfgWeapons? (isClass (configFile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo")) I'm still learning too so any help or pointers will be very appreciative. Here is the reason why i need isArray to return true: as you can see the condition is that the code will proceed if "CfgWeapons >> THE WEAPON >> "WeaponSlotsInfo" >> SLOT >> "compatibleItems" returns true but because when i debug console this - It always returns empty array and false. Hench I cannot get the data I need. A temporary fix i did was use the "BIS_fnc_compatibleItems" and stored those returned results into a local var then used later on and works but I want to get to the bottom of the actual issue i am faced with. if (isArray (configFile >> "CfgWeapons" >> _item >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems")) then { _slotArray = FETCH_CONFIG3(getArray,"CfgWeapons",_item,"WeaponSlotsInfo","CowsSlot","compatibleItems"); { _itemArray pushBack _x; } forEach _slotArray; }; so "isArray" is always going to return false now because when i went into the debug console and used "getArray" it always returned empty "[]" 😞 I tried: hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems")); hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems")); hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems")); They all return empty now. What's changed? I've had a look here and can't seem to see anything: CfgWeapons Config Reference - Bohemia Interactive Community (bistudio.com) I did see this note in the website link just above saying this: Moved to each weapon? So how will i pull the information I need now? What do i do to get that information from the weapon?
  9. Hey guys, I know this probably far stretch but I don't see this as impossible at all. Pretty sure it can be done but wanted to know if there were any other ways. So my idea (because my mission has so many damn markers and it gets messy when you zoom out...) I want to give my players the ability to toggle map markers of a sort on/off. I was thinking as I don't think there are any specific functions to show/hide user defined map editor map markers, How about instead of me placing map markers on the map, I just spawn them via code on the mission init in arrays and manipulate those arrays later? I feel like it'll get messy. I'll need the coordinates of every map marker then on Show it'll spawn the markers and on Hide it'll delete them. (This will hopefully be client sided? Still learning - I feel like this will effect whole server).\ By default when the player loads into server, I'll spawn the map markers via init then later when a player clicks on a button via some dialog that i'll create later it will manipulate the arrays accordingly. If hide is clicked it'll delete a specific array / group of map markers on the map or if show is clicked then it'll spawn them on map but I'll add a check to see if markers are already on the map ( !(isNull) ?? if they exist). Would there be better way of doing this? Point me in right direction would be much appreciated. I don't have any code to show yet, Would just like to know how would you guys approach this? Am i on the right path?
  10. Oh my lord.. Hah, Control is a "macro" that I think tonic or the new developers of altis life rpg created. I used their snippet. ----------> #define CONTROL(disp,ctrl) ((findDisplay ##disp) displayCtrl ##ctrl) the "macro.h" wasn't included into the script as I thought "CONTROL" was a arma 3 engine command. Still learning. Thank you, appreciate that. It probably showed up in the RPTs as well I just did not think about "CONTROL" being user defined. I didn't have to use ctrlSetStructuredText but I'll learn that one as I do see it in other dialogs so thanks for that. Thank you. It's working now. 🙂
  11. Sorry yes I realized after I read my topic. I edited my topic with the code i am trying to use. MP
  12. Hello everyone, I am having some trouble navigating the wiki sqf for displaying a global variable in a dialog. What is the method for doing this? I've tried searching for any topics relating to this but cannot find. ignore all the disgusting capital prefixes. I use it to help distinguish my code in another framework (Tonic's Altis Life RPG) as I've been modifying it to the likes of my community. onButtonClick = "[] spawn XTGALRPG_FARMING_SKILL_fnc_loadSkillStats;"; - player clicks button - opens this script createDialog "XTGALRPG_SKILLING_INTERFACE"; _farmingLevel = playerFarmingExpLevel; (CONTROL(5374,537447)) ctrlSetText format [(localize "STR_skilling_farmingLevel")+ " $%1",[_farmingLevel] call life_fnc_numberText]; first param in control is set to my dialog and the second is the idd of the text box i created in adc. Prior to this code i created a local var to represent a global variable value to then be displayed and formatted with numberText function that was already in framework. What am i missing? Am i meant to initialize something else these changes to take place? I open the dialog and nothing has changed. I just want to show a number in a dialog pulled from global var.
  13. Hey everyone, i know some objects belong to "House_F" like Land_Dome_Big_F Land_Medevac_house_V1_F Land_Medevac_HQ_V1_F Land_Research_house_V1_F what does Back Alley Wire Fence (Gate) Land_BackAlley_01_l_gate_F belong to ? Does anyone know? Thanks guys.
  14. Hey everyone, Can anyone tell me what this means or link me to something please so i can understand 🙂 I have a spawned ammo pallet that connects to an interface (dialog), when a player interacts with it, the client side RPT spams "WARNING: Function 'name' - ... has no unit" How do i go about fixing this? Thank you so much guys.
  15. Try shoving this into "init.sqf" ? [] execVM "briefing.sqf";
×