AI controlled custom flyer is a bad pilot

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
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

AI controlled custom flyer is a bad pilot

Post by elfie »

Hello, I got this new helicopter model ingame for one of my maps. I made it AI controlled, but now everytime it takes off, it flies 2 feet and then crashes into one of the buildings. The ones that don't crash just stay suspended in mid air frozen after they take off and spin around in a circle. What I want to know is, how do I set up my flyer odf so that it flys around on the path I set up for it and actually fires at the units like it is supposed to. Here is how I have my odf now if you want to look at it: (Thanks in advanced!)
Hidden/Spoiler:
[code][GameObjectClass]
ClassLabel = "flyer"
GeometryName = "helicopter2.msh"

[Properties]
FLYERSECTION = "BODY"

ReserveOneForPlayer = "0"

VehicleType = "transport"
MapTexture = ""
HealthTexture = ""
MapScale = 0.0
PilotType = self
GeometryName = "helicopter2"
//FirstPerson = ""
//FirstPersonFOV = "60"
CockpitTension = "12"
ThirdPersonFOV = "55"

CollisionScale = "2.5"
CollisionThreshold = "5.0"

CollisionInflict = "0.1"

MaxHealth = "100000"
RespawnTime = "0.0"
HealthType = "vehicle"
//HitLocation = "p_crithit 0"


PilotSkillRepairScale = 0.01

Acceleraton = 20.0
MinSpeed = -15.0
MidSpeed = 0.0
MaxSpeed = 45.0
StrafeSpeed = 15.0

PitchRate = 0.8
PitchFilter = 1.75
TurnRate = 1.0
TurnFilter = 5.75

//TurnRate = 1.25 // Max turn //3.25 mouse!
//TurnFilter = 5.75 // Speed of turn //5.75 mouse!


//ThrustPitchAngle = 0.2
//StrafeRollAngle = 0.1
BankAngle = 0.55
BankFilter = 5.5
LevelFilter = 2.0

PCPitchRate = 15.0
PCSpinRate = 15.0
PCTurnRate = 25.0

TakeoffTime = 4.5
TakeoffSpeed = 5.0
LandingTime = 4.5
LandingSpeed = 8.0
TakeoffHeight = 10.0

EyePointOffset = "0.0 0.0 10.0"
TrackCenter = "0.0 10.0 -24.0"
TrackOffset = "0.0 0.0 0.0 "
TiltValue = "4.0"

AimTension = "30.0"
MoveTension = "4.5"

WEAPONSECTION = "1"

WeaponName = "all_weap_fly_turret_cannon"
WeaponAmmo = "0"

AimerNodeName = "hp_fire"
AimerYawLimits = "-20.0 20.0"
AimerPitchLimits = "-20.0 20.0"
BarrelLength = "1.0"
FireOutsideLimits = "1"

NextAimer = "-"

AimerNodeName = "hp_fire"
AimerYawLimits = "-20.0 20.0"
AimerPitchLimits = "-20.0 20.0"
BarrelLength = "1.0"
FireOutsideLimits = "1"

WEAPONSECTION = "2"

WeaponName = "all_weap_fly_awing_missile"
WeaponAmmo = "18"

AimerNodeName = "hp_fire"
AimerYawLimits = "-0.0 0.0"
AimerPitchLimits = "-0.0 0.0"
BarrelLength = "1.0"

NextAimer = "-"

AimerNodeName = "hp_fire"
AimerYawLimits = "-0.0 0.0"
AimerPitchLimits = "-0.0 0.0"
BarrelLength = "1.0"

VehiclePosition = "common.vehiclepositions.pilot"

//********************************
//********** CO PILOT *********
//********************************
FLYERSECTION = "TURRET1"
PilotType = self
FirstPerson = "rep\repsccam;rep_1st_cockpit_securitycam"
PitchRate = 0.8
PitchFilter = 2.75
TurnRate = 1.3
TurnFilter = 2.75


PitchLimits = "-20 50"
YawLimits = "-89 89"
EyePointOffset = "0.0 10.0 0.0"
TrackCenter = "0.0 7.0 -10.0"
TrackOffset = "0.0 1.0 14.0"
TiltValue = "5.0"

