Jump to content
Sign in to follow this  
Bon

interactive dialog control

Recommended Posts

Hi Folks, and a happy new year.

To my question:

Someone can explain to me how I can create an interactive dialog, i.e. with controls I can type in text?

This is already done in the sight adjustment of the ACE2 mod, unfortunately I can't find the corresponding .hpp file where this dialog is defined.

My intention is to make artillery calls a bit more realistic. So far every fire artillery request system I saw basically consists of simply clicking on the map to set where the shells shall go down.

In my further missions I would like to have an interface where you instead have to insert your current grid coordinates (and subgrid coordinates), direction in degrees and distance to splashdown area, but for that I definitely need to open a dialog where I can write into a kind of text field.

Share this post


Link to post
Share on other sites

Ok nevermind,

found out that I was looking for control type "CT_EDIT", that does the trick.

Sorry for that, am not very experienced in UI scripting yet.

Share this post


Link to post
Share on other sites

I have a question about MAP control. On wiki there's only one example (even with 2 errors with missing [] after arrays in code) and No other word how to use it. And there's also an error about colorOutside (or something like that). (They must have a very good sence of humor and think, we can guess other thing about map control from air???)

1. How to make it working?

2. How to change zoom and current map center position by a script?

---------- Post added at 03:16 ---------- Previous post was at 02:54 ----------

have found something. this makes map working. but question number 2 is still not solved...

