Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

tanksarevictory Offline
#1 Posted : Saturday, March 28, 2020 10:02:06 PM(UTC)
tanksarevictory
Private
Joined: 12/1/2015(UTC)
Posts: 29
New Zealand
Location: Auckland

Thanks: 3 times
Was thanked: 4 time(s) in 3 post(s)
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


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.
Sponsor
UTD^Force Offline
#2 Posted : Monday, March 30, 2020 3:36:28 PM(UTC)
UTD^Force
Colonel
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 8/13/2013(UTC)
Posts: 799
Jordan
Location: Middle east

Thanks: 443 times
Was thanked: 161 time(s) in 145 post(s)
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:

; 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

Edited by user Monday, March 30, 2020 3:38:15 PM(UTC)  | Reason: Not specified

<3
The lilacs where the robin built,
And where my brother set
The laburnum on his birthday,
The tree is living yet!

"I rarely have many failures. If I'm baking a cake and it fails, it becomes pudding."

"Sometimes I sit and wonder, "why am I not in a mental asylum?" Then I take a good look at everyone around me and realize, maybe I am."

A flower does not think of competing to the flower next to it. It just blooms.
tanksarevictory Offline
#3 Posted : Tuesday, March 31, 2020 10:39:22 PM(UTC)
tanksarevictory
Private
Joined: 12/1/2015(UTC)
Posts: 29
New Zealand
Location: Auckland

Thanks: 3 times
Was thanked: 4 time(s) in 3 post(s)
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.

Thanks for that but I did end up fixing it at the end somehow by changing the avengers dummy weapon:

Code:

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


Btw I might be posting more questions on here since I'm trying to come up with random things to mod
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.6.1 | YAF © 2003-2020, Yet Another Forum.NET
This page was generated in 0.608 seconds.