WEAPONSECTION = "1"
WeaponName = "all_weap_fly_turret_cannon"
WeaponAmmo = "0"

AimerNodeName = "hp_fire"
AimerYawLimits = "-160.0 20.0"//"-160.0 -20.0"
AimerPitchLimits = "-80.0 80.0"
BarrelLength = "1.0"

//WEAPONSECTION = "2"
NextAimer = "-"

WeaponName = "all_weap_fly_turret_cannon"
WeaponAmmo = "0"

AimerNodeName = "hp_fire"
AimerYawLimits = "-20.0 160.0"//"20.0 160.0"
AimerPitchLimits = "-80.0 80.0"
BarrelLength = "1.0"

VehiclePosition = "common.vehiclepositions.copilot"
//********************************
//******** R BALL TURRET *******
//********************************

FLYERSECTION = "TURRET2"
PilotType = self
PitchRate = 0.8
PitchFilter = 2.75
TurnRate = 1.3
TurnFilter = 2.75


FirstPerson = "REP\repguntr;rep_1st_cockpit_gunshipgnr"
YawLimits = "-115.0 0.0"
PitchLimits = "-30.0 70.0"

PCPitchTurnFactor = "20.0"
PCYawTurnFactor = "20.0"


EyePointOffset = "0.0 0.3 0.25"
TrackOffset = "0.0 0.0 0.0"
TrackCenter = "0.0 1.2 -1.0"
ThirdPersonFOV = "55"
TiltValue = "0.0"
TurretNodeName = "hp_fire"
FirePointName = "hp_fire"


WeaponName = "all_weap_fly_awing_missile"
WeaponAmmo = "0"

BarrelLength = "0.0"

PilotPosition = "hp_pilot"
//PilotAnimation = "drive"
IsPilotExposed = "0"

TurretYawSound = "turret_whir_yaw_lp"
TurretYawSoundPitch = "0.7"
TurretPitchSound = "turret_whir_pitch_lp"
TurretPitchSoundPitch = "0.7"
TurretAmbientSound = ""
TurretActivateSound = "vehicle_equip"
TurretDeactivateSound = ""
TurretStartSound = ""
TurretStopSound = ""

VehiclePosition = "common.vehiclepositions.rightturret"

//********************************
//******** L BALL TURRET *******
//********************************
FLYERSECTION = "TURRET3"
PilotType = self
PitchRate = 0.8
PitchFilter = 2.75
TurnRate = 1.3
TurnFilter = 2.75


//FirstPerson = "REP\repguntr;rep_1st_cockpit_gunshipgnr"
YawLimits = "0.0 115.0"
PitchLimits = "-30.0 70.0"

//YawLimits = "0.0 170.0"
//PitchLimits = "10.0 70.0"

PCPitchTurnFactor = "20.0"
PCYawTurnFactor = "20.0"

//PitchTurnFactor = "1.0"
//YawTurnFactor = "1.0"

EyePointOffset = "0.0 0.3 0.25"
TrackOffset = "0.0 0.0 0.0"
TrackCenter = "0.0 1.2 -1.0"
ThirdPersonFOV = "55"
TiltValue = "0.0"
TurretNodeName = "hp_fire"
FireNodeName = "hp_fire"

WeaponName = "all_weap_fly_awing_missile"
WeaponAmmo = "0"

BarrelLength = "0.0"

PilotPosition = "hp_pilot"
PilotAnimation = "drive"
IsPilotExposed = "0"

TurretYawSound = "turret_whir_yaw_lp"
TurretYawSoundPitch = "0.7"
TurretPitchSound = "turret_whir_pitch_lp"
TurretPitchSoundPitch = "0.7"
TurretAmbientSound = ""
TurretActivateSound = "vehicle_equip"
TurretDeactivateSound = ""
TurretStartSound = ""
TurretStopSound = ""

VehiclePosition = "common.vehiclepositions.leftturret"

////////////////////////////////
//FLYERSECTION = "TURRET4"
////////////////////////////////


