Im making a space map and i need help figuring out how to make the star fighters spawn in while in space. What im talking about is, when you drift of away from your mothership enemy and friendly ships just come from nowhere.
I know they do this in every stock map and some modded maps, but i just need help figuring it out
Help With Spawning Star fighters [Solved]
Moderator: Moderators
- Lorul1
- Rebel Colonel

- Posts: 562
- Joined: Wed Apr 24, 2013 10:34 pm
- Projects :: Assault on Theed
- xbox live or psn: No gamertag set
- Location: Your House
Help With Spawning Star fighters [Solved]
Last edited by Lorul1 on Mon Jun 23, 2014 11:32 pm, edited 1 time in total.
- Locutus
- 1st Lieutenant

- Posts: 420
- Joined: Fri Jun 04, 2010 10:08 am
- Projects :: Stargate Battlefront Pegasus
- Location: Germany
- Contact:
Re: Help With Spawning Star fighters
I don't know what causes the bug that makes fighter magically appear out of nowhere at the map edges but regarding space spawn your possibilities are limited.
Unfortunately you can't spawn vehicles via lua (well, technically you can but they're not usable in that case) so what you have left is either pre-placing them in ZE (means, no respawn) or using a regular vehicle spawn.
When using a vehicle spawn, I assume you want your vehicles do sth. in space and not just standing around. The simplest solution here is to change the pilot type of your fighter to "vehicleself". It can be entered by soldiers but the fighter also acts on its own. But be aware that adding this behavior will break your map for MP. The second possibility would be forcing an AI player into the fighter.
This is some working code I was using for the Stargate mod map:
Note that in this example the spawned vehicle can stay idle for some time in case we don't have a character spawn immediately after the vehicle spawn.
I am currently trying to find a workaround but it's not working properly:
Hope that helps a bit, though I'm currently also looking for a solution and would also be glad about help^^
Unfortunately you can't spawn vehicles via lua (well, technically you can but they're not usable in that case) so what you have left is either pre-placing them in ZE (means, no respawn) or using a regular vehicle spawn.
When using a vehicle spawn, I assume you want your vehicles do sth. in space and not just standing around. The simplest solution here is to change the pilot type of your fighter to "vehicleself". It can be entered by soldiers but the fighter also acts on its own. But be aware that adding this behavior will break your map for MP. The second possibility would be forcing an AI player into the fighter.
This is some working code I was using for the Stargate mod map:
Hidden/Spoiler:
I am currently trying to find a workaround but it's not working properly:
Hidden/Spoiler:
- Lorul1
- Rebel Colonel

- Posts: 562
- Joined: Wed Apr 24, 2013 10:34 pm
- Projects :: Assault on Theed
- xbox live or psn: No gamertag set
- Location: Your House
Re: Help With Spawning Star fighters
Okay thanks locutus
I never saw the ships coming from nowhere as a bug, rather a fix for a lack of star fighters. Maybe a fix that the game designers never shiped to modtools after final testing. (Along with the correct color for the geonosis dirt, and tantive 4 walls with panels). but thank you for the explanation and different methods I can try
Also I would like to help you with your workaround, however I know little to nothing about programming and by the look of your script you probably know alot more that I do. I'm just a 15 year old that picked up modding battlefront 2
.For now I only know as much Lua as I need but, one day when I learn more about programing in LUA I would be glad help you with your workaround.
Thanks again.
I never saw the ships coming from nowhere as a bug, rather a fix for a lack of star fighters. Maybe a fix that the game designers never shiped to modtools after final testing. (Along with the correct color for the geonosis dirt, and tantive 4 walls with panels). but thank you for the explanation and different methods I can try
Also I would like to help you with your workaround, however I know little to nothing about programming and by the look of your script you probably know alot more that I do. I'm just a 15 year old that picked up modding battlefront 2
Thanks again.
