-
Content Count
56 -
Joined
-
Last visited
-
Medals
Everything posted by sbondo1234
-
Sure will! I have kind of used switch/case statements before when making an earplugs script, so I kind of understand it but not much.
-
Hello, I have made a list box and added 4 different option in it. Like this: //sg_dialogs.hpp class sg_list_1{ type = 5; idc = 5545; onLoad = [] spawn sg_fnc_openHelp; x = safeZoneX + safeZoneW * 0.343125; y = safeZoneY + safeZoneH * 0.37555556; w = safeZoneW * 0.10375; h = safeZoneH * 0.24; style = 16; colorBackground[] = {0.302,0.302,0.302,0.4683}; colorDisabled[] = {0.302,0.302,0.302,0.4841}; colorSelect[] = {1,1,1,1}; colorText[] = {1,1,1,0.381}; font = "PuristaMedium"; maxHistoryDelay = 0; rowHeight = 0; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1.0}; class ListScrollBar{ color[] = {1,1,1,1}; thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; }; }; //sg_fnc_help.sqf sg_fnc_openHelp = { disableSerialization; lbClear 5545; {lbAdd[5545,_x]} forEach ["Spawn A Vehicle","Gun On Back","Jumping","Earplugs"]; }; //initPlayerLocal.sqf call compile preprocessFile "scripts\sg_dialogs\sg_fnc_help.sqf"; It works and successfully adds the 4 items into the list box. I am having a problem when I try to make it add text to the side of the list box depending on which list box item is selected. I have another function which I am trying to make change the structured text: //sg_fnc_help.sqf sg_fnc_helpInfo = { _selectedLb = lbCurSel 5545; //2001 = idd for dialog. 5545 is idc for structured text. _lbText = ((findDisplay 2001) displayCtrl (5545)); if (_selectedLb == 0) then{ _lbText ctrlSetStructuredText parseText "You have selected Spawn A Vehicle."; }; if (_selectedLb == 1) then{ _lbText ctrlSetStructuredText parseText "You have selected Gun On Back."; }; }; //structured text I am trying to change - sg_dialogs.hpp class sg_spawnVeh{ type = 0; idc = 5546; x = safeZoneX + safeZoneW * 0.52375; y = safeZoneY + safeZoneH * 0.39222223; w = safeZoneW * 0.048125; h = safeZoneH * 0.02444445; style = 0; text = ""; colorBackground[] = {0.302,0.302,0.302,0}; colorText[] = {1,1,1,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); }; I don't get an error, nothing happens when I double click on any list box item. I haven't really used list boxes before today. Some help would be great!
-
Sorry for late reply, was gone doing something but thanks for all the help! Works great! Going to work on making it look nicer now!
-
Sorry, where would I add this? I tried replacing it with _lb ctrlAddEventHandler and it gave some error.
-
@HazJ Thanks for the mission download, I'm not sure what I did wrong but it seemed to fix whatever I did. I Understand this line is changing the structuredText to the name of the List Box Option selected? _text ctrlSetStructuredText parseText format ["%1", _control lbText _selectedIndex]; How would I make it so whenever you clicked on an option I could write in what they see instead of them seeing the name of the option they clicked?
-
My files: //sg_dialogs.hpp class sg_list_1 { type = 5; idc = 5545; onLoad = [] spawn sg_fnc_openHelp; onLBDblClick = [] spawn sg_fnc_helpInfo; x = safeZoneX + safeZoneW * 0.343125; y = safeZoneY + safeZoneH * 0.37555556; w = safeZoneW * 0.10375; h = safeZoneH * 0.24; style = 16; colorBackground[] = {0.302,0.302,0.302,0.4683}; colorDisabled[] = {0.302,0.302,0.302,0.4841}; colorSelect[] = {1,1,1,1}; colorText[] = {1,1,1,0.381}; font = "PuristaMedium"; maxHistoryDelay = 0; rowHeight = 0; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1.0}; class ListScrollBar { color[] = {1,1,1,1}; thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; }; }; class sg_helpInfoText_1:RscStructuredText{ type = 0; idc = 5546; x = safeZoneX + safeZoneW * 0.4675; y = safeZoneY + safeZoneH * 0.38666667; w = safeZoneW * 0.126875; h = safeZoneH * 0.01; style = 0+2; text = "Default Text"; colorBackground[] = {0.9412,0.5843,0.8549,0}; colorText[] = {1,1,1,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 35) * 1); }; }; //initPlayerLocal.sqf call compile preprocessFile "scripts\sg_dialogs\sg_fnc_help.sqf"; //sg_fnc_help.sqf sg_fnc_openHelp = { disableSerialization; lbClear 5545; {lbAdd[5545,_x]} forEach ["Spawn A Vehicle","Gun On Back","Jumping","Earplugs"]; }; sg_fnc_helpInfo = { disableSerialization; private _display = findDisplay 2001; _text = _display displayCtrl 5546; _text ctrlSetStructuredText parseText "You have selected Spawn A Vehicle."; };
-
@HazJ I am really confused then... If it works for you then what could I possibly be doing wrong? I copied your .hpp test code to see if that was the problem and it still didn't work. In fact, I stopped seeing 'Default Text'. I even tried putting my functions in init.sqf instead of its own file but that didn't work either.
-
Tried this and it didn't work... What's wrong? Still no error. _text ctrlCommit 10;
-
I could see it when I changed it to default: class sg_helpInfoText_1:RscStructuredText{ type = 0; idc = 5546; x = safeZoneX + safeZoneW * 0.4675; y = safeZoneY + safeZoneH * 0.38666667; w = safeZoneW * 0.126875; h = safeZoneH * 0.01; style = 0+2; text = "Default Text"; colorBackground[] = {0.9412,0.5843,0.8549,0}; colorText[] = {1,1,1,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 35) * 1); moving = false; }; http://prntscr.com/mtu9s1
-
I copied the RscStructuredText from the drop box and put it in my defines.hpp, and it still didn't work even with disableSerialization on/off. I changed the text to 'Default' and it did show.
-
Sorry, I have just tried it and I still have no idea what is going on. There isn't an error that pops up just nothing happens. Might help if I show you the stuff I have rn: //sg_dialogs.hpp class sg_helpInfoText_1:RscStructuredText{ type = 0; idc = 5546; x = safeZoneX + safeZoneW * 0.4675; y = safeZoneY + safeZoneH * 0.38666667; w = safeZoneW * 0.126875; h = safeZoneH * 0.01; style = 0+2; text = ""; colorBackground[] = {0.9412,0.5843,0.8549,0}; colorText[] = {1,1,1,1}; font = "PuristaMedium"; sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 35) * 1); moving = false; }; //sg_fnc_help.sqf sg_fnc_openHelp = { disableSerialization; lbClear 5545; {lbAdd[5545,_x]} forEach ["Spawn A Vehicle","Gun On Back","Jumping","Earplugs"]; }; sg_fnc_helpInfo = { private _display = findDisplay 2001; _text = _display displayCtrl 5546; // Replace <IDC> with actual number _text ctrlSetStructuredText parseText "You have selected Spawn A Vehicle."; }; Whenever I double click on the option in the list box, nothing happens.
-
That works great, but I think I may have explained myself wrong. I wanted the text to appear in a different box, which I thought that this did. This screenshot might help show what I was trying to do: http://prntscr.com/mtto4b
-
Error Undefined Variable in expression: _display. Not really sure what that means. Hopefully, larrow can help with this too.
-
Should it be something like this: _selectedLb = lbCurSel 5545; _selectedLb lbSetTextRight [_forEachIndex, "You have selected Spawn A Vehicle.", "You have selected Gun On Back."];
-
One question though. What would the index be?
-
Didn't know this existed, but thanks. I will try it out now instead of all of these functions.
-
Counting Kills & Saving to ProfileNamespace
sbondo1234 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I currently have this: //initPlayerLocal.sqf private ["_sg_kills", "_sg_deaths", "_player"]; _player = _this select 2; if (isNil {profileNamespace getVariable "sg_kills"}) then { profileNamespace setVariable ["sg_kills", 0]; }; _lkills = (profileNamespace getVariable "sg_kills"); _player setVariable ["sg_kills", _lkills]; player addMPEventHandler ["MPKilled", {null = execVM "scripts\sg_stats.sqf";}]; So I have created the variable sg_kills and it is set to 0 for newcomers and if you have already played it finds what it is. I can only imagine that this works (please tell if I have gotten something wrong above too). I am having trouble finding out what I would do in my sg_stats.sqf. I have my variable sg_kills and I have tried adding onto it, but it always ends in errors and it not doing what I wanted it to. I tried: //sg_scripts.sqf player addMPEventHandler ["MPKilled" {sg_kills + 1}]; hint format [sg_kills]; Any help with what I should add into the sg_stats.sqf would be very much so appreciated! I am just trying to make it add a kill onto the sg_kills variable and then display a hint after every kill you get. I am using profileNamespace because I want these statistics to save even after the mission ends ( It's a DM game mode ). -
Counting Kills & Saving to ProfileNamespace
sbondo1234 replied to sbondo1234's topic in ARMA 3 - MISSION EDITING & SCRIPTING
//initPlayerLocal.sqf // Check if player has kills saved if (isNil {profileNamespace getVariable "sg_kills"}) then { profileNamespace setVariable ["sg_kills", 0]; }; // Get players current kill count and set to player _sg_kills = profileNamespace getVariable ["sg_kills", 0]; player setVariable ["sg_kills", _sg_kills, true]; // True lets everyone on the server know this variable was updated // Run on all clients in multiplayer when player is killed player addMPEventHandler ["MPKilled", {null = _this execVM "scripts\sg_stats.sqf";}]; // sg_stats.sqf params [["_unitKilled", objNull], ["_killer", objNull]]; // https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPKilled private ["sg_kills"]; // Check if you are the killer if (player isEqualTo _killer) then { // Update kill count _sg_kills = (player getVariable ["sg_kills", 0]) + 1; // 0 is the default value profileNamespace setVariable ["sg_kills", _sg_kills]; // ProfileNamespace cannot use true with setVariable player setVariable ["sg_kills", _sg_kills, true]; // Inform user of kill if (_unitKilled in allUnits) then { hint format["You just killed %1, and now your current kill count is %2", name _unitKilled, _sg_kills]; }; }; // Check if your are the one killed if (player isEqualTo _unitKilled) then { hint "You Are Dead"; }; sg_stats.sqf is called in initPlayerLocal -
Counting Kills & Saving to ProfileNamespace
sbondo1234 replied to sbondo1234's topic in ARMA 3 - MISSION EDITING & SCRIPTING
When I change the variable in sg_stats.sqf I get an error similar to this http://prntscr.com/mpzgt8, but something on line 53 instead. I have also just realised a weird error in intelliJ around this code: // Check if player has kills saved if (isNil {profileNamespace getVariable "sg_kills"}) then { profileNamespace setVariable ["sg_kills", 0]; }; Error: <statement> expected, got ''. I don't know if you can make sense of this, but I have no idea what it is talking about. -
Counting Kills & Saving to ProfileNamespace
sbondo1234 replied to sbondo1234's topic in ARMA 3 - MISSION EDITING & SCRIPTING
nevermind fixed it i forgot this -
Counting Kills & Saving to ProfileNamespace
sbondo1234 replied to sbondo1234's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@NumbNutsJunior Thanks for this... I have put everything where it needs to be to test whether it was working and I got an error as soon as I loaded into the MP game. Error: http://prntscr.com/mpzgt8, I'm not really good at decrypting arma errors, some help would be great. Everything around line 55: // Check if player has kills saved if (isNil {profileNamespace getVariable "sg_kills"}) then { profileNamespace setVariable ["sg_kills", 0]; }; It would be nice if you could explain this line as well: player setVariable ["sg_kills", _sg_kills, true]; // True lets everyone on the server know this variable was updated Does everyone have to know when one person gets a kill, what would happen if this was set to false? -
Difficulty Settings For Missions
sbondo1234 replied to sbondo1234's topic in ARMA 3 - MISSION EDITING & SCRIPTING
still stuck -
I have a mission here and I wanted to know if it was possible to force difficulty settings that people played on. At the moment I haven't changed any difficulty settings and I don't know how you would do so either. So is it possible to change the difficulty settings on the mission and if so how would I go about doing this? I have found this page with all the settings you can change. Not sure how to change them in a mission though.
-
Difficulty Settings For Missions
sbondo1234 replied to sbondo1234's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Nah can't because its gonna be a MP mission so I can't tell when randomers join if they have the correct settings. -
Difficulty Settings For Missions
sbondo1234 replied to sbondo1234's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You cant change difficulty settings in description.ext? From what I see you can only disable certain things like fully disabling GPS'. I want to be able to force difficulty settings like the ones you get with TADST, but for when someone plays SP/without TADST.