Page 1 of 1
How to stop AI pilots ceashing into wall? [Partially Solved]
Posted: Sun Dec 06, 2015 1:54 pm
by RubikPanda
Hi again, sorry for troubling everybody again.
I'm using the dockingbay asset from Tatooine as, well, a dockingbay. At the moment there's two x-wings inside it, however, everything the AI take off they slam right into its wall. I used barriers and highlighted all the walls and made sure that flyers aren't allowed to touch them, however they
still slam into it.
The dockingbay itself set into the ground:
Any better way?
Re: Best way to prevent AI pilots from crashing into wall?
Posted: Sun Dec 06, 2015 2:13 pm
by thelegend
I see two ways of doing it.
1st. Setting up a flyer spline that directly leads out of the dockingbay (which are always important when making maps with flyers) or..
2nd. Changing the takeoff height of your xwings. If you are using custom sides (e.g. custom all.lvl) then you can simply edit the needed lines.
Find this part and replace it with this example (I use this example in my map too since I also have dockingbays and buildings around it so flyers won't crash into anything during their take off:
default:
Code: Select all
TakeoffTime = "1"
TakeoffSpeed = "10"
LandingTime = "1"
LandingSpeed = "10"
TakeoffHeight = "1.5"
my example:
Code: Select all
TakeoffTime = "2"
TakeoffSpeed = "12"
LandingTime = "2"
LandingSpeed = "9"
TakeoffHeight = "1.5"
Note: You don't need to replace LandingTime and LandingSpeed with mine. I only used them so the speeds would look similair. But it's up to you.
Re: Best way to prevent AI pilots from crashing into wall?
Posted: Sun Dec 06, 2015 2:15 pm
by TheMastermindOfMaom
Just a question,what tutorial did you use for adding ships into ground levels?
Re: Best way to prevent AI pilots from crashing into wall?
Posted: Sun Dec 06, 2015 2:29 pm
by RubikPanda
thelegend wrote:2nd. Changing the takeoff height of your xwings. If you are using custom sides (e.g. custom all.lvl) then you can simply edit the needed lines.
Thank you for telling me how to do it and what to change

However, may I ask where the file I need to edit would be located, I can't seem to locate it. If its in'C:\BF2_ModTools\data_***\_LVL_PC\SIDE' it won't open, or at least takes ages to load. Many thanks anyway
EDIT: Can open that file in SIDE, but its unreadable
TheMastermindOfMaom wrote:Just a question,what tutorial did you use for adding ships into ground levels?
I just added the ships to the list of unit type things in 'data_***\common\scripts\***'
Re: Best way to prevent AI pilots from crashing into wall?
Posted: Sun Dec 06, 2015 2:31 pm
by TheMastermindOfMaom
Oh,so it is the same as with units. Thanks.
Re: Best way to prevent AI pilots from crashing into wall?
Posted: Sun Dec 06, 2015 3:03 pm
by thelegend
You will need to create your custom side (If you didn't already). Go to data_XXX/Sides/all and open all_fly_xwing_sc.odf with any text editor.
Here's a good tutorial on how to add custom sides and also explains some other things:
http://www.gametoast.com/viewtopic.php?f=27&t=12729
Re: Best way to prevent AI pilots from crashing into wall?
Posted: Sun Dec 06, 2015 3:12 pm
by RubikPanda
Cheers thanks!
Works perfectly now! Thank you!
Re: Best way to prevent AI pilots from crashing into wall? [
Posted: Sun Dec 06, 2015 4:06 pm
by TheMastermindOfMaom
Suggestion: Don't just write S,write Solved completely because some people may not see the S sometimes.
Re: How to prevent AI pilots from crashing into wall? [Solve
Posted: Sun Dec 06, 2015 4:30 pm
by RubikPanda
Thought I did type in [Solved], oops, sorry
Re: How to prevent AI pilots from crashing into wall? [Solve
Posted: Sun Dec 06, 2015 6:15 pm
by AnthonyBF2
You can also use SetClassProperty on vehicles. In your map script, right after ScriptPostLoad try something like this:
SetClassProperty("all_fly_xwing_sc", "TakeoffHeight", "10.0")
With that you won't need to make a custom side, unless you are actually making a custom side at will.
Re: How to prevent AI pilots from crashing into wall? [Solve
Posted: Mon Dec 07, 2015 3:26 pm
by RubikPanda
All of works perfectly for X-Wings, but not at all for TIE fighters, they all crash whenever the AI takes control

Changed the settings for them, the take off height, time, speed, no luck :/
Re: How to stop AI pilots ceashing into wall? [Partially Sol
Posted: Mon Dec 07, 2015 6:02 pm
by thelegend
Are you sure you also load your tiefighters as custom sides in your lua? (e.g. dc:SIDE...)
Re: How to stop AI pilots ceashing into wall? [Partially Sol
Posted: Tue Dec 08, 2015 3:10 pm
by RubikPanda
Yep, still doesn't work :/
Changed height to something like 10, no change

Not sure if somehow adding hangers to your ships (don't think its possible) or even ommiting imperial star fighters would be a better compromise
Re: How to stop AI pilots ceashing into wall? [Partially Sol
Posted: Tue Dec 08, 2015 4:39 pm
by thelegend
It should actually work. The following has nothing to do with your map but try rasing the MaxSpeed line in your tie fighter's odf (About 2000). Then munge and test if this works. If not then change it back and do a manual clean. I guess soe files didn't munge correctly and couldn't be updated as well.
Re: How to stop AI pilots ceashing into wall? [Partially Sol
Posted: Wed Dec 09, 2015 3:25 pm
by RubikPanda
Will do, thanks for reminding me about manual cleaning

, completely forgot about that.
Cheers
EDIT
Manual Cleaning still didn't fix it, which is peculiar
Code: Select all
TakeoffTime = 5.0
TakeoffSpeed = 1.0
LandingTime = 1.0
LandingSpeed = 12.5
TakeoffHeight = 10.0
This is what its set as (at the moment, have used several different TakeoffSpeeds), and by all means (i am to believe) it should work, but never mind.
Re: How to stop AI pilots ceashing into wall? [Partially Sol
Posted: Thu Dec 10, 2015 6:02 am
by thelegend
Hmm...Set takeofftime to 3 and it's speed to 20. Also raise it's height to 30. Manual Clean and munge again.