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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline tanksarevictory  
#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
Offline UTD^Force  
#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: 817
Jordan
Location: Middle east

Thanks: 430 times
Was thanked: 184 time(s) in 168 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

Proud Muslim

UTD^Force

Moderator and former map reviewer
CnC Labs
Offline tanksarevictory  
#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.