Home   Help Search Login Register  

Author Topic: Need scripting help for autopilot/avionics view  (Read 1848 times)

0 Members and 1 Guest are viewing this topic.

Offline dcggames

  • Members
  • *
Need scripting help for autopilot/avionics view
« on: 12 Apr 2008, 12:25:04 »
Hello guys,

I'm currently building a real-size combat helicopter simulator and I want to use ofp as simulation software.. Now I need some scripting help.. The idea is to create a autopilot that can create a lateral route. Soo that I can input waypoints (by for example using the dynamic waypoint script that is downloadable from ofpec), and that the autopilot can follow that route (by using a button to engage and a button to disengage).. And the route info on a sort of radar screen together with the avionics viewed on a secondary monitor (connected to the second output of my videocard). To give you all a idea of what I have in mind, take a look at this:
I hope one of you is willing to help me :D

Greetz Felix

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Need scripting help for autopilot/avionics view
« Reply #1 on: 12 Apr 2008, 14:43:30 »
You will not be able to do this with OFP alone.  Download Kegety's FWatch for OFP and his demo mission. FWatch is a utility that lets you monitor keystrokes and game information from OFP and send information back in.  You will have to code your own app independant of OFP to do all those fancy displays. The only displays available in OFP and ArmA are called dialogs, and when enabled they prevent control of your in game unit.
urp!

Offline dcggames

  • Members
  • *
Re: Need scripting help for autopilot/avionics view
« Reply #2 on: 12 Apr 2008, 22:51:56 »
Thanks for the answer Mr.Peanut!
I will look at the radar screen and I have an idea for it.. But how can I view the avionics like in this pic;
in a dialog?

Greetz Felix

Offline Rommel92

  • Members
  • *
Re: Need scripting help for autopilot/avionics view
« Reply #3 on: 15 Apr 2008, 06:28:01 »
Haha, its a crazy idea, but you could make a camera at the position of those dialogs as a simulated "bring up on screen", however this will not be a separate thing, just a complete screen takeover...  :P

Offline dcggames

  • Members
  • *
Re: Need scripting help for autopilot/avionics view
« Reply #4 on: 17 Apr 2008, 20:54:24 »
I'm currently busy with a dialog for the screens, but I can't get it workings :-[
This is what my discription.ext looks like:
Code: [Select]
#define ST_LEFT      0
#define ST_RIGHT     1
#define ST_CENTER    2
#define ST_MULTI        16
#define ST_SHADOW       256
#define ST_NO_RECT      512
#define CT_STATIC    0
#define ST_PICTURE   48
#define FontM "tahomaB36"
#define FontHTML "CourierNewB64"
#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[] = {0, 0, 0, 1};
        font = FontHTML;
        sizeEx = 0.025;
        soundPush[] = {, 0.2, 1};
        soundClick[] = {"ui\ui_ok", 0.2, 1};
        soundEscape[] = {"ui\ui_cc", 0.2, 1};
        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 AIRWOLF_AVIONICS
{
  idd = -1;
  movingEnable = true;
  controlsBackground[] = {};
  objects[] = { };
  controls[] = {PICTURE1};
 class PICTURE1 : RscText
 {
  x = 0.4675
  y = 0.49511
  idc = -1
  w = 0.992
  h = 0.939
  style = ST_PICTURE
  colorText[] = {1, 1, 1, 1};
  colorBackground[] = {0, 0, 0, 0};
 font = "TahomaB36"
  SizeEX = 0.04
 text = ""avionics.jpg""
  };
};
I made a trigger for Radio Alpha, with: OnActivation: ok = createDialog "AIRWOLF_AVIONICS"
But I always get the "Resource AIRWOLF_AVIONICS not found". And I put the .ext in the same map as the mission.

Greetz Felix
« Last Edit: 17 Apr 2008, 20:57:31 by dcggames »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Need scripting help for autopilot/avionics view
« Reply #5 on: 21 Apr 2008, 14:25:16 »
Haha, its a crazy idea, but you could make a camera at the position of those dialogs as a simulated "bring up on screen", however this will not be a separate thing, just a complete screen takeover...  :P
Not only that but the camera will have to keep moving if the aircraft is in flight and we all know how jerky that might end up.


I am sorry but I don't have any experience with dialogs, so I can't help there. Keep in mind that while a dialog is open you will not have control of your aircraft, which could be deadly.

I suggest taking a look at other examples of dialogs to help you, such as:
http://www.ofpec.com/ed_depot/index.php?action=details&id=264&page=0
http://www.ofpec.com/ed_depot/index.php?action=details&id=259&page=0
http://www.ofpec.com/ed_depot/index.php?action=details&id=315&page=3&cat=xyz
« Last Edit: 21 Apr 2008, 14:33:30 by Mr.Peanut »
urp!

Offline dcggames

  • Members
  • *
Re: Need scripting help for autopilot/avionics view
« Reply #6 on: 22 Apr 2008, 14:11:28 »
Hmm, there is a software for aircraft avionics, but that's originelly designed for flight simulator, I don't know if I can do anything with that, its called; Project Magenta (www.projectmagenta.com)

Greetz,

Felix