- Messages
- 814
- Country
I have a system set up that loads a number of AI object(s) from a list specified in a plain txt file. They get read in and loaded as soon as the main user object has been loaded from FSX's FLT file.
When I load the AI object just after the main user object, it is read in and loaded, and the new object ID is issued and everything seems fine... except, immediately after, server rejects the AI object by issuing "ObjectRemoved " system event and removes the object.
To check my sanity level, I rigged a little Sleep() command to cause a pause, and if I give it about 3.5 seconds of wait time, everything loads properly.
Also, I rigged the AI loading on a custom key press, and again, everything works ok.
The related SDK demo AI Objects and Waypoints loads AI objects on key press, so I never noticed this. It seems as if the system needs a bit of time to put everything on screen, and then perhaps it is ready to accept AI objects. Is there a system event that would notify me when the "picture"appears upon loading the sim? SimStart, SimStop and Sim events are unreliable (as per SDK's own admmission) as they get fired several times during the sim loading.
Any insight on this would be really helpful!
When I load the AI object just after the main user object, it is read in and loaded, and the new object ID is issued and everything seems fine... except, immediately after, server rejects the AI object by issuing "ObjectRemoved " system event and removes the object.
To check my sanity level, I rigged a little Sleep() command to cause a pause, and if I give it about 3.5 seconds of wait time, everything loads properly.
Also, I rigged the AI loading on a custom key press, and again, everything works ok.
The related SDK demo AI Objects and Waypoints loads AI objects on key press, so I never noticed this. It seems as if the system needs a bit of time to put everything on screen, and then perhaps it is ready to accept AI objects. Is there a system event that would notify me when the "picture"appears upon loading the sim? SimStart, SimStop and Sim events are unreliable (as per SDK's own admmission) as they get fired several times during the sim loading.
Any insight on this would be really helpful!