16
Modding / Re: Misc modding questions that are too minor to warrant their own thread
« on: February 20, 2023, 12:53:13 AM »
What is the correct usage of CombatEngineAPI.spawnProjectile(ShipAPI ship, WeaponAPI weapon, String weaponId, String projSpecId, Vector2f point, float angle, Vector2f shipVelocity);?
Every time I have tried to use it, it crashes with a nullpointerexception in the constructor of either MovingRay or BallisticProjectile. For example calling this method with non-null variables, and with the strings "lightdualac" and "lightdualac_shot" will cause a crash. This makes it impossible to spawn projectiles that are indirectly spawned via MIRV missiles, e.g. the "sabot_warhead2" projectile. Can this be clarified please?
Every time I have tried to use it, it crashes with a nullpointerexception in the constructor of either MovingRay or BallisticProjectile. For example calling this method with non-null variables, and with the strings "lightdualac" and "lightdualac_shot" will cause a crash. This makes it impossible to spawn projectiles that are indirectly spawned via MIRV missiles, e.g. the "sabot_warhead2" projectile. Can this be clarified please?