Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot spawn new aircraft #113

Open
fyyyyy opened this issue Jan 11, 2022 · 2 comments
Open

Cannot spawn new aircraft #113

fyyyyy opened this issue Jan 11, 2022 · 2 comments

Comments

@fyyyyy
Copy link

fyyyyy commented Jan 11, 2022

I figured out how to call the method without errors ( already corrected the AICreateNonATCAircraft args types as in issue #112 )
This script runs fine, but the aircraft doesn't seem to appear in MSFS at Lat 40,Lng-74

from SimConnect import *
from ctypes import *
sm = SimConnect()
aq = AircraftRequests(sm, _time=3)
ae = AircraftEvents(sm)


# get class definition for SIMCONNECT_DATA_INITPOSITION
sm_types = sm.dll.AICreateNonATCAircraft.__ctypes_from_outparam__()
INIT_POSITION = sm_types.argtypes[3]

initPos = INIT_POSITION(c_double(40), c_double(-74), c_double(2000), c_double(0), c_double(0), c_double(0), DWORD(0), DWORD(-1))

sm.dll.AICreateNonATCAircraft( sm.hSimConnect, c_char_p(b"Boeing 747-8f Asobo"), c_char_p(b"ABCD"), initPos, 123 )
@bolichin
Copy link

Hi, can someone explain if this is posible? I test the code but I obtain an error

@bolichin
Copy link

bolichin commented Nov 23, 2024

Capture
Hy return with this code and some good news, I just made that insert a Giraffe with this code maybe can help to others... close to MMVR GA parking

from SimConnect import *
from ctypes import *

# Inicialización de SimConnect
sm = SimConnect()
aq = AircraftRequests(sm, _time=3)
ae = AircraftEvents(sm)
giraffeID= 0

# Obtén la definición de clase para SIMCONNECT_DATA_INITPOSITION
sm_types = sm.dll.AICreateSimulatedObject.__ctypes_from_outparam__()
INIT_POSITION = sm_types.argtypes[2]  # Esta hay que activarla para AICreateSimulatedObject

InitPos = INIT_POSITION(
    c_double(19.1413), 
    c_double(-96.1849), 
    c_double(76.6), 
    c_double(0.0), 
    c_double(0.0), 
    c_double(0.0), 
    DWORD(1), 
    DWORD(0)
)

# Crear el objeto simulado y asignar el callback
sm.dll.AICreateSimulatedObject(sm.hSimConnect, c_char_p(b"ReticulatedGiraffe"), InitPos, giraffeID)

Next step make that giraffe moves... If I understand well the SDK 2020 maybe seem that is only posible if some array of waypoint will be atached to the simobject, but at this moment my skills doesn't work maybe someone else can help to implement the movement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants