#31
|
|||
|
|||
Quote:
Code:
... .. . public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft) { base.OnAircraftCrashLanded(missionNumber, shortName, aircraft); if (!isAiControlledPlane(aircraft)) // SNAFU { //SNAFU Timeout(5, () => { aircraft.Destroy(); }); } return; // SNAFU } // SNAFU public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft) { base.OnAircraftLanded(missionNumber, shortName, aircraft); if (!isAiControlledPlane(aircraft)) // SNAFU { //SNAFU AiAirport NearestAirport = FindNearestAirport(aircraft); if (NearestAirport != null) { PlanesQueue CurPlane = new PlanesQueue(aircraft, NearestAirport, 0); int ArmyPos = 0; CurPlane.health = (float)aircraft.getParameter(part.ParameterTypes.M_Health, -1); if (GamePlay.gpFrontExist()) { ArmyPos = GamePlay.gpFrontArmy(NearestAirport.Pos().x, NearestAirport.Pos().y); } else { ArmyPos = aircraft.Army(); }; if (CurPlane.health < 1f) { CurPlane.State |= ServiceType.EMERGENCY; CurPlane.State |= ServiceType.FIRE; } else if (aircraft.Army() == ArmyPos) { CurPlane.State |= ServiceType.FUEL; CurPlane.State |= ServiceType.AMMO; if (aircraft.Type() == AircraftType.Bomber) CurPlane.State |= ServiceType.BOMBS; }; if (!(aircraft.Army() == ArmyPos)) CurPlane.State |= ServiceType.PRISONERCAPTURE; if (!CurPlanesQueue.Contains(CurPlane)) { CurPlanesQueue.Add(CurPlane); CheckEmrgCarOnAirport(CurPlanesQueue.Count - 1); } else { for (int i = 0; i < CurPlanesQueue.Count; i++) if (CurPlanesQueue[i] == CurPlane) { CheckEmrgCarOnAirport(i); break; } } CurPlane = null; }; } return; // SNAFU } // SNAFU }
__________________
http://cornedebrouwer.nl/cf48e |
#32
|
|||
|
|||
Yes that's looking good
I haven't tested your one but it should work. I left in the condition to check for an airfield and added the condition to check for player planes: Code:
public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft) { base.OnAircraftLanded(missionNumber, shortName, aircraft); AiAirport NearestAirport = FindNearestAirport(aircraft); //if (NearestAirport != null) if ((NearestAirport != null) && (!isAiControlledPlane(aircraft))) { PlanesQueue CurPlane = new PlanesQueue(aircraft, NearestAirport, 0); int ArmyPos = 0; CurPlane.health = (float)aircraft.getParameter(part.ParameterTypes.M_Health, -1); if (GamePlay.gpFrontExist()) { ArmyPos = GamePlay.gpFrontArmy(NearestAirport.Pos().x, NearestAirport.Pos().y); } else { ArmyPos = aircraft.Army(); }; if (CurPlane.health < 1f) { CurPlane.State |= ServiceType.EMERGENCY; CurPlane.State |= ServiceType.FIRE; } else if (aircraft.Army() == ArmyPos) { CurPlane.State |= ServiceType.FUEL; CurPlane.State |= ServiceType.AMMO; if (aircraft.Type() == AircraftType.Bomber) CurPlane.State |= ServiceType.BOMBS; }; if (!(aircraft.Army() == ArmyPos)) CurPlane.State |= ServiceType.PRISONERCAPTURE; if (!CurPlanesQueue.Contains(CurPlane)) { CurPlanesQueue.Add(CurPlane); CheckEmrgCarOnAirport(CurPlanesQueue.Count - 1); } else { for (int i = 0; i < CurPlanesQueue.Count; i++) if (CurPlanesQueue[i] == CurPlane) { CheckEmrgCarOnAirport(i); break; } } CurPlane = null; }; } If you've got any hints for setting up a repair script, please share I can't find the scripting commands in the beta code, so any pointers would be welcome! I'm hoping that we can get a reference page for scripting commands on a wiki, much like this one: http://community.bistudio.com/wiki/C...Commands_ArmA2 That would be really useful. |
#33
|
|||
|
|||
Quote:
Regarding spawn delay I have a concern: what happens when a marker is captured and then a delayed spawn of a defending tank group occurs? Probably the marker color changes again and it is recaptured by the defending side? |
#34
|
|||
|
|||
Hey all I'm new to Cliffs FMB but long time lurker here and decided to register as this script has me stumped.
So I have made my MP Dogfight Mission, its ready and working. So can someone give me a quite instruction on how to put this ambulance script into my game (which ever script is best). Sorry if its real simple by the way but i cant understand how to. Thank you Gerbil M |
#35
|
|||
|
|||
1. Copy and paste the script to notepad and save as a .cs file (not .cs.txt !!!) The file must have the same name as the mission .mis file.
2. Put the .cs file in the same directory as .mis file. 3. Run the mission. |
#36
|
|||
|
|||
Ah rgr i see thank you Ataros will test soon so this should work for every airfield in my MP map?
Last edited by Gerbil Maximus; 09-24-2011 at 01:42 PM. |
#37
|
|||
|
|||
Gerbil you can also add the script to your mission by- after the copy operation Ataros speaks of above, if your FMB is running and you are looking at your mission, you can go to the Script tab and paste the text in there to create the script. This can be easier than finding the mission on your computer
(I tell you this to point out that CoD is Windows-friendly, standard Windows operations like Ctrl + v work) Ming |
#38
|
|||
|
|||
Rgr Thank you
|
#39
|
|||
|
|||
Quote:
Thanks |
#40
|
|||
|
|||
Load a ready submission which contains an aircraft or dynamical create a submission file with a script and then load it. Check out how naryv creates tanks in his examples attached in a sticky thread above.
|
|
|