AA Only Gun Tower?

Moderators: GSH, VSMIT, Red Devil, Commando

User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

AA Only Gun Tower?

Post by General BlackDragon »

How exactly do I make a gun tower that doesn't target ground units? OR can't aim down? Here's the ODF I have so far:

Code: Select all

[GameObjectClass]
geometryName = "abaagn00.xsi"
glowTexture = "abaagna0.pic"
geometryScale = 1.25
classLabel = "turret"
collisionRadius = 10.0
scrapCost = 6
scrapValue = 4
maxHealth = 5000
maxAmmo = 10000
unitName = "Gun Tower"
aiName = "GunTowerFriend"
aiName2 = "GunTowerEnemy"
heatSignature = 2.0
imageSignature = 1.0
radarSignature = 1.0
isAssault = 0
ownsTerrain = 1
canCollide = 1
powercost = 0

GameObjectClassServiceMask = 1
GameObjectClassServiceMatch = 1
GameObjectClassServiceProvides = 1

buildSupport = "F"
buildRequire = "A"

weaponMask = 01111
weaponHard1 = "hp_cannon_01"
recoilName1 = "Recoil_R"
weaponName1 = "gBGTflaka"
weaponAssault1 = 0
weaponHard2 = "hp_cannon_02"
recoilName2 = "Recoil_L"
weaponName2 = "gBGTflakb"
weaponAssault2 = 0
weaponHard3 = "hp_cannon_01"
recoilName3 = "Recoil_R"
weaponName3 = "gBGTflakc"
weaponAssault3 = 0
weaponHard4 = "hp_cannon_02"
recoilName4 = "Recoil_L"
weaponName4 = "gBGTflakd"
weaponAssault4 = 0

turretCount = 2
turretName1 = "turret_y"
turretName2 = "turret_x"


[BuildingClass]
soundAmbient = "abtowee0.wav"

[CraftClass]
rangeScan = 400
periodScan = 0.0
velocJam = 0.0
//weaponPitch = 1.5
steerFactor = 0.5
engageRange = 400

MinWeaponPitch = 0.5
MaxWeaponPitch = 1.5

MustBeLinedUpToHit = true 
GunTowerProcessCheckCantHit = true
DoWeaponCanHitCheck = true
SitAttackCheckAbleToHit = true
FireWhenCanHitFriends = true

attackTask = "AssaultTankAttack"
subAttackTask = "SupportSubAttack"
subAttackClass = "ANS"

[TurretCraftClass]
omegaTurret = 2.0
detectRange = 200
pitchMin = 0.5 
pitchMax = 1.5
User avatar
bigbadbogie
Bull Dog
Posts: 586
Joined: Mon Feb 21, 2011 8:12 am
Location: Ecuadorian Embassy

Re: AA Only Gun Tower?

Post by bigbadbogie »

Not really possible without DLL. The closest I was able to come was with a turret class building tapped inside another building which prevented it from being able to shoot anything down low. The problem was that it would still target ground units and just sit there pointing even while aircraft flew overhead. Even the ODF command gunTowerProcessCheckCantHit = true didn't make it retarget aircraft when this happened, even though it says in the changelog that it is supposed to retarget if it can't hit a unit.
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: AA Only Gun Tower?

Post by General BlackDragon »

I've seen the retarget work when the unit passes behind a hill of terrain.
User avatar
Zax
Attila
Posts: 1388
Joined: Sat Feb 19, 2011 6:56 am

Re: AA Only Gun Tower?

Post by Zax »

Ground or aircraft doesn't really make a difference to BZ. All targets are considered the same, thanks to the fake z axis and all.
User avatar
MrTwosheds
Recycler
Posts: 3059
Joined: Sat Feb 19, 2011 8:37 am
Location: Outer Space
Contact:

Re: AA Only Gun Tower?

Post by MrTwosheds »