//PassengerSlots = "4"


//PassengerEyePoint = "hp_passenger1"

//ForceMode = 1
//ThirdPersonFOV = 60
//PitchRate = 0.8
//PitchFilter = 2.75
//TurnRate = 1.3
//TurnFilter = 2.75

//YawLimits = "25.0 115.0"
//PitchLimits = "-10.0 20.0"
//
//PCPitchTurnFactor = "20.0"
//PCYawTurnFactor = "20.0"
//
//PitchTurnFactor = "1.0"
//YawTurnFactor = "1.0"
//
//EyePointOffset = "0.0 10.0 -2.5"
//MountPos = "1.5 -0.75 1.75"
//TrackCenter = "0.0 0.0 -3.0"
//TrackOffset = "0.0 0.0 0.0"

//ControlsUnit = "1"
//PilotPosition = "hp_passenger3"
//PilotAnimation = "standing"

//VehiclePosition = "common.vehiclepositions.passenger"

///////////////////////////////////////////////////////////////

//***********************************************
//*********** COMMAND POST VALUES *************
//***********************************************

//SpawnPointCount = "6"
//SpawnPointLocation = "8.0 0.0 0.0 5"
//SpawnPointLocation = "8.0 0.0 4.0 5"
//SpawnPointLocation = "8.0 0.0 -4.0 5"
//SpawnPointLocation = "-8.0 0.0 0.0 355"
//SpawnPointLocation = "-8.0 0.0 4.0 355"
//SpawnPointLocation = "-8.0 0.0 -4.0 355"
//ValueBleed = 10
//Value_ATK_Alliance = 10
//Value_ATK_CIS = 10
//Value_ATK_Empire = 10
//Value_ATK_Republic = 10
//Value_ATK_Locals = 0
//Value_DEF_Alliance = 0
//Value_DEF_CIS = 0
//Value_DEF_Empire = 0
//Value_DEF_Republic = 0
//Value_DEF_Locals = 0
//LegRayHitLength = "16"


//CHUNKSECTION = "CHUNK1"
//ChunkGeometryName = "gunship_chunk1"
//ChunkNodeName = "Wing_gun_housing_2"
//ChunkTerrainCollisions = "5"
ChunkTerrainEffect = "dirtspray"
ChunkPhysics = "FULL"
ChunkOmega = "2.0 2.0 1.5"
ChunkBounciness = 0.45
ChunkStickiness = 0.25
ChunkSpeed = "10.0"
ChunkUpFactor = "0.00"
ChunkTrailEffect = "com_sfx_chunktrail_sm"

//CHUNKSECTION = "CHUNK2"
//ChunkGeometryName = "gunship_chunk2"
//ChunkNodeName = "main_backdoor_R"
//ChunkTerrainCollisions = "4"
ChunkTerrainEffect = "dirtspray"
ChunkPhysics = "FULL"
ChunkOmega = "2.0 2.5 2.0"
ChunkBounciness = 0.45
ChunkStickiness = 0.25
ChunkSpeed = "8.0"
ChunkUpFactor = "0.00"
ChunkTrailEffect = "com_sfx_chunktrail_sm"

//CHUNKSECTION = "CHUNK3"
//ChunkGeometryName = "REP_LA_AT_Gunship_hulk"
//ChunkNodeName = ""
ChunkTerrainCollisions = "0"
ChunkTerrainEffect = "com_sfx_explosion_lg"
ChunkTrailEffect = "com_sfx_chunktrail_sm"
ChunkPhysics = "FULL"
ChunkOmega = "1.0 1.0 1.0"
ChunkSpeed = "12.0"

//ChunkSmokeEffect = "com_sfx_smokeplume"
//ChunkSmokeNodeName = "hp_tail"

//ChunkSmokeEffect = "com_sfx_smokeplume"
//ChunkSmokeNodeName = "hp_smoke2"

//ChunkSmokeEffect = "com_sfx_smokeplume"
//ChunkSmokeNodeName = "hp_smoke3"

