PDA

View Full Version : 2 FMB questions; spawn #s and artillery



ATAG_Ezzie
Oct-03-2014, 07:57
Me again with another question or 2.

(a) If i create an airfield with 4 x spawn points does that mean the maximum number of aircraft that can be spawned on the base at any one time is 4? If so what has to happen to those aircraft before another aircraft can spawn in? ie if one of those aircraft takes off can a new a/c spawn in its place? Or does one of the 4 a/c have to be destroyed before a new aircraft can spawn in?

(b) Artillery - does artillery work in COD? I'm creating 2 x airfields (1 x red, 1 x blue) in enemy territory and would like some indirect fire to lob on the field from time to time. i can create this in IL46 but have just spent the past hour trying to get the 1 artillery piece i can find to lob shells onto one of these fields to no avail. Is there a trick to getting it to work or is it not working at the moment?

Thanks

Ezzie

No601_Swallow
Oct-03-2014, 09:22
a) This is actually the biggest gap in my knowledge of the mechanics of this "lore". I honestly don't know. Firstly, if all the spawn points are occupied, the game will throw the next aircraft due east about 500 yards. So pilots will end up in a field, or a village or rolling down a slope into the Valley of the Damned. This is also what happens if a spawn point doesn't work for some reason. Why does CloD do this? Fish.

Now, I had assumed that the spawn point would become free after a short period of time after the departure of the aircraft that had previously spawned. But now I think either the spawn point remains occupied of a long period of time (certainly more than 15 minutes) or only becomes free again after the first aircraft is destroyed. It's hard to test this. (At least it's been hard for me to test. Obviously.)

So, the workarounds for this workaround are: 1) Have a robust despawning script for when an aircraft is abandoned by its pilot. Here's the basic script that we start with (it also enables triggers, and is cobbled together from several other scripts written by people who know what they're doing):


using System;using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;




public class Mission : AMission
{


public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);


AiAction Action = GamePlay.gpGetAction(shortName);


if (Action != null)
Action.Do();


GamePlay.gpGetTrigger(shortName).Enable = false;
}




private bool isAiControlledPlane(AiAircraft aircraft)
{
if (aircraft == null)
{
return false;
}


Player[] players = GamePlay.gpRemotePlayers();
foreach (Player p in players)
{
if (p != null && (p.Place() is AiAircraft) && (p.Place() as AiAircraft) == aircraft)
{
return false;
}
}
return true;
}

public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceLeave(player, actor, placeIndex);
Timeout(1, () =>
{ damageAiControlledPlane(actor); }
);
}

private void damageAiControlledPlane(AiActor actor)
{
if (actor == null || !(actor is AiAircraft))
{
return;
}


AiAircraft aircraft = (actor as AiAircraft);


if (!isAiControlledPlane(aircraft))
{
return;
}


if (aircraft == null)
{
return;
}


aircraft.hitNamed(part.NamedDamageTypes.ControlsEl evatorDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsAi leronsDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsRu dderDisabled);
aircraft.hitNamed(part.NamedDamageTypes.FuelPumpFa ilure);
aircraft.hitNamed(part.NamedDamageTypes.Eng0TotalF ailure);
aircraft.hitNamed(part.NamedDamageTypes.Eng1TotalF ailure);


Timeout(5, () =>
{ destroyPlane(aircraft); }
);
}

private void destroyPlane(AiAircraft aircraft)
{
if (aircraft != null)
{
aircraft.Destroy();
}
}
}

