DDavid
Member-
Content Count
3 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout DDavid
-
Rank
Rookie
-
Hey all, Lately I've been getting into scripting for ArmA 2, and it's been going pretty well.. I've created a few small scripts, played around with a lot of functions and commands.. But now, I'm completely stuck. You see, I've made a script to call for a pilot to fly a vehicle to your location. Both pilot and vehicle are spawned on execution of the script, and it all works well. However, since I want to be able to choose from a list of vehicles, I've been trying to get a dialog to open after the player selects a "Send vehicle" command from the action menu. This dialog would contain a choice of vehicles. I've been testing the script via the action menu, but when there are a number of vehicles to choose from, two problems occur: -the action menu gets too cluttered -the vehicles you do not select cannot be removed from the menu after having made a selection (I could only script it so that the action is remved from the menu when it is actually executed, since the action's ID is passed on to the script linked to it). So, the logical choice for me was to open a dialog after selecting "Send vehicle" from the action menu. This turned out to be trickier than I expected. I've read the Dialog Control article thoroughly, and even tried my luck with the examples in that article. Still, I can't seem to get what I want from it, and I can't figure out why not. Here are the problems I'm facing at the moment: -Player cannot move while dialog is open. I know more people have encountered this problem, I have searched the forum when I ran into it. I was just wondering if there's a workaround or fix for this yet. If not, it's not a real problem. Shouldn't take long to click on a vehicle anyway ;). -Button isn't working. Now here's a real problem.. The button I made to test with isn't even doing anything. I've tried a lot of things, and after having read each line of code at least ten times, I decided to just copy-paste the example button, only to find that doesn't work either.. The button doesn't switch colors when I hover over it or click it, in fact I can't select it at all.. It behaves as a ST_TEXT more than as a button. Kind of a bummer, after having made some nice scripts ;) Here's the code I have in my description.ext file: #define true 1 #define false 0 class VehicleDialog { idd = -1; // set to -1, because we don't require a unique ID movingEnable = 1; class controlsBackground { class Background { idc = -1; // set to -1, unneeded type = ST_TEXT; // constant style = ST_LEFT; // constant move = true; text = ""; font = Zeppelin32; sizeEx = 0.025; colorBackground[] = { 0.14, 0.18, 0.13, 0.8 }; colorText[] = { 1, 1, 1, 1 }; x = 0.1; y = 0.7; w = 0.2; h = 0.05; }; }; objects[] = { }; class controls { class Button { idc = 0; type = CT_BUTTON; style = ST_LEFT; default = true; font = Zeppelin32; sizeEx = 0.03; colorText[] = { 0, 0, 0, 1 }; colorFocused[] = { 1, 0, 0, 1 }; // border color for focused state colorDisabled[] = { 0, 0, 1, 0.7 }; // text color for disabled state colorBackground[] = { 0, 0, 0, 0 }; colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // background color for disabled state colorBackgroundActive[] = { 0, 0, 0, 0 }; // background color for active state offsetX = 0.003; offsetY = 0.003; offsetPressedX = 0.002; offsetPressedY = 0.002; colorShadow[] = { 0, 0, 0, 0.5 }; colorBorder[] = { 0, 0, 0, 1 }; borderSize = 0; soundEnter[] = { "", 0, 1 }; // no sound soundPush[] = { "", 0, 1 }; soundClick[] = { "", 0, 1 }; // no sound soundEscape[] = { "", 0, 1 }; // no sound x = 0.1; y = 0.7; w = 0.2; h = 0.05; text = "Close"; action = ""; }; }; }; Can anyone discover some mistake here? I've been thinking of other options, though I'm not sure if they're possible. I'd like to see my vehicle options via the command menu, for instance under the "support" option. I have no idea if I can add options to this menu, however. While searching for more info on the dialogs, I've come across people saying that instead of "createDialog" one should use "createDisplay". The documentation on displays is rather poor, though, and I can't for the life of me figure out how to succesfully use displays. I hope someone can help me with this. Regards, David ---* update *--- Oh dear, I'm feeling a bit stupid.. I was using the defined constants, assuming they were defined in the game's core somewhere. I've just now copy-pasted them into my own constants file, and the button's working as it should. Sorry for the dumb question. I am still looking for a way to enable the player's movement when the dialog is open, but I realize that's a tricky issue. Once more, my apologies for the silly question, I am after all still learning :)
-
Cannot target vehicles
DDavid replied to DDavid's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for the advice, the opposite seems to be true for me, actually. when I hit "next target" it only targets the wooden training tank, but I can manually lock on to the APC. So I think the APC I placed is still not considered a valid hostile target, even though the soldiers on my side keep saying "enemy APC 100 meters to our front" and such. I noticed the APC doesn't show red on the AH1Z's kompas/radar display. It shows grey instead. But nothing I do seems to change that... -
Hello everyone, I'm very new to editing ArmA II, in fact, I'm pretty new to the game. I haven't played the previous game, let alone edit it. I'm trying to set up a map bit by bit, and it's going ok, except for one thing. When I'm in a helicopter, I cannot target any enemy vehicle. I enemy units in a tank, and I have a helicopter with a gunner, and the only thing I've been able to target so far is a training tank. The enemies will shoot at me, though, so the AI is initialized. Is there some setting I'm overlooking here, some property I have to set? Thanks, David