Jump to content
Sign in to follow this  
nuxil

Howto get a pic in a dialog?

Recommended Posts

Hi all..

can someone exactly tell me how i get a picture in a dialog?

i have been trying a few times now without luck..

i got a class like this in my dia.hpp file.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class PIC_VIEWER : RscText

{

x = 0.005;

y = 0.27273;

idc = 106;

w = 0.15;

h = 0.25;

style = ST_PICTURE;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

font = FontM;

SizeEX = 0.04;

text = "pic\test.jpg";

};

its included under "controls" for the main dialog class.

And i have also the defination included at the top of the file.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#define ST_PICTURE 48

i have also tryed to change the picture with a trigger "radio"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ctrlSetText [106, "pic\test1.jpg"];

to see if a picture was set then,, but Noo. nothing,

what am i missing?

do the file need to be *.paa or something? or pherhaps a sertan size?

Share this post


Link to post
Share on other sites

You can PUT (u said... get?) images not only inside a dialog.

This example of descrription.ext, is not rocket-science.

Just this was my first test (when i copied a piece of OFP-script and starting to 'explode it' to ArmA, changing it, experimenting with it. Just "Doing the LynxEye" lol).

You will find a lot of errors.

But i hope you seeing 'some light' to help you.

Quote[/b] ]#define CT_STATIC 0

#define CT_HTML 9

#define ST_LEFT 0

#define ST_RIGHT 1

#define ST_CENTER 2

#define ST_UP 3

#define ST_DOWN 4

#define ST_VCENTER 5

#define ST_SINGLE 0

#define ST_MULTI 16

#define ST_PICTURE 48

#define ST_FRAME 64

#define ST_HUD_BACKGROUND 128

#define ST_TILE_PICTURE 144

#define ST_WITH_RECT 160

#define ST_LINE 176

#define ST_SHADOW 256

#define ST_NO_RECT 512

class RscPicture

{

type = CT_STATIC;

idc = -1;

style = ST_PICTURE;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = Bitstream;

size = 0.2;

};

class RscText

{

type = CT_STATIC;

idc = -1;

style = ST_LEFT;

h = 0.04;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = Bitstream;

size = 0.2;

};

class DlgTest

{

idd = -1;

movingEnable = false;

controlsBackground =[] = { };

objects[] = { };

controls[] = { JARR };

class JARR : RscText

{

idc = 101;

style = ST_LEFT;

x = 0.4;

y = 0.45;

w = 0.2;

h = 0.1;

text = "Gromeguerr";

}

}

class RscBackground

{

type = CT_STATIC;

idc = -1;

style = ST_LEFT;

colorBackground[] = {0, 1, 0, 1};

colorText[] = {1, 1, 1, 1};

font = Bitstream;

size = 0.2;

text = "";

};

class RscHTML

{

type = CT_HTML;

idc = -1;

style = 0;

colorBackground[] = {1, 1, 1, 1};

colorText[] = {0, 0, 0, 1};

colorBold[] = {0, 0, 0.2, 1};

colorLink[] = {0.4, 0.4, 0.8, 1};

colorLinkActive[] = {0.8, 0.35, 0.48, 1};

// styles

class H1

{

font = Bitstream;

fontBold = Bitstream;

size = 0.2;

};

class H2

{

font = Bitstream;

fontBold = Bitstream;

size = 0.3;

};

class H3

{

font = Bitstream;

fontBold = Bitstream;

size = 0.3;

};

class H4

{

font = Bitstream;

fontBold = Bitstream;

size = 0.3;

};

class H5

{

font = Bitstream;

fontBold = Bitstream;

size = 0.3;

};

class H6

{

font = Bitstream;

fontBold = Bitstream;

size = 0.3;

};

class P

{

font = Bitstream;

fontBold = Bitstream;

size = 0.3;

};

};

//Here starts the king of rock and roll

class RscTitles