class RscMapControl 
{ 
access = 0; 
idc = -1; 
type = CT_MAP_MAIN; 
style = ST_PICTURE; 
x = 0.10; y = 0.10; w = 0.80; h = 0.60; 
colorBackground[] = {1.00, 1.00, 1.00, 1.00}; 
colorText[] = {0.00, 0.00, 0.00, 1.00}; 
colorSea[] = {0.56, 0.80, 0.98, 0.50}; 
colorForest[] = {0.60, 0.80, 0.20, 0.50}; 
colorRocks[] = {0.50, 0.50, 0.50, 0.50}; 
colorCountlines[] = {0.65, 0.45, 0.27, 0.50}; 
colorMainCountlines[] = {0.65, 0.45, 0.27, 1.00}; 
colorCountlinesWater[] = {0.00, 0.53, 1.00, 0.50}; 
colorMainCountlinesWater[] = {0.00, 0.53, 1.00, 1.00}; 
colorForestBorder[] = {0.40, 0.80, 0.00, 1.00}; 
colorRocksBorder[] = {0.50, 0.50, 0.50, 1.00}; 
colorPowerLines[] = {0.00, 0.00, 0.00, 1.00}; 
colorNames[] = {0.00, 0.00, 0.00, 1.00}; 
colorInactive[] = {1.00, 1.00, 1.00, 0.50}; 
colorLevels[] = {0.00, 0.00, 0.00, 1.00}; 
font = "TahomaB"; sizeEx = 0.040000; 
fontLabel = "TahomaB"; sizeExLabel = 0.02; 
fontGrid = "TahomaB"; sizeExGrid = 0.02; 
fontUnits = "TahomaB"; sizeExUnits = 0.02; 
fontNames = "TahomaB"; sizeExNames = 0.02; 
fontInfo = "TahomaB"; sizeExInfo = 0.02; 
fontLevel = "TahomaB"; sizeExLevel = 0.02; 
stickX[] = {0.20, {"Gamma", 1.00, 1.50} }; 
stickY[] = {0.20, {"Gamma", 1.00, 1.50} }; 
ptsPerSquareSea = 6; 
ptsPerSquareTxt = 8; 
ptsPerSquareCLn = 8; 
ptsPerSquareExp = 8; 
ptsPerSquareCost = 8; 
ptsPerSquareFor = "4.0f"; 
ptsPerSquareForEdge = "10.0f"; 
ptsPerSquareRoad = 2; 
ptsPerSquareObj = 10; 
text = "\ca\ui\data\map_background2_co.paa"; 
showCountourInterval=2; 
scaleDefault = 0.1; 
onMouseButtonClick = ""; 
onMouseButtonDblClick = ""; 

colorOutside[] = {0,0,0,1 };
colorRailWay[] = {0.800000,0.200000,0,1 };
maxSatelliteAlpha = 1.0;
alphaFadeStartScale = 0.150000;
alphaFadeEndScale = 0.290000;

class ActiveMarker 
{ 
	color[] = {0.30, 0.10, 0.90, 1.00}; 
	size = 50; 
}; 

class Task  {
	icon = "\ca\ui\data\ui_taskstate_current_CA.paa";
	iconCreated = "\ca\ui\data\ui_taskstate_new_CA.paa";
	iconCanceled = "#(argb,8,8,3)color(0,0,0,0)";
	iconDone = "\ca\ui\data\ui_taskstate_done_CA.paa";
	iconFailed = "\ca\ui\data\ui_taskstate_failed_CA.paa";
	color[] = {0.863000,0.584000,0.000000,1 };
	colorCreated[] = {0.950000,0.950000,0.950000,1 };
	colorCanceled[] = {0.606000,0.606000,0.606000,1 };
	colorDone[] = {0.424000,0.651000,0.247000,1 };
	colorFailed[] = {0.706000,0.074500,0.019600,1 };
	size = 27;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
};

class CustomMark  {
	icon = "\ca\ui\data\map_waypoint_ca.paa";
	color[] = {0.647100,0.670600,0.623500,1.000000 };
	size = 18;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
};

class Bunker { icon = "\ca\ui\data\map_bunker_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 14; importance = "1.5 * 14 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class Bush { icon = "\ca\ui\data\map_bush_ca.paa"; color[] = {0.55, 0.64, 0.43, 1.00}; size = 14; importance = "0.2 * 14 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class BusStop { icon = "\ca\ui\data\map_busstop_ca.paa"; color[] = {0.00, 0.00, 1.00, 1.00}; size = 10; importance = "1 * 10 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class Command { icon = "#(argb,8,8,3)color(1,1,1,1)"; color[] = {0.00, 0.00, 0.00, 1.00}; size = 18; importance = 1.00; coefMin = 1.00; coefMax = 1.00; }; 
class Cross { icon = "\ca\ui\data\map_cross_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 16; importance = "0.7 * 16 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class Fortress { icon = "\ca\ui\data\map_bunker_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 16; importance = "2 * 16 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class Fuelstation { icon = "\ca\ui\data\map_fuelstation_ca.paa"; color[] = {1.00, 0.35, 0.35, 1.00}; size = 16; importance = "2 * 16 * 0.05"; coefMin = 0.75; coefMax = 4.00; }; 
class Fountain { icon = "\ca\ui\data\map_fountain_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 12; importance = "1 * 12 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class Hospital { icon = "\ca\ui\data\map_hospital_ca.paa"; color[] = {0.78, 0.00, 0.05, 1.00}; size = 16; importance = "2 * 16 * 0.05"; coefMin = 0.50; coefMax = 4; }; 
class Chapel { icon = "\ca\ui\data\map_chapel_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 16; importance = "1 * 16 * 0.05"; coefMin = 0.90; coefMax = 4.00; }; 
class Church { icon = "\ca\ui\data\map_church_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 16; importance = "2 * 16 * 0.05"; coefMin = 0.90; coefMax = 4.00; }; 
class Lighthouse { icon = "\ca\ui\data\map_lighthouse_ca.paa"; color[] = {0.78, 0.00, 0.05, 1.00}; size = 20; importance = "3 * 16 * 0.05"; coefMin = 0.90; coefMax = 4.00; }; 
class Quay { icon = "\ca\ui\data\map_quay_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 16; importance = "2 * 16 * 0.05"; coefMin = 0.50; coefMax = 4.00; }; 
class Rock { icon = "\ca\ui\data\map_rock_ca.paa"; color[] = {0.35, 0.35, 0.35, 1.00}; size = 12; importance = "0.5 * 12 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class Ruin { icon = "\ca\ui\data\map_ruin_ca.paa"; color[] = {0.78, 0.00, 0.05, 1.00}; size = 16; importance = "1.2 * 16 * 0.05"; coefMin = 1.00; coefMax = 4.00; }; 
class Stack { icon = "\ca\ui\data\map_stack_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 20; importance = "2 * 16 * 0.05"; coefMin = 0.90; coefMax = 4.00; }; 
class Tree { icon = "\ca\ui\data\map_tree_ca.paa"; color[] = {0.55, 0.64, 0.43, 1.00}; size = 12; importance = "0.9 * 16 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class SmallTree { icon = "\ca\ui\data\map_smalltree_ca.paa"; color[] = {0.55, 0.64, 0.43, 1.00}; size = 12; importance = "0.6 * 12 * 0.05"; coefMin = 0.25; coefMax = 4.00; }; 
class Tourism { icon = "\ca\ui\data\map_tourism_ca.paa"; color[] = {0.78, 0.00, 0.05, 1.00}; size = 16; importance = "1 * 16 * 0.05"; coefMin = 0.70; coefMax = 4.00; }; 
class Transmitter { icon = "\ca\ui\data\map_transmitter_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 20; importance = "2 * 16 * 0.05"; coefMin = 0.90; coefMax = 4.00; }; 
class ViewTower { icon = "\ca\ui\data\map_viewtower_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 16; importance = "2.5 * 16 * 0.05"; coefMin = 0.50; coefMax = 4.00; }; 
class Watertower { icon = "\ca\ui\data\map_watertower_ca.paa"; color[] = {0.00, 0.35, 0.70, 1.00}; size = 32; importance = "1.2 * 16 * 0.05"; coefMin = 0.90; coefMax = 4.00; }; 
class Waypoint { icon = "\ca\ui\data\map_waypoint_ca.paa"; color[] = {0.00, 0.00, 0.00, 1.00}; size = 24; importance = 1.00; coefMin = 1.00; coefMax = 1.00; }; 
class WaypointCompleted { icon = "\ca\ui\data\map_waypoint_completed_ca.paa"; color[] = {0.00, 0.00, 0.00, 1.00}; size = 24; importance = 1.00; coefMin = 1.00; coefMax = 1.00; }; 
}; 

Edited by McArcher

Share this post


Link to post
Share on other sites

where can I see commands for map control ? (zoomming and moving via script)

please, help me.

Share this post


Link to post
Share on other sites

Take a look at

EDIT: In case you need an example you can take a look into my "Hunt Waldo 2" mission. There is a spawn dialog using all these features. The collaborating files are

- dialog\Common.hpp

- dialog\Spawn.hpp

- funcs\func_spawndlgUpdate.sqf

Edited by Bon

Share this post


Link to post
Share on other sites

o, thanks! :)

*gone making map script*

---------- Post added at 03:37 ---------- Previous post was at 03:08 ----------

where did you get all the information about that beautiful buttons in dialogs? I have searched, but no info in wiki.

Share this post


Link to post
Share on other sites

where did you get all the information about that beautiful buttons in dialogs? I have searched, but no info in wiki.

Can't remember, to be fair I think I have it from an evolution mission. But there is a very general way to get those information, is to look at how the Bohemia codemonkeys does it themselves:

