PatrickAWlson Posted December 30, 2015 Posted December 30, 2015 Basic problem: I spawn n number of aircraft in a formation and then tell them to follow a set of way points. It looks something like this: CZ Timer Spawn Timer -> Spawn (aircraft) Spawn Timer -> Spawn (aircraft) (TL to first spawn) Spawn Timer -> Spawn (aircraft) (TL to first spawn) Activate Timer -> Activate flight leader (OL to first spawn) Formation Timer -> Formation (OL to first spawn) WP Timer -> WP The first aircraft spawned flies the route but the others do not. Obviously they do not understand that they are subordinates to the first aircraft, so they circle with no effective orders. In the game if this same sequence is used without spawns everything works. It is the act of spawning that causes the aircraft to fail to grasp the fact that they are together. Any ideas?
JimTM Posted December 30, 2015 Posted December 30, 2015 No ideas right now but you can check out this post: http://forum.il2sturmovik.com/topic/14945-wings-and-spawner/
Jupp Posted December 30, 2015 Posted December 30, 2015 (edited) ~S~ Pat, The secret sauce for me is having an "OnPlaneSpawned" Event linked to the first Waypoint. Now then, I do not remember how to recreate this set up, but one fine day I managed to do it. Anyway, here is what I mean, and an example group for you to make use of. Glad to be of help. 3 109e7 in Formation to First Waypoint : https://www.dropbox.com/s/9ip9tohvsoqm9kv/3%20109e7%20Group.zip?dl=0 Also to note, I've found using Activate for aircraft and Spawn for ground objects to work out best. And of course, an 8 minute minimal delay of respawning for any "static" ground objects. Aircraft do not need to worry about spawning into the wreckage of a destroyed unit, whereas most "static" ground objects do. The rate of object deletion has been clocked at 7 min 30 sec. When using a Timer (delay) to Activate to Object Link to the AI Aircraft make sure that Enabled is Unticked as shown in the picture above. The end result is the same as using a "Spawner". Keep 'em Flying, !S -Jupp- P/S- Happy New Year's and Thank You!!! for your efforts in our hobby! Edited December 30, 2015 by Jupp
coconut Posted December 30, 2015 Posted December 30, 2015 Jupp, that won't work for what Pat is trying to do. If you spawn planes that are linked to a leader, the game will spawn independent planes that are unaware of the fact that they are supposed to be part of a flight. In Pat's case, I suppose re-spawning is not of interest. In that case, all Pat needs to do is use activate inspead of spawn, and make sure the checkbox "enabled" is not checked for each plane. It is only necessary to activate the leader, no need to activate all planes in the flight.
Jupp Posted December 30, 2015 Posted December 30, 2015 (edited) ~S~ Coconut, The group I posted does not respawn, however, it is delayable, or, whatever you'd like to trigger it... I used, Mission Begin, in this group. Also, you can review what I've offered, and it does work. Nearly exactly as you've explained, I have done (activating all in flight though). And you also, have contributed above and beyond to this hobby, and I thank you for that as well. Check my work, it does work perfectly well. Blue Skies, !S -Jupp- Edited December 30, 2015 by Jupp
coconut Posted December 30, 2015 Posted December 30, 2015 (edited) Jupp, Indeed, your group works. But it uses activate, not spawn, and that's the point I want to emphasize here. Edited December 30, 2015 by coconut
Gitano_Fraile Posted December 30, 2015 Posted December 30, 2015 the same thing happened to me, it seems that when one uses the MCUs spawn, the TL of others are not loaded. Perhaps as coconut says, you have to first make the spawn and then activate the flight and thus the TL numerals are activated correctly
PatrickAWlson Posted December 30, 2015 Author Posted December 30, 2015 (edited) Jupp, Indeed, your group works. But it uses activate, not spawn, and that's the point I want to emphasize here. I can't really use activate because that mechanism does not allow me to move the plane. PWCG uses "virtual way points" (VWP) - a fairly complex set of moving check zones that simulates a flight path. 1. VWP #1 is activated. A check zone is in effect. A timer is set. If the timer times out before the CZ is triggered the following happens: - Destroy the current CZ - Establish a new CZ further along the flight path. In this way the path of a flight is emulated by the moving CZs. This continues until either all VWPs have been hit or a CZ has actually triggered due to proximity with the player. 2. If a CZ triggers - Spawn the aircraft - Kill all future CZs - Let the aircraft fly their mission A real flight path is emulated without taking the CPU hit of actually having the aircraft actively flying. It allows me to put dozens of aircraft into the air and the only ones that ever spawn are the ones that you run into. Each flight flying its own mission is an integral part of PWCG. Even the same mission will play out differently if you fly it differently. There is never a group of bad guys waiting at a spot for you to arrive. Every other flight is truly going about its business. In an ideal world I would not need VWPs at all and I would just put 60 aircraft in the air. But most people's computers couldn't handle that. I was hoping that somebody would have an answer as to how to join units after they spawn. If that is not possible I have a backup - I can make each plane fly the way points independently. It will look sort of like a formation. At least they won't circle. @Moro: i do activate after all of the aircraft spawn. Each step is separated by a timer: CZ->Spawn->Spawn ,,, ->Spawn last->activate (OL to flight leader)->formation(OL to flight leader)->WP(OL to flight leader) I was hoping that would solve the problem but it does not. Appreciate the feedback Edited December 30, 2015 by PatrickAWlson
coconut Posted December 30, 2015 Posted December 30, 2015 There is another solution: duplicate the flight at each virtual waypoint. As long as you make sure no more than one flight is activated, that should do the trick. You might have to duplicate the logic associated to the flight, which isn't pleasant to do in a hand-made mission, but since you are generating it programmatically, that should not be a problem. I think you can go up to 20000 waypoints before you start running into problems.
PatrickAWlson Posted December 30, 2015 Author Posted December 30, 2015 A full flight at every spawn point would amount to ... not sure ... but upwards of 1000 or more aircraft in the mission. It would amount to a significant rewrite of all of the logic around VWPs. Gut feel is that wouldn't work out. Seems like the best option is duplicating the WPs (with a slight offset to avoid crashes) for every plane and just let each plane independently follow the WPs. That I can manage in about a week. If they all spawn at the same time they will pretty much fly the route in something resembling formation.
Gitano_Fraile Posted January 11, 2016 Posted January 11, 2016 I wonder if this problem also occurs in the rof, or design something that can be corrected if we ask the devs
PatrickAWlson Posted January 18, 2016 Author Posted January 18, 2016 It's not as bad in RoF but it's still there. I think that if I take a single plane and spawn it multiple times it might work. However, I refuse to do that as that would mean every plane is a clone. Anyhow, making each plane an individual is working in 1.2 (soon to be released). To me it's even better than using the formation. The planes are naturally in formation and fly smoothly. When you use the AI formation you get the jittery constant correction and the wobbly business of trying to keep formation. If you notice the lead is usually smooth while the rest of the formation is all over the place. Right now all of the planes fly smoothly and in perfect formation until they engage in combat.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now