//ChunkSmokeEffect = "com_sfx_smokeplume"
//ChunkSmokeNodeName = "hp_smoke4"

//////////////////////////
////DAMAGE///////////
///////////////

DamageStartPercent = 60.0
DamageStopPercent = 20.0
DamageEffect = "com_sfx_vehiclespark"
DamageAttachPoint = "hp_pilot"

DamageStartPercent = 60.0
DamageStopPercent = 20.0
DamageEffect = "com_sfx_vehiclesmoke"
DamageAttachPoint = "hp_pilot"

DamageStartPercent = 60.0
DamageStopPercent = 20.0
DamageEffect = "com_sfx_vehiclespark"
DamageAttachPoint = "hp_effect"

DamageStartPercent = 50.0
DamageStopPercent = 0.0
DamageEffect = "com_sfx_vehiclesmoke"
DamageAttachPoint = "hp_effect"

DamageStartPercent = 30.0
DamageStopPercent = 0.0
DamageEffect = "com_sfx_vehiclesmoke"
DamageAttachPoint = "hp_tail"

DamageStartPercent = 50.0
DamageStopPercent = 0.0
DamageEffect = "com_sfx_vehiclesmoke"
DamageAttachPoint = "hp_effect"

DamageStartPercent = 10.0
DamageStopPercent = 0.0
DamageEffect = "com_sfx_vehicleflame"
DamageAttachPoint = "hp_tail"



//ExplosionCritical = "rep_fly_gunship_exp"
ExplosionDestruct = "rep_fly_gunship_exp"



///////////////////////////////////////////////////////////////
//// COLLISION

//BuildingCollision = "p_front_sphere"
//BuildingCollision = "p_left_sphere"
//BuildingCollision = "p_right_sphere"

//TerrainCollision = "p_front_sphere"
//TerrainCollision = "p_left_sphere"
//TerrainCollision = "p_right_sphere"

//VehicleCollision = "p_front_sphere"
//VehicleCollision = "p_left_sphere"
//VehicleCollision = "p_right_sphere"
//VehicleCollision = "p_center_sphere"
//VehicleCollision = "p_rear_sphere"

//SoldierCollision = "p_ball_turret_1"
//SoldierCollision = "p_ball_turret_2"
//SoldierCollision = "CollisionMesh"

//OrdnanceCollision = "p_ball_turret_1"
//OrdnanceCollision = "p_ball_turret_2"
//OrdnanceCollision = "CollisionMesh"

EngineSound = "rep_fly_gunship_engine_parameterized"
TakeoffSound = "speederbike_engine_parameterized"
LandSound = "speederbike_engine_parameterized"
HurtSound = "imp_weap_ord_exp_lg"
DeathSound = "imp_weap_ord_exp_lg"
VehicleCollisionSound ="com_veh_collision_lg"
TurnOnSound = ""
TurnOffSound = ""
FoleyFXGroup = "metal_foley"
[/code]
YaNkFaN
Field Commander
Field Commander
Posts: 943
Joined: Sat Dec 13, 2008 8:17 am

Re: AI controlled custom flyer is a bad pilot

Post by YaNkFaN »

well you could make a path in ze and put barriers on the buidings just restricting flyers...i;m not sure how to get it to fire though when and where you want i don't think you can but i'm pretty sure that if you get it to fly over units it will fire. also the path (planning) should be restricted to just flyers and should probably go around in a circle over the map
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

Re: AI controlled custom flyer is a bad pilot

Post by elfie »

YaNkFaN wrote:well you could make a path in ze and put barriers on the buidings just restricting flyers...i;m not sure how to get it to fire though when and where you want i don't think you can but i'm pretty sure that if you get it to fly over units it will fire. also the path (planning) should be restricted to just flyers and should probably go around in a circle over the map
What would barriers do? Don't they just give the 'leaving battlefield' message?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: AI controlled custom flyer is a bad pilot

Post by Maveritchell »

Flyer splines. They are in the docs. Read about them.
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: AI controlled custom flyer is a bad pilot

Post by Commander_Fett »