The second workaround is to have lots of spawning places. For the Storm of War online orgy of death, they tried with about fifteen or twenty spawn locations per base. These weren't nearly enough. I'd have thought 25 or 30 for a full scale inter-squadron destructofest. For my squadron (we do historically based coop-style missions mostly against AI opposition, we know the numbers, so I make sure there are 15 or 24 (or whatever) spawn locations. We prefer to spawn on the runway without the hassle of taxiing, so the spawn trees are fairly bespoke. (I've tried to build up a library of airfield layouts - see the link in my sig.).

In an ideal world, TF would have access to the game code and would be able to write in or tweak the rules governing when spawn locations become free. Alas, we live in the real world. Boooo!

b) I also don't know! I think the artillary AI will just fire as much as possible and as rapidly as possible at whatever enemies they detect. I don't know if this can be modified in the FMB object browser or by script (perhaps periodically spawning and despawning an "enemy" dragon-tooth tank trap might trick the AI into firing sometimes?). I'm sure others will know more.

ATAG_Ezzie
Oct-04-2014, 01:36
Thanks Swallow - I'll keep experimenting then and see what i can do re the spawn and arty fire.

Thanks re the script - I'm leaving delving into scripting until I've populated my airfields, created targets and then figured out what i can do with sub-missions. And I'm sure i will have lots of learning to do along with many questions. I recently purchased a C++ for dummies book as i figure i may as well start at the beginning and see if i can learn to script and understand what I'm doing.

Ezzie

69th_Spiritus_Mortem
Oct-04-2014, 01:38
start at the beginning and see if i can learn to script and understand what I'm doing. Ezzie

Let me know cause I'm still wondering myself. :D

RAF74_Buzzsaw
Oct-04-2014, 02:30
The LeFH_18_Howitzer is the only artillery piece in the game. (this will be corrected for TF 5.0 :-P)

It has a range of 3000 meters. If targets are not within range, it will not fire. Remember a square on the map is 10,000 meters so the gun has to be quite close.

Another issue... if there is an intervening hill or elevated piece of ground, it will fire as if the hill is not there, and hit it. Line of fire is usually traced as if it is line of sight.

Also, if the firing gun is on a piece of ground which is higher than the target, and it cannot lower its barrel enough to hit, it won't fire.

If there is another closer enemy object, then it will fire at that in preference to what you might like it to.

Finally, you need to have targets on the field.

There is an alternative to the LeFH_18_Howitzer, and that is to use one of the heavy flak units such as the 88mm Flak37 or the 3_7_inch_QF_Mk_I. Both have much longer ranges and as long as there no intervening terrain, they should fire.

ATAG_Ezzie
Oct-04-2014, 04:35
Let me know cause I'm still wondering myself. :D

Ha ha -will do SM.

The book cover / back makes it seem like its easy-peasy but looking at the scripts on here I'm not so sure. Only one way to find out I spose.

ATAG_Ezzie
Oct-04-2014, 04:40
The LeFH_18_Howitzer is the only artillery piece in the game. (this will be corrected for TF 5.0 :-P)

It has a range of 3000 meters. If targets are not within range, it will not fire. Remember a square on the map is 10,000 meters so the gun has to be quite close.

Another issue... if there is an intervening hill or elevated piece of ground, it will fire as if the hill is not there, and hit it. Line of fire is usually traced as if it is line of sight.

Also, if the firing gun is on a piece of ground which is higher than the target, and it cannot lower its barrel enough to hit, it won't fire.

If there is another closer enemy object, then it will fire at that in preference to what you might like it to.

Finally, you need to have targets on the field.

There is an alternative to the LeFH_18_Howitzer, and that is to use one of the heavy flak units such as the 88mm Flak37 or the 3_7_inch_QF_Mk_I. Both have much longer ranges and as long as there no intervening terrain, they should fire.

Thanks Buzz. I eventually figured out the line of sight thing so the arty is firing direct fire rather than indirect fire like I wanted. But it achieves the effect I'm after more or less.

Thanks re the other options -will try those for my next airfield in enemy territory and see what they are like. I like the howitzer's ground burst explosion but am not sure if the 88 and 3.7 will ground or air burst. Will experiment and see.

Thanks

Ezzie

SoW Reddog
Oct-04-2014, 05:36
Thanks Swallow - I'll keep experimenting then and see what i can do re the spawn and arty fire.

Thanks re the script - I'm leaving delving into scripting until I've populated my airfields, created targets and then figured out what i can do with sub-missions. And I'm sure i will have lots of learning to do along with many questions. I recently purchased a C++ for dummies book as i figure i may as well start at the beginning and see if i can learn to script and understand what I'm doing.

Ezzie

Cliffs uses C#, not C++

ATAG_Ezzie
Oct-04-2014, 07:21
Cliffs uses C#, not C++

Ohhhh......

Thanks Reddog - i'm laughing at my own incompetence......

Like i said I've got lots to learn - including what is the correct programming language it seems.....

Thanks - would have been painful to have learnt the wrong language and done scripts etc, so thanks for letting me know.

Ezzie

ATAG_Bliss
Oct-04-2014, 12:44
Me again with another question or 2.

(a) If i create an airfield with 4 x spawn points does that mean the maximum number of aircraft that can be spawned on the base at any one time is 4? If so what has to happen to those aircraft before another aircraft can spawn in? ie if one of those aircraft takes off can a new a/c spawn in its place? Or does one of the 4 a/c have to be destroyed before a new aircraft can spawn in?

(b) Artillery - does artillery work in COD? I'm creating 2 x airfields (1 x red, 1 x blue) in enemy territory and would like some indirect fire to lob on the field from time to time. i can create this in IL46 but have just spent the past hour trying to get the 1 artillery piece i can find to lob shells onto one of these fields to no avail. Is there a trick to getting it to work or is it not working at the moment?

Thanks

Ezzie

If you only have 4 spawn points and all 4 are currently occupied, I'm fairly positive the next plane that attempts to spawn will just spawn in the air (air spawn). This is how it worked in old IL2 when all the spawn points were filled up. As far as arty - no idea :D

ATAG_Ezzie
Oct-04-2014, 17:35
Thanks Bliss.

I'll check out this spawn question when i start testing it and see what happens.

Ezzie