![]() |
how to remove AI planes and AI vehicles?
1 Attachment(s)
hey guys....im just building a mission, where i try to load submissions randomly into one main mission.
what i dont know how to achieve though is, how i can "destroy" ai planes if they have landed, and also vehicles or trains, when they have reached a certain waypoint.... i have attached the complete mission... there is one main mission, and 3 submissions which will be loaded randomly every 30seconds. the problem with it is, that the trains and vehicles will just stay on the map. i would like them to have destroyed when they reach their last waypoint.... in the script, there is a way to "destroy" planes after a certain time, but i would like to change it, that they will get destroyed after they have landed... (i know that this will happen automatically, but only after 10 minutes)i want that the planes are destroyed after maybe 30seconds when they have landed. |
1 Attachment(s)
here is the script only...
|
To remove landed, crashlanded AI-Planes or Groundactors after completing their task :
Code:
using System; |
thx Kodiak...will try that, though im not sure how to implement that part into my already existing one
|
ok the mission now works, so that the submissions will be loaded and also the planes are destroyed after they have landed.
but ground vehicles and trains just remain on the map after they have reached their last waypoint.how can i make it, that they achieve their "task"? HTML Code:
using System; |
Removing Ai-Planes after landing, should work (have tested it), but OnActorTaskCompleted seems to work not correctly. Must make more tests, but in next Patch it should be possible to get the current waypoint from an Actor so should be no problem to remove an Actor if it reached the last waypoint. But we must wait for the patch.
Code:
using System; |
thx Kodiak,..see my above post which i have edited just now...
this time i was able to adjust the script by myself that it worked in the end,...except the ground vehicles of course |
btw,...is there a way, to limit the number of planes with scripting?
cause at it is now, the mission will soon have plenty of planes and the numbers will increase continually. of course its possible to adjust the the script, that the missions will not be loaded that often, or the missions, that the planes will land(destroyed) sooner. but this approach requires much time adjusting the missions, espesially when one has 60+ submissions. so i thought it would be really comfortable, if it would be possible to limit the numbers with the script. if the maximum amount of planes is reached, then the script will not load a new submission, until some planes get shot down, or land(destroyed)... |
yes its possible.
Code:
public int GetSumAllPlanes() Code:
if(GetSumAllPlanes() < maxPlanes) |
thank you Kodiak, without you i would give up on that thing i think,cause for me its like reading chinese....
but if i can implement that "planecounter" in my script above, then i could build a mission, which gets more and more unpredictable with every submission i add... that would be really neat. but i fear i will again have trouble to implement that part correctly into my script... but will try out immediately.. btw, what do you mean with:"before loading a new mission you can check for example"? and where and how do i implement this last line of code? PS: now in my script i have the possibility to "destroy" planes when they land, or after a certain amount of time, but i would like to have the possibility that some planes (bombers) get destroyed when they reach a certain waypoint behind the frontlines....im sure thats possible, but couldnt find it yesterday. |
All times are GMT. The time now is 01:05 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.