attackTask = "ArtlAttack"
subAttackTask = "ArtlSubAttack"
Might make it more inclined to fire upwards, been a while since I played with it though so I'm not sure. I don't think you can stop it firing at ground units completely.
User avatar
bigbadbogie
Bull Dog
Posts: 586
Joined: Mon Feb 21, 2011 8:12 am
Location: Ecuadorian Embassy

Re: AA Only Gun Tower?

Post by bigbadbogie »

General BlackDragon wrote:I've seen the retarget work when the unit passes behind a hill of terrain.
It might work for terrain, but not for objects.

Perhaps if you used a 'terrain' class object to sculpt the terrain around the object to a particular height it might work.
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: AA Only Gun Tower?

Post by General BlackDragon »

artl doesnt work either :-/

And, terrain shaping doesn't work on buildable gun towers, heh...

EDIT: Figured out one bit...

MinWeaponPitch = -0.2
MaxWeaponPitch = 1.5

min is set to - in code, so to make minimum pitch a positive number, it needs to be negative.

Now they physically can't aim down, or level. However, the AI still "tries" to aim at ground targets it can't hit, even with GunTowerProcessCheckCantHit = true
DutchBoy
Sober Scav
Posts: 21
Joined: Thu Apr 19, 2012 8:03 pm

Re: AA Only Gun Tower?

Post by DutchBoy »

what I did to create an aa only emplacement was to actually have the tower launch a satellite up 200m and gave it a weapon with 200 m range so it basically could only target object in the air, looks pretty damn cool too haha. I dont remember if it was 200m range and altitude, but that was the general idea. I think i may have gave it a lil more weapon range then height so it would attack ground targets very close to it's base structure.
DutchBoy
Sober Scav
Posts: 21
Joined: Thu Apr 19, 2012 8:03 pm

Re: AA Only Gun Tower?

Post by DutchBoy »

You could probably get a similar effect with a ground based tower as long as the control points were up high, since target selection for the ai was based on certain hardpoints, which i cant recall the specific names for, while still having the weapon hardpoints on the ground, but i don't think i ever messed with that, worth a try though if you want a certain look.
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: AA Only Gun Tower?

Post by General BlackDragon »

Hmmm

Valid hardpoints i can think of: hp_Com_1, hp_eyepoint,

Though, the com_1 and eyepoint need to be down south with the turret....

Hmmmm....
DutchBoy
Sober Scav
Posts: 21
Joined: Thu Apr 19, 2012 8:03 pm

Re: AA Only Gun Tower?

Post by DutchBoy »

I think com messes with what is drawn on the screen, i had some issues with that and the satellite i think, things may have changed though. if the com hp was off the screen the model wasn't shown, so placement of that required a lot of fine tuning...
User avatar
Zax
Attila
Posts: 1388
Joined: Sat Feb 19, 2011 6:56 am

Re: AA Only Gun Tower?

Post by Zax »

Fake Z axis means 200 meters is not measured vertically. If something is 300 meters in the air, but 1 meter away from it x or y, that ship will point up and attempt to attack as if it was right next to it.
User avatar
Red Devil
Recycler
Posts: 4398
Joined: Fri Feb 18, 2011 5:10 pm
Location: High in the Rocky Mountains

Re: AA Only Gun Tower?

Post by Red Devil »

i learned that it isn't a fake Z axis, but that is either left-handed or right-handed
User avatar
Nielk1
Flying Mauler
Posts: 2991
Joined: Fri Feb 18, 2011 10:35 pm
Contact:

Re: AA Only Gun Tower?

Post by Nielk1 »

Red Devil wrote:i learned that it isn't a fake Z axis, but that is either left-handed or right-handed
The logic is 2D, not 3D, so handedness is irrelevant.
DutchBoy
Sober Scav
Posts: 21
Joined: Thu Apr 19, 2012 8:03 pm

Re: AA Only Gun Tower?

Post by DutchBoy »

hmm oh well i know the satellite did work rather well.
Post Reply