Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 09-24-2011, 08:32 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Mington View Post

How can I detect that a damaged plane in an RTB-ing four-flight is inbound to the airfield to possibly make a crash landing?

Detect the plane passing some distance-radius from the runway let's focus on that
Here is list of methods published here before which are quite self-explanatory (more methods were added in recent beta patch)

Code:
  protected AMission ()
 public virtual void Init (maddox.game.ABattle battle, int missionNumber)
 public virtual void Inited ()
 public virtual bool IsMissionListener (int missionNumber)
 public virtual void OnActorCreated (int missionNumber, string shortName, maddox.game.world.AiActor actor)
 public virtual void OnActorDamaged (int missionNumber, string shortName, maddox.game.world.AiActor actor, maddox.game.world.AiDamageInitiator initiator, part.NamedDamageTypes damageType)
 public virtual void OnActorDead (int missionNumber, string shortName, maddox.game.world.AiActor actor, System.Collections.Generic.List <DamagerScore> damages)
 public virtual void OnActorDestroyed (int missionNumber, string shortName, maddox.game.world.AiActor actor)
 public virtual void OnActorTaskCompleted (int missionNumber, string shortName, maddox.game.world.AiActor actor)
 public virtual void OnAiAirNewEnemy (maddox.game.world.AiAirEnemyElement element, int army)
 public virtual void OnAircraftCrashLanded (int missionNumber, string shortName, maddox.game.world.AiAircraft aircraft)
 public virtual void OnAircraftCutLimb (int missionNumber, string shortName, maddox.game.world.AiAircraft aircraft, maddox.game.world.AiDamageInitiator initiator, part.LimbNames limbName)
 public virtual void OnAircraftDamaged (int missionNumber, string shortName, maddox.game.world.AiAircraft aircraft, maddox.game.world.AiDamageInitiator initiator, part.NamedDamageTypes damageType)
 public virtual void OnAircraftKilled (int missionNumber, string shortName, maddox.game.world.AiAircraft aircraft)
 public virtual void OnAircraftLanded (int missionNumber, string shortName, maddox.game.world.AiAircraft aircraft)
 public virtual void OnAircraftLimbDamaged (int missionNumber, string shortName, maddox.game.world.AiAircraft aircraft, maddox.game.world.AiLimbDamage limbDamage)
 public virtual void OnAircraftTookOff (int missionNumber, string shortName, maddox.game.world.AiAircraft aircraft)
 public virtual void OnAutopilotOff (maddox.game.world.AiActor actor, int placeIndex)
 public virtual void OnAutopilotOn (maddox.game.world.AiActor actor, int placeIndex)
 public virtual void OnBattleInit ()
 public virtual void OnBattleStarted ()
 public virtual void OnBattleStoped ()
 public virtual void OnCarter (maddox.game.world.AiActor actor, int placeIndex)
 public virtual void OnMissionLoaded (int missionNumber)
 public virtual void OnPersonHealth (maddox.game.world.AiPerson person, maddox.game.world.AiDamageInitiator initiator, float deltaHealth)
 public virtual void OnPersonMoved (maddox.game.world.AiPerson person, maddox.game.world.AiActor fromCart, int fromPlaceIndex)
 public virtual void OnPersonParachuteFailed (maddox.game.world.AiPerson person)
 public virtual void OnPersonParachuteLanded (maddox.game.world.AiPerson person)
 public virtual void OnPlaceEnter (maddox.game.Player player, maddox.game.world.AiActor actor, int placeIndex)
 public virtual void OnPlaceLeave (maddox.game.Player player, maddox.game.world.AiActor actor, int placeIndex)
 public virtual void OnPlayerArmy (maddox.game.Player player, int army)
 public virtual void OnPlayerConnected (maddox.game.Player player)
 public virtual void OnPlayerDisconnected (maddox.game.Player player, string diagnostic)
 public virtual void OnSingleBattleSuccess (bool success)
 public virtual void OnTickGame ()
 public virtual void OnTickReal ()
 public virtual void OnTrigger (int missionNumber, string shortName, bool active)
 public virtual void Timeout (double sec, maddox.game.DoTimeout doTimeout)

 public maddox.game.ABattle Battle {get;}
 public maddox.game.IGamePlay GamePlay {get;}
 public int MissionNumber {get;}
 public int MissionNumberListener {set; get;}
 public maddox.game.world.ITime Time {get;}
Not being a C# expert but just having read 80% of samples posted here I guess you can use OnAircraftDamaged and OnAircraftLimbDamaged and OnAircraftCutLimb to start calculating distance from the damaged aircraft to the closest airfield. Then you can generate a new landing waypoint for the damaged group at this airfield. There is a "distance" function used in naryv examples and in vetochka campaign. Waypoint generation is also used in naryv examples. When the distance is appropriate you let an ambulance to start its way to a runway.

Another way is to use onTrigger method with really big trigger radius around an airfield and check what aircraft parts are damaged. There was a sample script posted in the main section that prints out damaged parts to a chat window. Therefore I guess it is possible to do this.

The 3rd alternative could be to combine both of the above ways and flag a damaged group OnAircraftDamaged and then onTrigger check if the incoming group is flagged as damaged. Again I do not know C# and can be wrong. It is better to start a new thread with these particular questions where real experts will offer their solutions.

hc_wolf combined several naryv examples and others' scripts into one mission. You can have a look at how he did this and do the same if you know C#. If no one can answer questions on this forums you can ask naryv directly as adonys did in this thread http://www.sukhoi.ru/forum/showthrea...=1#post1647624
Sometimes naryv does not answer if the functionality requested is not ready yet or does not work properly or is changing at the moment. All script methods are WIP I think ATM.

We will not see the manual till engine functionality and script methods are 90% finalized imho because there is no point to spend time on a manual that will not be valid in 2 months. I expect it to come with Battle for Moscow at the earliest. But again if you know C# you can find all necessary information on this forums in naryv, adonys, Kodiak, Wolf, TheEnlightenedFlorist, vetochka, stillborn, etc. examples.

Scripting discussion was started 5 months ago in this thread (Yes, I know it is hard for the first 6-8 weeks till you learn some basics ) http://forum.1cpublishing.eu/showthread.php?t=21518
Many of my noob's questions were answered there by С# programmers. Again this forum section has more then enough information to start programming for CloD if you know C# basics at least. Guys and a lady mentioned above have proved it many times already. This forum section is only 9 pages long not too much to look though to get all the information needed to be able do the same imho.

ps. Of cause I would be more than happy if Kodiak or other C# programmers agree to publish some tutorials but for me it is not clear if the tutorials should be about C# basics or about CloD methods and functions.

Last edited by Ataros; 09-24-2011 at 09:15 AM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.