How to stop AI pilots ceashing into wall? [Partially Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
RubikPanda
Private
Posts: 34
Joined: Sat May 04, 2013 10:43 am
Projects :: Jakku Salt Flats
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

How to stop AI pilots ceashing into wall? [Partially Solved]

Post 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:
Hidden/Spoiler:
Image
Any better way?
Last edited by RubikPanda on Mon Dec 07, 2015 5:30 pm, edited 3 times in total.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Best way to prevent AI pilots from crashing into wall?

Post 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.
Last edited by thelegend on Sun Dec 06, 2015 2:15 pm, edited 1 time in total.
TheMastermindOfMaom
Private First Class
Posts: 314
Joined: Sun Nov 22, 2015 1:48 pm
Projects :: None.
xbox live or psn: #PCMasterRace
Location: Greece

Re: Best way to prevent AI pilots from crashing into wall?

Post by TheMastermindOfMaom »

Just a question,what tutorial did you use for adding ships into ground levels?
RubikPanda
Private
Posts: 34
Joined: Sat May 04, 2013 10:43 am
Projects :: Jakku Salt Flats
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: Best way to prevent AI pilots from crashing into wall?

Post 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\***'
Last edited by RubikPanda on Sun Dec 06, 2015 2:53 pm, edited 2 times in total.
TheMastermindOfMaom
Private First Class
Posts: 314
Joined: Sun Nov 22, 2015 1:48 pm
Projects :: None.
xbox live or psn: #PCMasterRace
Location: Greece

Re: Best way to prevent AI pilots from crashing into wall?

Post by TheMastermindOfMaom »

Oh,so it is the same as with units. Thanks.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Best way to prevent AI pilots from crashing into wall?

Post 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
RubikPanda
Private
Posts: 34
Joined: Sat May 04, 2013 10:43 am
Projects :: Jakku Salt Flats
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: Best way to prevent AI pilots from crashing into wall?

Post by RubikPanda »

Cheers thanks!

Works perfectly now! Thank you!
TheMastermindOfMaom
Private First Class
Posts: 314
Joined: Sun Nov 22, 2015 1:48 pm
Projects :: None.
xbox live or psn: #PCMasterRace
Location: Greece

Re: Best way to prevent AI pilots from crashing into wall? [

Post by TheMastermindOfMaom »

Suggestion: Don't just write S,write Solved completely because some people may not see the S sometimes.
RubikPanda
Private
Posts: 34
Joined: Sat May 04, 2013 10:43 am
Projects :: Jakku Salt Flats
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: How to prevent AI pilots from crashing into wall? [Solve

Post by RubikPanda »

Thought I did type in [Solved], oops, sorry
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: How to prevent AI pilots from crashing into wall? [Solve

Post 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.
RubikPanda
Private
Posts: 34
Joined: Sat May 04, 2013 10:43 am
Projects :: Jakku Salt Flats
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: How to prevent AI pilots from crashing into wall? [Solve

Post 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 :/
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: How to stop AI pilots ceashing into wall? [Partially Sol

Post by thelegend »

Are you sure you also load your tiefighters as custom sides in your lua? (e.g. dc:SIDE...)
RubikPanda
Private
Posts: 34
Joined: Sat May 04, 2013 10:43 am
Projects :: Jakku Salt Flats
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: How to stop AI pilots ceashing into wall? [Partially Sol

Post 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
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: How to stop AI pilots ceashing into wall? [Partially Sol

Post 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.
RubikPanda
Private
Posts: 34
Joined: Sat May 04, 2013 10:43 am
Projects :: Jakku Salt Flats
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: How to stop AI pilots ceashing into wall? [Partially Sol

Post 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.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: How to stop AI pilots ceashing into wall? [Partially Sol

Post 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.
Post Reply