This site is being deprecated.

Please see the official X‑Plane Support page for help.

0 votes
asked by (16 points)

Hallo,

I am using the 11.31 version. I am trying to load new plane into the Plane 1 using the ACPR command.

First, I have a problem with the ACFN struct. In the UDP comunication documentation

<!--[if gte mso 9]> <![endif]--><!--[if gte mso 9]> Normal 0 21 false false false CS X-NONE X-NONE <![endif]--><!--[if gte mso 9]> <![endif]--><!--[if gte mso 10]>

<![endif]-->

struct acfn_struct

{

         xint              acfn_p                                   ;

         xchr            acfn_path_rel[150]     ;

         xint              livery_index                 ;

};

If I add up bytes as writen int32+150*char+int32=158. But when I tried to set up the struct this way, xPlane had a problem. Error messege told me that it was expecting 160 bytes instead of 158. So I added to hard nulls. First was after the path and second after the infill 'spaces' (to fill up the 150 chars). But this does not work properly. The new plane loads into the sim, but I experience lags. When I enter the Flight configuration menu I can see the newly loaded plane. When I click resume (with no change) everything returns to normal.

Log file messege:

RECV label=ACFN from IP=---------------49001, length after packaging removal=160
Private-message parse, RECV label=ACFN, len=160
Public-message parse, RECV label=ACFN, len=160
Receiving and applying input label=ACFN
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/../L5_Sentinel_cockpit.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/prop.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/fuse.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/wings.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/inn_1.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/inn_2.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/seat.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/panel.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/airspeed/airspeed.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/altimeter/altimeter_ag.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/compass/compass_mag.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/engine_RPM/engine_RPM_ag.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/turn_slip/turn_slip_ga.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/variometer/variometer_ag.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/cht_oilt_oilp_amps/cht_oilt_oilp_amps.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/com_bking/com_bking.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/transponder_bking/transponder_bking.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/instruments/xPad/xPad_arm.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/pilot/pilot.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/glass_inn.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/glass_out.obj
Will try to read the OBJ, path=Aircraft/Laminar Research/Stinson L5/objects/../L5_Sentinel_cockpit.obj
We already have that object! Index=000001E1C8E5FDA0, so we will use that index rather than re-loading the object.

This messege repeats several times.

When I try to combine it with the PREL struct into the ACPR X-Plane crashes.

Can anybody tell me what should i change?

1 Answer

0 votes
answered by (29 points)
Just for reference: the new ACFN struct adds some padding, that might help. Probably only the documentation is new and the struct always needed the padding

const xint net_strDIM=150;    // must be short enough to send over the net, long enough to hold a full ACF path from the x-system folder
struct acfn_struct
{
    xint m_acfn_p; // aircraft index: 0=own aircraft, 1-19 AI planes
    xchr m_acfn_path_rel[net_strDIM]; // full path to acf from x-plane root folder
    xchr pad[2]; // PADDING
    xint m_acfn_live_ind; // livery index
};
...