Posted by: tanksarevictory - Saturday, March 28, 2020 11:02:06 PM
Why not do some random ZH modding during the quarantine? I thought I'd try make the avenger laser turret shoot/target ground units as well as aircraft: [quote] ;------------------------------------------------------------------------------ Weapon AvengerAirLaserOne PrimaryDamage = 25.0 PrimaryDamageRadius = 0.0 ; 0 primary radius means "hits only intended victim" AttackRange = 300.0 DamageType = SMALL_ARMS DeathType = NORMAL WeaponSpeed = 999999.0 ; dist/sec (huge value == effectively instant) ;WeaponSpeed = 10.0 ; dist/sec (huge value == effectively instant) LaserName = AvengerLaserBeam LaserBoneName = TurretFX01 ; FireFX = WeaponFX_PaladinPointDefenseLaser ; VeterancyFireFX = HEROIC WeaponFX_PaladinPointDefenseLaser FireSound = AvengerAirLaserWeapon RadiusDamageAffects = ALLIES ENEMIES NEUTRALS DelayBetweenShots = 0 ; time between shots, msec ClipSize = 0 ; how many shots in a Clip (0 == infinite) ClipReloadTime = 0 ; how long to reload a Clip, msec AntiAirborneVehicle = Yes AntiAirborneInfantry = Yes AntiGround = Yes ProjectileCollidesWith = ENEMIES STRUCTURES WALLS SHRUBBERY WeaponBonus = PLAYER_UPGRADE DAMAGE 125% ; APBullets End [/quote] I've changed AntiGround and AntiAirborneInfantry to yes for AvengerAirLaserOne and AvengerAirLaserTwo and it now shoots at ground units but I dont know why it only shoots one laser. Also when I change the values back to no, it doesn't target ground units but still shoots one laser? I hope it doesn't have to do with the model/animation or anything cuz I'm not keen on doing that kind of stuff yet.

Posted by: UTD^Force - Monday, March 30, 2020 4:36:28 PM
I'm not sure if this is what you need. But the avenger tank uses a separate object as its turret. This is the weaponset code for it, the overlord contain behaviour in the avenger's code and the weapons that the separate turret uses. As you may notice, the avenger uses one weapon for each turret on the separate turret. [code=plain] ; weaponset for separate turret in americavehicle.ini file Object AmericaTankAvengerLaserTurret ; Seperate turret object so it can attack independantly ;... ;... ;... WeaponSet Conditions = None Weapon = PRIMARY AvengerAirLaserOne Weapon = SECONDARY AvengerAirLaserTwo End ;... ;... ;... ;======================== ; overlord contain behaviour in avenger's code in americavehicle.ini file Object AmericaTankAvenger ;... ;... ;... Behavior = OverlordContain ModuleTag_OverlordContain Slots = 1 DamagePercentToUnits = 100% AllowInsideKindOf = PORTABLE_STRUCTURE PassengersAllowedToFire = Yes PayloadTemplateName = AmericaTankAvengerLaserTurret ExperienceSinkForRider = Yes ; I get the Exp for things my turret friend kills End ;... ;... ;... End ;===================== ; separate turret's weapons in weapon.ini ;------------------------------------------------------------------------------ Weapon AvengerAirLaserOne PrimaryDamage = 10.0 PrimaryDamageRadius = 0.0 ; 0 primary radius means "hits only intended victim" AttackRange = 300.0 DamageType = SMALL_ARMS DeathType = NORMAL WeaponSpeed = 999999.0 ; dist/sec (huge value == effectively instant) ;WeaponSpeed = 10.0 ; dist/sec (huge value == effectively instant) LaserName = AvengerLaserBeam LaserBoneName = TurretFX01 ; FireFX = WeaponFX_PaladinPointDefenseLaser ; VeterancyFireFX = HEROIC WeaponFX_PaladinPointDefenseLaser FireSound = AvengerAirLaserWeapon RadiusDamageAffects = ALLIES ENEMIES NEUTRALS DelayBetweenShots = 200 ; time between shots, msec ClipSize = 0 ; how many shots in a Clip (0 == infinite) ClipReloadTime = 0 ; how long to reload a Clip, msec AntiAirborneVehicle = Yes AntiAirborneInfantry = No AntiGround = No ProjectileCollidesWith = ENEMIES STRUCTURES WALLS SHRUBBERY WeaponBonus = PLAYER_UPGRADE DAMAGE 125% ; APBullets End ;------------------------------------------------------------------------------ Weapon AvengerAirLaserTwo PrimaryDamage = 10.0 PrimaryDamageRadius = 0.0 ; 0 primary radius means "hits only intended victim" AttackRange = 300.0 DamageType = SMALL_ARMS DeathType = NORMAL WeaponSpeed = 999999.0 ; dist/sec (huge value == effectively instant) ;WeaponSpeed = 10.0 ; dist/sec (huge value == effectively instant) LaserName = AvengerLaserBeam LaserBoneName = TurretFX02 ; FireFX = WeaponFX_PaladinPointDefenseLaser ; VeterancyFireFX = HEROIC WeaponFX_PaladinPointDefenseLaser FireSound = AvengerAirLaserWeapon RadiusDamageAffects = ALLIES ENEMIES NEUTRALS DelayBetweenShots = 200 ; time between shots, msec ClipSize = 0 ; how many shots in a Clip (0 == infinite) ClipReloadTime = 0 ; how long to reload a Clip, msec AntiAirborneVehicle = Yes AntiAirborneInfantry = No AntiGround = No ProjectileCollidesWith = ENEMIES STRUCTURES WALLS SHRUBBERY WeaponBonus = PLAYER_UPGRADE DAMAGE 125% ; APBullets End ;====================== End[/code]

Posted by: tanksarevictory - Tuesday, March 31, 2020 11:39:22 PM
[quote] This is the weaponset code for it, the overlord contain behaviour in the avenger's code and the weapons that the separate turret uses. As you may notice, the avenger uses one weapon for each turret on the separate turret. [/quote] Thanks for that but I did end up fixing it at the end somehow by changing the avengers dummy weapon: [code=plain] Weapon AvengerAirLaserDummy PrimaryDamage = 0.0001 PrimaryDamageRadius = 0.0 AttackRange = 300.0 DamageType = SMALL_ARMS DeathType = EXPLODED WeaponSpeed = 999999.0 ProjectileObject = NONE RadiusDamageAffects = ALLIES ENEMIES NEUTRALS DelayBetweenShots = 125 ClipSize = 0 ClipReloadTime = 0 AntiAirborneVehicle = Yes <--- had to change these to yes for it to use both lasers AntiAirborneInfantry = Yes <--- AntiGround = Yes <--- ProjectileCollidesWith = ENEMIES STRUCTURES WALLS SHRUBBERY End [/code] Btw I might be posting more questions on here since I'm trying to come up with random things to mod