Jump to content

_Winters_

Member
  • Content Count

    6
  • Joined

  • Last visited

  • Medals

Everything posted by _Winters_

  1. As the title implies, I am trying to get data from a RscXListBox. I have done a lot of googling to no avail.. The RscXListBox displays fine and allows me to page through the different selections I add with lbAdd fine, but I can't seem to select anything.. I have code that works with RscListBox and it gets the data fine, but with RscXListBox I always get -1 (no selection) returned when I use lbCurSel Does lbCurSel not work with RscListBox? I wanted to use RscXListBox because it is only one list element high and looks cleaner on the dialog.. but if someone has a working example of RscListBox which displays on one vertical line i'm open to using that instead. Anyhow here is my define.. class RscXListBox { access = 0; idc = CT_XLISTBOX; type = CT_XLISTBOX; style = SL_HORZ + ST_CENTER + LB_TEXTURES; default = 0; blinkingPeriod = 0; x = 12 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; y = 17 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; w = 10 * GUI_GRID_CENTER_W; h = 1 * GUI_GRID_CENTER_H; color[] = {1,1,1,1}; colorActive[] = {1,1,1,1}; sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; font = "PuristaMedium"; shadow = 0; colorText[] = {1,1,1,1}; // Text color colorSelect[] = {0,1,1,1}; // Selected text color colorDisabled[] = {1,1,1,0.5}; // Disabled text color tooltip = ""; // Tooltip text tooltipColorShade[] = {0,0,0,0}; // Tooltip background color tooltipColorText[] = {1,1,1,0}; // Tooltip text color tooltipColorBox[] = {1,1,1,0}; // Tooltip frame color arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa"; // Arrow arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa"; // Arrow when clicked on border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa"; // Fill texture soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1}; }; Here is my definition from my dialogs file.. class clsOptionsHelicopterListbox: RscXListBox { access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified) idc = 1500; style = SL_HORZ + ST_CENTER + LB_TEXTURES; // Style x = 0.304062 * safezoneW + safezoneX; y = 0.698 * safezoneH + safezoneY; w = 0.139219 * safezoneW; h = 0.022 * safezoneH; onLBListSelChanged="hint str ['onLBSelChanged',_this]; false"; }; here is the code I use to load it when the dialog is initialized.. _HelicopterListbox = _dialog_control displayCtrl 1500; hl_0 = _HelicopterListbox lbAdd "MH-9 Hummingbird"; hl_1 = _HelicopterListbox lbAdd "UH-80 Ghost Hawk"; hl_2 = _HelicopterListbox lbAdd "CH-67 Huron"; hl_3 = _HelicopterListbox lbAdd "V-44 X Blackfish"; hl_4 = _HelicopterListbox lbAdd "AH-99 Blackfoot"; hl_5 = _HelicopterListbox lbAdd "Mi-290 Taru"; hl_6 = _HelicopterListbox lbAdd "PO-30 Orca"; hl_7 = _HelicopterListbox lbAdd "Mi-48 Kajman"; hl_8 = _HelicopterListbox lbAdd "WY-55 Hellcat"; hl_9 = _HelicopterListbox lbAdd "CH-49 Mohawk"; lbSetCurSel [1500, hl_0]; And Finally here is the code I am using to try and get the value from it when the user hits ok on the dialog.. _HelicopterListBoxIndex = lbCurSel 1500; hint format["_HelicopterListBoxIndex = %1",_HelicopterListBoxIndex]; I currently always get -1 .. grr any help would really be appreciated..
  2. _Winters_

    Malden Flight Training

    After playing lots of KOTH on C4G's Infantry No Towers server, and not wanting to crash helicopters in MP, I created a map for learning to fly on Malden based off the KOTH maps. This is the first thing I have made for Arma 3, but I dove in on scripting and think it came out very good, although i'm really hoping for some feedback. It allows the player to select 3 Zones to fly to (La Trinite, Le Port, Chapoi), each allowing the choice of spawnpoints for BLUFOR, OPFOR, and Independant, so 9 Spawnpoints in all. The player is offered an extra action on the scroll menu to respawn at base and to choose options at any time. In the unfortunate event you crash the helicopter, it 'respawns' you back at the base with a new helicopter. It allows the player to choose to have enemies active in town or not, and allows practicing 9 different types of helicopter plus the Blackfish. With Enemies set to 'on' it spawns 10 different squads consisting of 5 riflemen and one AA rifleman with a rocket. The AI are on opposing sides so they fight among one another as well as attacking the incoming helicopter which makes it seem more like a real KOTH match. As it is for practicing flying helicopters and landing in the KOTH zone there is no defined mission per se, however if you think of it like KOTH you know you have to land in the Zone. It has a distance to the center of the zone marker to indicate distance to the zone center at all times. Anyhow there is a link below, if you read this and try it, I hope you like it, and would love to hear any feedback. Malden Flight Training on Steam Workshop
  3. OK well I should specify.. it didn't let me 'figure it out' so much as it is an effective workaround to whatever was causing my issue. I still have no idea why it wasn't working but this works and I really needed to make those eventhandlers anyhow for the next part of what I am doing which is updating pictures in the dialog based on the users selections. Thanks for the reply anyhow though I do appreciate it.
  4. When looking into how to get a picture to update based on a listbox, I found something that led me to figure it out.. In case this helps anyone else.. I will leave this here.. still no idea why I added the following to my file that initializes my dialog.. HelicopterListbox ctrlSetEventHandler ["LBSelChanged", "[_this] ExecVM 'scripts\XListBoxHandler.sqf'"]; like this.. HelicopterListbox = _dialog_control displayCtrl 1500; hl_0 = _HelicopterListbox lbAdd "MH-9 Hummingbird"; hl_1 = _HelicopterListbox lbAdd "UH-80 Ghost Hawk"; hl_2 = _HelicopterListbox lbAdd "CH-67 Huron"; hl_3 = _HelicopterListbox lbAdd "V-44 X Blackfish"; hl_4 = _HelicopterListbox lbAdd "AH-99 Blackfoot"; hl_5 = _HelicopterListbox lbAdd "Mi-290 Taru"; hl_6 = _HelicopterListbox lbAdd "PO-30 Orca"; hl_7 = _HelicopterListbox lbAdd "Mi-48 Kajman"; hl_8 = _HelicopterListbox lbAdd "WY-55 Hellcat"; hl_9 = _HelicopterListbox lbAdd "CH-49 Mohawk"; lbSetCurSel [1500, hl_0]; HelicopterListbox ctrlSetEventHandler ["LBSelChanged", "[_this] ExecVM 'scripts\XListBoxHandler.sqf'"]; Now whenever the value changes in the xlistbox it fires off the event which includes the control, and the selected index then in my new file XListBoxHandler.sqf which handles the event I have the following. In this example I only show one control, but I am using this with multiple controls by just adding new cases to the select statement. ------------------------------------------------------------------------------------- _control = (_this select 0) select 0; _index = (_this select 0) select 1; _dialog_control = findDisplay 2018; HelicopterListbox = _dialog_control displayCtrl 1500; switch (_control) do { case HelicopterListbox: { gHeliNum = _index; }; };
  5. I am attempting to create a single player scenario similar to several helicopter training scenarios I have seen, full disclosure, this is the first scenario I have attempted. I realize this is kind of diving in head first. I do have extensive computer programming experience and have modded other games in the past, but attempting to get a grasp on the whole structure and variety of commands has me feeling pretty far out of my depth. I want to have the target indicated on the map, and also onscreen with a distance to the objective. I am not sure if I am missing something simple, but I can't seem to figure out what this functionality would be called, so even searching for it has been difficult. So far I have tried setting a waypoint, creating and assigning a task , and using drawicon3d to draw text at the location. None of these really functioned as desired. I used the following in my init.sqf for the waypoint, I have my player_character named helo_pilot way1 = (group helo_pilot) addWaypoint [[7283.0,7917.0,167.6], 0]; way1 setWaypointType "MOVE"; way1 setWaypointBehaviour "aware"; way1 setWaypointCombatMode "yellow"; way1 setWaypointDescription "Helicopter Training."; way1 setWaypointSpeed "FULL"; way1 setWaypointCompletionRadius 100; The result is the waypoint shows up on the map, but nothing shows up on screen in game - i'm not sure if this is due to my missing something or not. For the task I tried.. _currentTask = player createSimpleTask ["La Trinte"]; _currentTask setSimpleTaskDestination ([7283.0,7917.0,167.6]); _currentTask setTaskState "ASSIGNED"; The task shows the task as assigned and at the correct location, but doesn't show on screen when in game. And finally for drawicon3d I tried .. addMissionEventHandler ["Draw3D", { drawIcon3D ["", [1,1,0,1], [7283.0,7917.0,167.6], 0, 0, 0, "Objective", 1, 0.05, "PuristaMedium"]; }]; It does show my text in game, but it is static at the position, whereas the direction / distance thing i'm looking to have follows the edge of the screen like the koth zone marker does. Anyhow, I was really hoping someone could point me in the right direction since I haven't been able to find this on my own and i'm beginning to question my sanity at this point.
  6. Thanks so much to both of you for the help, I tried both methods. I ended up with the following .. addMissionEventHandler ["Draw3D", { _pos = [7283.0,7917.0,167.6]; _distance_meters = round (player distance _pos); _distance_kilometers = floor (_distance_meters / 1000); _distance_meters_left = _distance_meters - (_distance_kilometers * 1000); _distance_hectometers = round (_distance_meters_left / 100); drawIcon3D ["", [1,1,0,1], _pos, 1, 1, 0, format ["%1.%2km",_distance_kilometers,_distance_hectometers], 2, 0.03, "PuristaMedium","center",true]; }]; I didn't need to to target an object so I used a static position - at some point this will be pulled from a list of locations, but for now one location worked fine for testing. I got the task working but couldn't get it to show up on screen, just the map. The first method is more in line with what I needed anyhow since this is a general marker for where to fly to and I will have a area trigger there that creates a task. So now that I have that working - any idea if its possible to use the game asset for the default task as the icon?
×