Hi,
Ok.. so I'm trying to use the two events FREEZE_ATTITUDE_TOGGLE and FREEZE_ALTITUDE_TOGGLE to keep an AI plane flying straight and level.
The problem I'm having is I'm not really seeing that happen, and I don't know if I'm using the events properly or at the right time.
So I have this when I'm connecting to SimConnect and setting up all my stuff:
Later, after I get the ID of my sim object:
Am I doing this in the wrong place, or at the wrong time? Or instead of the Toggle events should I use the two Set events instead?
Thanks again!
DAvid
Ok.. so I'm trying to use the two events FREEZE_ATTITUDE_TOGGLE and FREEZE_ALTITUDE_TOGGLE to keep an AI plane flying straight and level.
The problem I'm having is I'm not really seeing that happen, and I don't know if I'm using the events properly or at the right time.
So I have this when I'm connecting to SimConnect and setting up all my stuff:
Code:
simconnect.MapClientEventToSimEvent(EVENTS.EVENT_FREEZE_ALT, "FREEZE_ALTITUDE_TOGGLE");
simconnect.MapClientEventToSimEvent(EVENTS.EVENT_FREEZE_ATT, "FREEZE_ATTITUDE_TOGGLE");
simconnect.AddClientEventToNotificationGroup(GROUPS.GROUP_FREEZE, EVENTS.EVENT_FREEZE_ALT, false);
simconnect.AddClientEventToNotificationGroup(GROUPS.GROUP_FREEZE, EVENTS.EVENT_FREEZE_ATT, false);
simconnect.SetNotificationGroupPriority(GROUPS.GROUP_FREEZE, SimConnect.SIMCONNECT_GROUP_PRIORITY_HIGHEST);
Later, after I get the ID of my sim object:
Code:
SimObjectId_AirConnectTrike = simObjectId.dwObjectID;
displayText("Received Air Trike id: " + SimObjectId_AirConnectTrike.ToString());
// now that we have the id, freeze the LLA/PBH of the plane
simconnect.TransmitClientEvent(SimObjectId_AirConnectTrike, EVENTS.EVENT_FREEZE_ALT, 0, GROUPS.GROUP_FREEZE, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);
simconnect.TransmitClientEvent(SimObjectId_AirConnectTrike, EVENTS.EVENT_FREEZE_ATT, 0, GROUPS.GROUP_FREEZE, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);
Am I doing this in the wrong place, or at the wrong time? Or instead of the Toggle events should I use the two Set events instead?
Thanks again!
DAvid