{

class GPS

{

name = "GPS";

duration = 0.5

idd = -1;

movingEnable = true;

controls[]= {name1, name2};

class name1 : RscText

{

style = ST_SINGLE; lineSpacing = 1.0;

text = "GPS:";

x = 0.5; y = 0.5; w = 0.2; h = 0.2;

colorBackground[] = {1,1, 1,0};

colorText[] = {1, 1, 1,1};

font = Bitstream; sizeEx = 0.022;

};

class name2 : RscText

{

style = ST_SINGLE; lineSpacing = 1.0;

text = "Fe51";

x = 0.9; y = 0.01; w = 0.1; h = 0.1;

colorBackground[] = {1, 1,1,0};

colorText[] = {1, 0, 0,1};

font = Bitstream; sizeEx = 0.035;

};

};

class GPS2

{

name = "GPS2";

duration = 0.6

idd = -1;

movingEnable = true;

controls[]= {name3};

  class name3 : RscPicture

  {

         idc = 7104;

x = 0.46;

y = 0.63;

w = 0.08;

h = 0.1

text = "ui_action_heal_ca.paa";

size = 1;

sizeEx = 1;

};

};

Then... in your script... when the wolf is reaching the a.s.s. of the AI... in the quietest moment...just type

titleRsc ["GPS2", "PLAIN"]

Experiment a lot with this.

In OFPEC i found some scripts with dialogues, some of them, tutorials, but as i didnt found a place in Wiki explaining this kind of scripts... i started to experiment with this issues.

So, yes, i tried with .paa... i suppose that can be .jpg and .pic too. It means... if .paa can be shown... why not jpg, as .jpg has not transparent layer.

If the more complex image in ArmA having alpha channel... i think ArmA can add the alpha channel to you .jpg images...

Just alpha channel value of .jpg will be added for ArmA. Non transparent value.

I think ArmA can't handle all kind of image formats... but i think .paa, .jpg and .pic yes.

Don't care if you, sometimes, seeing how ArmA.exe is causing ArmA crashes. That means... you scripted 'illegal' statements to 'show' texts/images (maybe also structured text).

It doesn't mean that your 'description.ext' is wrong. Simply, try to change the script where you 'started' to launch that image/text/structured text.

Not all can be titleRSC-launchable.

Try more titleCommands... more cutCommands... etc etc etc

So, i'm saying you a new way to punish teamkillers... making them to crash the ArmA. Like an automatic and remote Alt-F4. Sorry if this last idea is... not much... 'legal'.

I think teamkillers (massive teamkillers, not accident ones)... have to be thrown away ArmA... so... or playing with a minimum of education... or...

Be free, and try to be a good judge with your scripts wink_o.gif

Of course... admins in servers have to be the first 'judges'... not always the script is the best judge... remember... 'judges' can be wrong...

Share this post


Link to post
Share on other sites
Quote[/b] ]ctrlSetText [106, "pic\test1.jpg"];

- be carefull (or rdy to get errors) with "font = FontM;"

I don't know what is "FontM".

Maybe be masked under #DEFINE's?

just don't type that line of script, remove 'font' line, let ArmA assumes one default value (and then, legal one) by itself.

Your image is not 'text', is image. So, you need to declare the image as RscPicture (i think), not as RscText.

The real 'text/image' that i'm showing in that description.ext in a test mission, is only the "GPS2", because, in the script that i showed you, there wasn't the "GPS" titleRsc command.

Share this post


Link to post
Share on other sites

i have been messing around a bit.. and i found out that, somehow it will only show paa files.. i tested with unpobing one of the bezerk missions and tryed with ther logo.. which is a paa file.. and it worked.

i tryed with jpg/bmp/gif and png file format..

i also tryed with diffrent size of the images.. 128x128 | 256x256 so on.. but no luck..

so i guess i just have to buy photoshop and use the paa plugin to it.. :\

Share this post


Link to post
Share on other sites

Nope, try with .jpg file, pay a lot of attention when handling "folders syntax" in description.ext file

I think that is not 100% the same that in .sqs syntax.

Try to make the tests with your image outside folder "pic", just in your 'root' of the mission.

Anyway, try a .jpg

If you want, try my script, changing the .paa for your .jpg file, in the same folder that you mission.sqm, description.ext, etc.

maybe you need to declare the image like this:

"\pic\test1.jpg"

Just try this last. I encourage you.

You don't need the Photoshop to make .paa files.

Maybe you don't want .paa files. You don't NEED it at all.

Try to change the 'quality' of the .jpg

The method what the photo-program-editor is using to convert-compress-save the .jpg file.

Now, i will make a test myself with .jpg instead .paa file.