those are boundaries. Barriers tell the AI that they can't shoot through/go through the area.
YaNkFaN
Field Commander
Field Commander
Posts: 943
Joined: Sat Dec 13, 2008 8:17 am

Re: AI controlled custom flyer is a bad pilot

Post by YaNkFaN »

What would barriers do? Don't they just give the 'leaving battlefield' message?
no boundaries do that


you could do flyer splines like mav said but this is another way as well

barriers tell the AI where not to go ie not crash into buildings you can also change what "class" barriers affect ie if you just want it to affect a soldier or every class or just a flyer so when you put in your barrier click all the tabs except flyer and the barrier should turn a purple i believe (not sure) and just put them around your buildings and it should tell the AI not to go there also i suggest putting in planning so you tell the AI where to go.
computergeek
General
General
Posts: 770
Joined: Thu Jun 07, 2007 6:26 pm
Projects :: Halo Warthog vehicle for SWBF2
Games I'm Playing :: Bioware RPGs - Halo
xbox live or psn: No gamertag set
Location: Far Far away....

Re: AI controlled custom flyer is a bad pilot

Post by computergeek »

I know this is the third time flyer splines have been recommended, but if you add enough of them it will look like they are flying without being guided (they get off one path and start another)
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: AI controlled custom flyer is a bad pilot

Post by Teancum »

Really? I've never seen a map with good flyer splines that was ever like that. It's not like they just jerk to one set of splines. There's a little bit of grace to their flying. It's sortof a guide line.
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

Re: AI controlled custom flyer is a bad pilot

Post by elfie »

Okay guys, thanks for the help. I just have another question though. I read the flyersplines documentation and I didn't know what all of the functions corresponded to. Such as:
Default values...
PathFollowerClass = ""
PathFollowerSpeed = "1.0"
PathFollowerTurnSpeed = "0.5"
PathFollowerAcceleration = "2.0"
PathFollowerRollAcceleration = "45"
PathFollowerRollLookAhead = "1.0"
PathFollowerRollTolerance = "11.25"
PathFollowerRollSpeed = "45"
PathFollowerRollAccelerationLag = "0.001"
PathFollowerRollTurnFactor = "5.0"
PathFollowerRollSpeedFactor = "1.0"
PathFollowerRollDampening = "0.5"
PathFollowerBranchPaths = "0"
PathFollowerBranchRange = "{very big number}"
PathFollowerBranchMaxAngle = "180"
PathFollowerMinBranchDist = "300.0"
SquadronFormation = ""
SquadronSlideTime = "2.0"
SquadronMemberID = ""
Does this go in the flyer's odf? And also it says for paths:
These paths must be named in the following format...

"entitypath {pathname}"

... for example ...

"entitypath xwingstrafingrun"
After I name it though, where and how should I reference it? Odf? Lua? And one other thing: It explains what properties such as variance X, Y, and Z as well as "MaxSquadronSize mean, but in what areas of ZE/ Odfs are these found? Sorry, I just really don't understand the doc very much. :?
Jaspo
Command Sergeant Major
Command Sergeant Major
Posts: 282
Joined: Sun Mar 01, 2009 4:34 am
Projects :: AotC DoW+++Boonta Eve Classic
Games I'm Playing :: WoT MBWBVC Robocraft
xbox live or psn: No gamertag set
Contact:

Re: AI controlled custom flyer is a bad pilot

Post by Jaspo »

Plans and barriers don't work very well at all with flyers. I have them all over the place on my Jade Moon map, and guess what some of the fliers still do? Yep, fly straight off the path, through the barriers, and smear into the side of the hill. Geniuses. Apparently they need a lot of room to really fly well if you use that method.
Last edited by Jaspo on Wed Mar 04, 2009 7:45 pm, edited 1 time in total.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: AI controlled custom flyer is a bad pilot

Post by Teancum »

Jaspo wrote:Apparently they need a lot of room to really fly well if you use that method.
Flyer splines are only there to help the AI navigate, just like planning. They don't follow it 100% exactly and will veer off if they see a target. You can't have them do more precise things like strafe the ground, go through a line of trees, or fly right alongside a cruiser.
Post Reply