  1. Unpack the "Addons\ui.pbo" located in your ArmA2 installation directory. It contains all the files related to ingame menu, menu buttons, -backgrounds, aso.
  2. Inside you will find a config.bin. That is, among other things, the binarization of the .hpp files. Use a tool (e.g. unRAP) to re-convert it.

The rest is only a thing of searching and copy-pasting.

Share this post


Link to post
Share on other sites

How can I make dialog movable?

Tried this

class mca_respawn
{
name=mca_respawn;
idd=1;
movingEnable=TRUE;
movingEnabled=TRUE;
controlsBackground[]={ mca_respawn_bg, mca_respawn_bgf1, mca_respawn_bgf2, mca_respawn_bgf3, mca_respawn_bgf4 };
objects[]={};
controls[]={ mca_respawn_lb1, mca_respawn_title, mca_respawn_counter, mca_respawn_map, mca_respawn_radio };

but, hasn't helped..

Share this post


Link to post
Share on other sites

moving = true does it for me :) I have been trying to get the circular 'slider' in my mission, does anyone know the style to use for it?

Share this post


Link to post
Share on other sites

I don't know what it is... how does this slider look like?

---------- Post added at 20:23 ---------- Previous post was at 20:07 ----------

tried

moving = true
, and it didn't work. why?

Share this post


Link to post
Share on other sites

He means the slider you use for example to set units direction in editor. What be nice to know how to get it, think the only way is to check BIS code itself, as I described above.

"movingEnable = 1;" into the header of the container, "moving = 1;" into the header of each control the dialog should be able to move with.

Share this post


Link to post
Share on other sites

oh, thanks .

---------- Post added at 01:37 ---------- Previous post was at 00:45 ----------

one more question, can a List have more than 1 column in arma2 ?

if yes, how can I do this?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×