Menu

CIGI Host Emulator 3 Script Error

Help
Kong Wei
2020-08-31
2020-10-13
  • Kong Wei

    Kong Wei - 2020-08-31

    Hi,

    I would like to send short component control packet to control the propeller of the aircraft and send short articulated part control packet to control the landing gear of the aircraft, and all these peckets can be send successful through the send packet function with specified part ID/ component ID and values.

    However, when I try to send those packets through the script as below, will get the error message about invalid articulated part/component specified:

    //Try to set propeller for entity 0 (the componet ID 20 is the propeller)
    ENTITY_COMPONENT_STATE 0 20 0
    ENTITY_COMPONENT_DATUM_INT32 0 20 1 1
    ENTITY_COMPONENT_END_UPDATE 0 20

    //Landing Gear control for entity 0 (part_id 0, 1, 2 are front, left and right of the landing gear)
    ARTPART_ENABLE 0 0 0
    ARTPART_ENABLE 0 1 0
    ARTPART_ENABLE 0 2 0

    Please advise whether is my script format wrong or there any other commands need to be executed.

    Thank you.

    Kong Wei

     
  • C. Schroeder

    C. Schroeder - 2020-10-06

    My apologies for my tardy reply. In order to use scripting for these controls, you will need to define your entity type(s) and respective component parts in the HEMU3 entities.def configuration file. The HEMU3 script engine does type checking for these items, but the raw packet dialog does not.

    Best regards,

    Curt

     
    • Kong Wei

      Kong Wei - 2020-10-06

      Thanks for your reply!
      Could you give me some examples for how to define such componets and articulated parts?

      my current entities.def file just added in my own aircraft as below:
      entity
      {
      name = "CJ6";
      type = 9;
      class = fixedwing;
      }

      In my case, if I use the build-in send short component control packet function with following value or refer to attached screenshot, will execute the propeller turning animation:
      Componetn Class: 0 Entity
      Instance ID: 0
      Component ID: 20 (engine 1)
      Component State: 0
      Data 1: 1(start) or 0(stop)
      Data 2: not used.

      if I use the send short Articulated Part Control Paacket with following value, will execute the front landing gear retraction animation:
      Entity ID = 0(Ownship)
      Articulated Part 1:
      Part ID: 0(front whell)
      DOF :0
      Value: 0 (rectraction) or 1(put down)
      enable:unchecked.
      Articulated Part 2: not used.

      Best regards,

      Kong Wei

       

      Last edit: Kong Wei 2020-10-06
  • C. Schroeder

    C. Schroeder - 2020-10-09

    Here is a small example of adding components to an entity definition in HEMU3:

    entity
    {
        name = "f18c";
        type = 118;
        class = fixedwing;
    
        component
        {
            name = "PositionLights";
            id = 0;
            def_state = 0;
            state
            {
                name = "off";
                value = 0;
            }
            state
            {
                name = "on";
                value = 1;
            }
        }
        component
        {
            name = "AntiCollisionLights";
            id = 1;
            def_state = 0;
            state
            {
                name = "off";
                value = 0;
            }
            state
            {
                name = "on";
                value = 1;
            }
        }
    }
    

    Hopefully this and the HEMU3 help file documentation will get you on track to meet your entity control needs.

    Best regards,

    Curt

     
  • Michel Nault

    Michel Nault - 2020-10-13

    Thank you Sir.

     

Log in to post a comment.