Self flying planes

For info on the site, community and 'battlefieldy' things
Post Reply
jdc527
Posts: 36
Joined: Mon Aug 31, 2020 8:39 pm

Self flying planes

Post by jdc527 »

Saw the video Senshi posted some time back that had b17s flying apparently by code. I’ve also seen this in a DDay map of Ste. Mere Eglise that had flying C47s as spawn points.
Can someone tell or show me how?
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Self flying planes

Post by freddy »

Do you have a link to that video? It would be easier to figure out what he done to the plane. Often you can just place a vehicle spawner on a rotational bundle (think the radar thats on some ships) and modify it speed/radius and such.

You can tie a soldierspawn to a plane easy, there is a map in one of the expansion packs that does just this (mimoyecques or essen? not sure)
jdc527
Posts: 36
Joined: Mon Aug 31, 2020 8:39 pm

Re: Self flying planes

Post by jdc527 »

Sorry for the late reply, didn’t see you’d commented! Here’s the video. Senshi calls them ghost aircraft.

https://youtu.be/WYZSGBZI6uQ?si=PObcwcIkt0dvMGes
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Self flying planes

Post by Senshi »

Haha, nothing so fancy.
I actually still have the code for this little gimmick:
https://pixeldrain.com/u/CpwfDNc6

This was actually one of the very first new "mods" that I did back then! Mod is a strong word, it's just cleverly combining a couple of things.


The actual trick is very easy. It's a regular ObjectSpawner spawning a slightly altered B17 PCO.

Put this on the ObjectTemplate (objects.con)
ObjectTemplate.setForwardMod 35

This applies a forward momentum when the object spawns. The higher, the faster.
Then, make sure there's nothing there to slow down or speed up the object: Twiddle with inertiaModifieder, and set drag to 0.


This means it's a simple empty PCO, so you can just enter this as as a player as well. Also, the engine rotors wouldn't be spinning and there would be no sound.
So all the other code changes are in place to make the rotors alwasy turning and play the engine sound all the time to make it seem "alive".

As it's a "true" object, the nice part is that it can still be damaged, collided with and shot down, so you have full flexibility.
By default, it's also visible on the minimap (as an empty vehicle), so you'd have to replace the icon with an empty one to hide it, if so desired. As said, many possibilites.

If you want it to be very reliable, you obviously need to make it invulnerable and especially disable any physics interactions, so it can't be knocked off course. My B17Robot above simply floats forward. The tiniest collision would make it go off course, and it's not invulnerable either, so it dies on collision (or when leaving the map, as shown at the end of the video).
Post Reply