![]() |
|
#1
|
|||
|
|||
![]()
+1 for the despawn waypoint.
I currently have a major headache with the script Trigger-Action Commands. I need an AI ac to land and for that ac to spawn another AI to take off. That results (or would) in a unwanted ground object doing nothing and showing up on the map if icons are enabled (despawn would be nice and simple for me). It should be possible to do this using the 'Group' and Passthorugh (an area on the runway) to act as a trigger but there appears to be a bug in that anything that lands automatically taxis to the same spawn point needed for the newly spawned ac - so it doesn't spawn! If you place an object on the runway and destroy the ac on the runway - the new ac spawns. You can use group and all the other commands with 'passthrough' to spawn Airgroups except a 'group' with a landing waypoint! So, if there is a script please let me know or alternatively, can we also have a 're-arm' way point for AI ac to 'land - wait - and takeoff'! Having spent hours on this problem I selected every available ac to land and they all appear to use the same algorithm for landing irrrespective of the FM for that ac........which may explain why some go 'tits up' on landing and others are OK! If you want to spawn a new AI - use the Anson....it can't land without going 'arse over tip' and your new AI spawns in its Hanger (and the Anson despawns!)..... ![]() Last edited by SEE; 05-20-2011 at 02:34 AM. |
#2
|
|||
|
|||
![]()
I think you can destroy an AC onAircraftLanding or do some damage to it, e.g. kill engine preventing it taxiing to a parking slot.
|
#3
|
||||
|
||||
![]()
OnAircraftLanded() is called only after plane stops. In case of AI, plane stops only after it reaches parking spot.
|
#4
|
|||
|
|||
![]() Quote:
But if you are using both that might help you find your solution. |
#5
|
|||
|
|||
![]()
Hi EnlightenedFLorist,
I will have a look at that, though I have no knowledge of C++ and so far my scripts consist of hacking up other peoples and hoping they work! Im really hoping 1C can include this Despawn idea as a setting in the FMB, it would be most helpful. Anyhoo, I will have a look, do some swearing, and will see what I can come up with. Cheers |
#6
|
|||
|
|||
![]() Quote:
![]() If you need help writing a script, you can post it on the forum and I'm sure there'll be plenty of people willing to help you out. Also, scripts are written in C#, not C++. C# is very much like Java and way easier to work with than C++. I don't want you to go learning C++ when you should be learning C#. ![]() Last edited by TheEnlightenedFlorist; 05-20-2011 at 08:15 AM. |
#7
|
|||
|
|||
![]() Quote:
I will have a look at using triggers and actions within the script itself as some are quite useful. I did have a mission where if one plane was shot down another would spawn... lots of potential with that one. There is a lot to learn, but equally there is a lot we can do that is really interesting. I will post up my next daft script and see what people think later on when im home. Cheers! |
#8
|
|||
|
|||
![]()
If you want to destroy aircraft loaded by submissions do not forget to include
Code:
////////////////////////////////////////////////////////////////////////////////////////////////// //Listen to events of every (sub)mission public override void Init(maddox.game.ABattle battle, int missionNumber) { base.Init(battle, missionNumber); MissionNumberListener = -1; //Listen to events of every mission } ////////////////////////////////////////////////////////////////////////////////////////////////// |
#9
|
|||
|
|||
![]() Quote:
|
#10
|
|||
|
|||
![]()
@ Flashman
Just copy and past anywhere you like. You can always check out my recent script in Online Missions go here thread. @all It seems like this script I use does not destroy ships loaded by a submission. Other ground units are destroyed as intended. What can be wrong? IIRC ships belong to AiGroundActor Code:
//Ground objects (except AA Guns) will die after 55 min when counted from their birth public override void OnActorCreated(int missionNumber, string shortName, AiActor actor) { base.OnActorCreated(missionNumber, shortName, actor); //Ground objects (except AA Guns) will die after 55 min when counted from their birth if (actor is AiGroundActor) if ((actor as AiGroundActor).Type() != maddox.game.world.AiGroundActorType.AAGun) Timeout(3300, () => { if (actor != null) { (actor as AiGroundActor).Destroy(); } } ); } Last edited by Ataros; 05-20-2011 at 12:34 PM. |
![]() |
|
|