If i see it works, i will send you the .jpg test image file where you want, to analyze its internal parameters (more or less 'quality' parameters).

Not all kind of .jpg can be shown in ArmA i think.

There is a lot of ways to get a .jpg file.

And... if i'm not remembering so bad... plugin files for photoshop can be compatible with other programs... use google...

I can convert your jpg files in .paa

Don't abuse of this... but i can help you.

Share this post


Link to post
Share on other sites

Use jpg file as 72 pixels per inch. (72 dpi?)

3 channels: R, G, B.

8 bits per channel.

8 - 8 - 8 = image with 24 bits depth.

Check this screenshots:

.jpg file inside game (taking the original .paa file of refuel icon, and directly converting to .jpg, so, losing his 'transparent' layer.

http://www.gratisweb.com/lynxeye....age.jpg

.paa file inside game.

http://www.gratisweb.com/lynxeye....age.jpg

And now, the real portion of description.ext where that kind of images is declared:

Quote[/b] ]class RscTitles

{

class Rearming

{

name = "Rearming";

duration = 0.3

idd = -1;

movingEnable = false;

controls[]= {Rearm01,RearmText};

class Rearm01 : RscPicture

{

idc = -1;

x = 0.47;

y = 0.53;

w = 0.06;

h = 0.08;

text = "LynxScripts\FunZone\Images\vehicle_rearming.paa";

size = 1;

sizeEx = 1;

};

class RearmText : RscText

{

style = ST_SHADOW; lineSpacing = 1.0;

text = "REARMING";

x = 0.44;

y = 0.4;

w = 0.2;

h = 0.2;

colorBackground[] = {0,0, 0,0};

colorText[] = {1,1,1,1};

font = Bitstream; sizeEx = 0.028;

};

};

This is the piece of rearming, not refueling, as the images showing... but is equal.

I made that 2 tests images converting first the original .paa to .jpg.

Then i changed in this piece of description.ext, the word .paa by .jpg (i converted from .paa to .jpg, keeping the name of the file, equal. Same name, but different extension (format).

Still i never tried to use dialogs. But i suspect that they are sharing the same 'spirit'.

In my RSCtitles... i'm launching at the same time, one text ("REFUELING") + one image.

But you need first to declare 'RscText' and 'RscPicture'...

Quote[/b] ]class RscPicture

{

type = CT_STATIC;

idc = -1;

style = ST_PICTURE;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = Bitstream;

size = 0.2;

};

class RscText

{

type = CT_STATIC;

idc = -1;

style = ST_LEFT;

h = 0.04;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = Bitstream;

size = 0.2;

};

Just my example, my knowledgement, don't know the real syntax/order.

I also noticed this kind of order in description.ext :

1st - #DEFINE's... if you have it.

2nd - commands such onLoadMission, disableAI... etc

3rd - declaration of the 'chassis' of your Rsc's. Background, RscText, RscPicture, RscHTML... (also the chassis of dialogs too)

4th - all sounds/music you are using.

5th - (and last) all your classes for pictures, texts, dialogs, etc etc etc all that funny staff.

It's not rocket-science, just my tests.

Now, the real files (.jpg .paa) i used to the test.

http://www.gratisweb.com/lynxeye....ing.jpg

Again i have to say, vehicle_refueling.jpg = the original .paa file 'refueling icon', just only converted to jpg.

I have to say to moderators, original .paa i'm using, it's inside original 1.05 pbo file (can't remember which one), so, if not allowed to 'host' in my no-webpage this files... please, warning/message me.

You will notice that my webpage is not a real webpage. Just only a 'space' to put files inside, to be linked to here by me, when i have to show an image, as test/example.

So, i have no links in that no-webpage to show the content of those folders, so, i'm understanding, i'm not doing illegal things.

Correct me if i'm wrong.

Share this post


Link to post
Share on other sites

hmm i have tryed and tryed and tryed,, i cant get other pictures beside paa file to show up in my dialogs..

but i finaly figurd out how to make thouse paa files tounge2.gif

aalockonan7.th.png

Share this post


Link to post
Share on other sites

Can you put some RSC text inside your dialogs?

Just show a little example. If you want.

If you can put texts... you can put images... maybe ArmA not allowing jpg files inside dialogs... but i think yes.

I want to test the issue jpg/paa if you can 'help' me with a little script to put a image inside dialog.

Just for experiments.

Share this post


Link to post
Share on other sites

Well you can try with the currect script im working on..

my AA script which i seems to never get finished tounge2.gif

anyway thers the dia.hpp

this file must be included in description.ext

like: #include dia.hpp

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#define ST_LEFT 0

#define ST_RIGHT 1

#define ST_CENTER 2

#define CT_STATIC 0

#define ST_PICTURE 48

#define FontM "Zeppelin32"

#define FontHTML "Zeppelin32"

#define Size_Text_Small 0.025

#define CT_ACTIVETEXT 11

#define CT_BUTTON 1

#define ST_FRAME 64

#define CT_EDIT 2

#define CT_COMBO 4

#define CT_LISTBOX 5

#define CT_SLIDER 3

#define ST_HPOS 0x0F

class RscText

{

type = CT_STATIC;

idc = -1;

style = ST_LEFT;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = FontM;

sizeEx = 0.04;

};

class RscPicture

{

type = CT_STATIC;

idc = -1;

style = ST_PICTURE;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = FontM;

sizeEx = 0.04;

};

class RscActiveText

{

type = CT_ACTIVETEXT;

idc = -1;

style = ST_LEFT;

color[] = {1, 1, 1, 1};

colorActive[] = {1, 0, 0, 1};

font = FontM;

sizeEx = 0.04;

soundEnter[] = {"ui\ui_over", 0.2, 1};

soundPush[] = {, 0.2, 1};

soundClick[] = {"ui\ui_ok", 0.2, 1};

soundEscape[] = {"ui\ui_cc", 0.2, 1};

default = false;

};

class RscButton

{

type = CT_BUTTON;

idc = -1;

style = ST_CENTER;

colorText[] = {1, 1, 1, 1};

colorDisabled[] = {1, 1, 1, 0.7};

colorBackground[] = {0.2, 0.4, 1, 0.8};

colorBackgroundActive[] = {0.2, 0.4, 1, 1};

colorBackgroundDisabled[] = {0.2, 0.4, 1, 0.6};

colorFocused[] = {1, 1, 1, 0.4};

colorShadow[] = {0, 1, 0, 0};

colorBorder[] = {0, 1, 0, 0};

font = FontM;

soundEnter[] = {"\ca\ui\data\sound\mouse2", 0.15, 1};

soundPush[] = {"\ca\ui\data\sound\new1", 0.15, 1};

soundClick[] = {"\ca\ui\data\sound\mouse3", 0.15, 1};

soundEscape[] = {"\ca\ui\data\sound\mouse1", 0.15, 1};

sizeEx = 0.02;

offsetX=0;

offsetY=0;

offsetPressedX=0;

offsetPressedY=0;

borderSize=0;

default = false;

};

class RscFrame

{

type = CT_STATIC;

idc = -1;

style = ST_FRAME;

colorBackground[] = {0, 0, 0, 0};

colorText[] = {1, 1, 1, 1};

font = FontM;

sizeEx = 0.04;

};

class RscEdit

{

type = CT_EDIT;

idc = -1;

style = ST_LEFT;

font = FontHTML;

sizeEx = 0.02;

colorText[] = {0, 0, 0, 1};

colorSelection[] = {0.5, 0.5, 0.5, 1};

autocomplete = false;

text =;

};

class RscLB_C

{

style = ST_LEFT;

idc = -1;

colorSelect[] = {0.4, 0.4, 0.4, 1};

colorSelectBackground[] = {0.2, 0.2, 0.2, 1};

colorText[] = {0.2, 0.2, 0.2, 1};

colorBackground[] = {0.4, 0.4, 0.4, 1};

font = FontHTML;

sizeEx = 0.025;

rowHeight = 0.04;

};

class RscListBox: RscLB_C

{

type = CT_LISTBOX;

};

class RscCombo: RscLB_C

{

type = CT_COMBO;

wholeHeight = 0.3;

};

class RscSliderH

{

type = CT_SLIDER;

style = ST_HPOS;

color[] = {0.2, 0.2, 0.2, 1};

idc = -1;

sizeEx = 0.025;

};

class DIALOG1

{

idd = -1;

movingEnable = true;

controlsBackground[] = {DLG_BACK1, FRAME1};

objects[] = { };

controls[] = {FIRE, ABORT, TEXT_DIST, TEXT_SPEED, TEXT_HIGHT, TEXT_LAUNCHDIR, TEXT_DIRE,TEXT_LOCKON,PIC_VIEWER};

class DLG_BACK1: RscText

{

colorBackground[] = {0.4, 0.4, 0.4, 1};

text =;

x = 0;

y = 0.00198;

w = 0.16;

h = 0.6;

};

class FRAME1 : RscText

{

x = 0;

y = 0.00198;

idc = -1;

w = 0.158;

h = 0.6;

style = ST_FRAME;

colorText[] = {0, 0, 0, 1};

colorBackground[] = {0.4, 0.4, 0.4, 0,9};

SizeEX = 0.025;

text = "Status";

};

class FIRE : RscButton

{

x = 0.00625;

y = 0.53755;

idc = -1;

w = 0.07;

h = 0.04;

style = ST_LEFT;

colorText[] = {0, 0, 0, 1};

font = FontM;

SizeEX = 0.025;

text = "Fire";

action = "";

default = false;

};

class ABORT : RscButton

{

x = 0.085;

y = 0.53834;

idc = -1;

w = 0.07;

h = 0.04;

style = ST_CENTER;

colorText[] = {0, 0, 0, 1};

font = FontM;

SizeEX = 0.025;

text = "Abort";

action = "DIA=0; LOCKON = 0; closeDialog 0";

default = false;

};

class TEXT_DIST : RscText

{

x = 0.005;

y = 0.07115;

idc = 100;

w = 0.15;

h = 0.02;

style = ST_LEFT;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

font = FontM;

SizeEX = 0.02;

text = "";

};

class TEXT_SPEED : RscText

{

x = 0.005;

y = 0.11067;

idc = 101;

w = 0.15;

h = 0.02;

style = ST_LEFT;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

font = FontM;

SizeEX = 0.02;

text = "";

};

class TEXT_HIGHT : RscText

{

x = 0.005;

y = 0.1502;

idc = 102;

w = 0.15;

h = 0.02;

style = ST_LEFT;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

font = FontM;

SizeEX = 0.02;

text = "";

};

class TEXT_LAUNCHDIR : RscText

{

x = 0.005;

y = 0.22925;

idc = 103;

w = 0.15;

h = 0.02;

style = ST_LEFT;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

font = FontM;

SizeEX = 0.02;

text = "";

};

class TEXT_DIRE : RscText

{

x = 0.005;

y = 0.18972;

idc = 104;

w = 0.15;

h = 0.02;

style = ST_LEFT;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

font = FontM;

SizeEX = 0.02;

text = "";

};

class TEXT_LOCKON : RscText

{

x = 0.005;

y = 0.03162;

idc = 105;

w = 0.15;

h = 0.02;

style = ST_LEFT;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

font = FontM;

SizeEX = 0.02;

text = "";

};

class PIC_VIEWER : RscPicture

{

x = 0.005;

y = 0.27273;

idc = 106;

w = 0.15;

h = 0.25;

style = ST_PICTURE;

colorText[] = {1, 1, 1, 1};

colorBackground[] = {0, 0, 0, 0};

size = 1;

sizeEx = 1;

text = "";

};

};

main script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Me = _this select 0;

//Little marker circle..

createMarker ["AAsl", [-1000,-1000]];

"AAsl" setMarkerBrush "DiagGrid";

"AAsl" setMarkerColor "ColorRedAlpha";

"AAsl" setMarkerShape "ELLIPSE";

"AAsl" setMarkerSize [175, 175];

//set addon to false..

KEGsClientAddonPresent = false;

DIA=0;

TLIST = [];

CHECKE = [];

LOCKON = 0;

INFO = [];

publicvariable "TLIST";

publicvariable "CHECKE";

publicvariable "LUNIT";

publicvariable "PAD";

publicvariable "LOCKON";

publicvariable "INFO";

publicvariable "DIA";

//finddisplay(46) displayseteventhandler ["Keydown","if ((_this select 1) == 16) then {Qon = true}"];

//finddisplay(46) displayseteventhandler ["KeyUp","if ((_this select 1) == 16) then {Qon = false}"];

// start the trigger.. so we can get an list of units.

nil=[_Me] execvm "scripts\triggerarea.sqf";

sleep 3;

CHECKE = TLIST;

//lets check if the spectating client addon is installed on your system..

//we want to accsess the Marker classes.

_foo = "KEGsAddon10" createVehicleLocal[-1000,-1000,0];

if(!isNull _foo) then {

deletevehicle _foo;

KEGsClientAddonPresent = true;

}; // i got some problems with this.. :\

_a=0; // going to use as a exit variable when the AA dies later on..

while {(_a < 1)} do {

_nrm = count TLIST;

_nrc = count CHECKE;

"AAsl" setMarkerPos [-1000,-1000];

onMapSingleClick "PAD =+ _pos";

if (PAD select 0 > 0) then {

_px=pad select 0;

_py=pad select 1;

_only = nearestObjects [[_px,_py,250],["Air"], 550];

_now = _only select 0;

if (!isNull _now) then {

LOCKON=1;

LUNIT=_now;

_now=[];

};

"AAsl" setMarkerPos [_px,_py];

PAD=[0,0,0];

};

// if new units go in to aircrafts. just add them,,

if (_nrm > _nrc) then { CHECKE = TLIST;};

// if some units died..

if ((_nrm < _nrc) || (_nrm == 0)) then {

_Dunit=[];

_index=0;

for [{_i=0},{_i < _nrc},{_i=_i+1}] do {

_unit = checkE select _i;

if (!alive _unit) then {

_Dunit set [_index, _unit];

_index = _index +1;

_Dunit resize _index;

_Ename = format["%1", _unit];

};

};

{_Ename = format["%1", _x]; deletemarker _Ename;} foreach _Dunit;

CHECKE = TLIST;

};

// actual ploting

if ((_nrm == _nrc) && (_nrm != 0)) then {

nil=[] execvm "scripts\maplot.sqf";

if ((LOCKON == 1))then {

nil=[] execvm "scripts\lockon.sqf";

nil=[_Me] execvm "scripts\infoaire.sqf";

if (DIA == 0) then {

DIA=1;

_dia = createDialog "DIALOG1";

};

//if (Qon) then {

// nil=[_Me] execvm "scripts\fire.sqf";

//};

};

};

//closeDialog 0;

sleep 0.1;

};

triggerarea script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Me = (_this select 0);

while {true} do {

_myarray=[];

WestTriggerOne = createTrigger ["EmptyDetector", position _Me];

WestTriggerOne setTriggerActivation ["EAST", "PRESENT", true];

WestTriggerOne setTriggerType "NONE";

WestTriggerOne setTriggerArea [50000, 50000, 0, false ];

//update the publicalvariable each sec

sleep 1;

_whohere = list WestTriggerOne;

_nr = {alive _x} count (_whohere);

_index=0;

for [{_a=0},{_a < _nr },{_a=_a+1}] do {

_unit = _whohere select _a;

if ((_unit isKindOf "AIR")) then {

_myarray set [_index, _unit];

_index = _index +1;

_myarray resize _index;

};

};

TLIST =+ _myarray;

};

lockon script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_lockon = LUNIT;

_nr=round LOCKON;

while {(_nr == 1)} do {

createMarker ["lockon", (position _lockon)];

"lockon" setMarkerBrush "DiagGrid";

"lockon" setMarkerColor "ColorBlue";

"lockon" setMarkerShape "ELLIPSE";

"lockon" setMarkerSize [175, 175];

"lockon" setMarkerPos (position _lockon);

sleep 0.1;

_nr=round LOCKON;

};

;

//"lockon" setMarkerPos [-1000,-1000];

deleteMarker "lockon";

maplot script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

{

_unit = _x;

_Ename = format["%1", _x];

createMarker [_Ename, (position _x)];

_type = getText(configFile >> "CfgVehicles" >> format["%1", typeOf (vehicle _unit)] >> "simulation");

_icon = "Arrow";

switch(_type) do {

case "airplane": {_icon = "KEGsPlane"};

case "helicopter": {_icon = "KEGsHelicopter"};

};

_Ename setMarkerTypeLocal _icon;

_Ename setMarkerSize [0.5,0.5];

_Ename setMarkerDir (getdir _x);

_Ename setMarkerText (format["%1",(typeOf _x)]);

_Ename setMarkerPos (position _x);

} foreach CHECKE;

info script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Me = _this select 0;

_li = LUNIT;

_name = name _li;

_nr=round LOCKON;

while {(_nr == 1)} do {

// "n e s w" hight so on..

_Epos = getpos _li;

_tx = _Epos select 0;

_ty = _Epos select 1;

_tz = _Epos select 2;

_Apos = getpos _Me;

_mx = _Apos select 0;

_my = _Apos select 1;

_mz = _Aos select 2;

// Trigometri

_hypotenus = [_mx,_my,0] distance [_tx,_ty,0];

_htt=0;

// position of the target, and calculate the heading to it. divide into 4 sectors.

if ((_mx < _tx) && (_my < _ty)) then {

_hoskatet = [_mx,_my,0] distance [_tx,_my,0];

_motkatet = [_tx,_my,0] distance [_tx,_ty,0];

_tanvink=( _motkatet / _hoskatet );

_reelvink = atan _tanvink;

_htt = 90 - _reelvink;

};

if ((_mx < _tx) && (_my > _ty)) then {

_hoskatet = [_mx,_my,0] distance [_tx,_my,0];

_motkatet = [_tx,_my,0] distance [_tx,_ty,0];

_tanvink=( _motkatet / _hoskatet );

_reelvink = atan _tanvink;

_vx = 90 + _reelvink;

_htt = _vx;

};

if ((_mx > _tx) && (_my > _ty)) then {

_hoskatet = [_mx,_my,0] distance [_mx,_ty,0];

_motkatet = [_mx,_ty,0] distance [_tx,_ty,0];

_tanvink=( _motkatet / _hoskatet );

_reelvink = atan _tanvink;

_htt = 180 + _reelvink;

};

if ((_mx > _tx) && (_my < _ty)) then {

_hoskatet = [_mx,_my,0] distance [_tx,_my,0];

_motkatet = [_tx,_my,0] distance [_tx,_ty,0];

_tanvink=( _motkatet / _hoskatet );

_reelvink = atan _tanvink;

_htt = 270 + _reelvink;

};

_distance = format["Distance:%1",round (_li distance _Me)];

_speed = format["Speed:%1",round (speed _li)];

_hight = format["Hight:%1",round (getpos _li select 2)];

_dire = format["Heading:%1",round (getdir _li)];

_launchdir=format["Launch Dir:%1",round (_htt)];

_lockon = format["%1", _name];

ctrlSetText [100, _distance];

ctrlSetText [101, _speed];

ctrlSetText [102, _hight];

ctrlSetText [103, _dire];

ctrlSetText [104, _launchdir];

ctrlSetText [105, _lockon];

_type = typeOf vehicle _li;

_pic="";

switch(_type) do {

case "KA50": {_pic = format["pics\ka.paa"]};

case "Su34": {_pic = format["pics\su34.paa"]};

case "Su34B": {_pic = format["pics\su34.paa"]};

case "Mi17_MG": {_pic = format["pics\mi.paa"]};

case "Mi17": {_pic = format["pics\mi.paa"]};

};

ctrlSetText [106, _pic];

_nr=round LOCKON;

sleep 0.1;

};

LUNIT=[];

INFO=[];

the script is a bit buggy as its not 100% finished,, sorry i cant send you my paa files since i dont have yet fixed myself a place to uploade files. but in the infoaire.sqf script you'll see how i set the pictures when i click on diffrent airtyped on the map..

Share this post


Link to post
Share on other sites

Roger, starting to analyze. No matter about .paa files. I have some .paa.

Tell me, as example, the settings of one of your .jpg files that you tried to include inside the dialogs.

Resolution...how many bits per channel... all that you can say me. If not possible, just send me one 'real' .jpg to lynxeye.spa@gmail.com

Share this post


Link to post
Share on other sites

i have tested with RGB 8 bit per channel and a resolution of 72 dpi..

and size 128x128 and 256x256.. my paa files are 256x256

oh.. btw i forgot to tell.. to test my script.. put a styker on the map.. and in its init feald put nil=[this] execvm main.sqf

Share this post


Link to post
Share on other sites
Quote[/b] ]{_pic = format["pics\mi.paa"]};

Try:

{_pic = format["\pics\mi.paa"]};

and/or

{_pic = "\pics\mi.paa"}

and/or

_pic = image "\pics\mi.paa"

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  

×