How do i add ai fighter planes to my mod?

Hello comrades!

I am about to finish my newest hangar mod, and wanted to create ai fighter planes like yak3 and bf109 flying past the map. I already tried using @ErikaKalkbrenner post about how to create ai planes, but i still have problems.

As told, i tried getting the ai plane model, but there are no fighter planes such as the bf109 or yak3, only bombers are available. I tried replacing the character model, it worked, but i got error messages.

There must be a way to create ai fighter planes without gettint error codes right?

Could someone maybe explain to me how i can spawn ai fighter planes flying towards their target?

2 Likes
entity{
  _template:t="fw_190a_4_stalingrad_battlepass_premium+ai_aircraft+ai_aircraft_crew_ger+plane_spawn_in_air+aircraft_with_gun_redirect"
  transform:m=[[0.985868, 0.167439, -0.00534356] [-0.167487, 0.984477, -0.0524627] [-0.00352368, 0.0526162, 0.998609] [-1383.25, 118.068, -321.828]]
  ai_aircraft__flyPos:p3=2207.66, 157.895, -353.789
}

just add the airplane, and then the postfixes.

make sure to some rendinsts or other planes position as destinations.

but, errors don’t really matter as long they don’t make your game crash.

4 Likes

I worked so hard on losing my error code while modding the thunder and rain, finally i got it.

I think my mod looks great now, and i really would not like to ruin it with an error code… i know it is a small thing, but i really really do not want the code…

1 Like

You can use not only ai planes. Also other planes too. Just don’t forgot to add more postfix templates.

In short:
Create on map aircraft entity with +ai_aircraft+ai_aircraft_crew_X+plane_spawn_in_air+aircraft_with_gun_redirect in postfix templates line. And then move object to air. After that in properties panel set ai_aircraft__flyPos.

X can be: sov, usa, uk , ger , it, jap and moroc.

2 Likes

It kinda does work, but as soon as i want to spawn the plane on the ground, it immideatly explodes… When i freeze time and place it down, the time suddently starts going again and it still explodes…

What can i do?

try replace plane_spawn_in_airwith plane_spawn_on_carrier




If it still have box then it will be looks fine after restart.

It’s… Weird. Time is being forcibly started only when you edit rendinsts or load map.
Ah… You probably mean that when you restart editor and then planes change possition?
Well… I think you can add item_in_world postfix to plane.
Better to do it from lower panel. Click on +.

image

image

As result it will save position. And when you will plan to post map then… Just remove this postfix (click on -).

2 Likes