Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
7 years ago
So for some reason I get an error saying I'm missing a weapon that I'm looking directly at the code for, and this weapon doesn't work in-game. Why?

Code:




;------------------------------------------------------------------------------
Weapon EMPDefenderMissileWeapon
  PrimaryDamage               = 40.0            
  PrimaryDamageRadius         = 5.0     
  ScatterRadiusVsInfantry     = 10.0     ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
  AttackRange                 = 175.0
  DamageType                  = INFANTRY_MISSILE
  DeathType                   = NORMAL
  WeaponSpeed                 = 600               
  ProjectileObject            = MissileDefenderMissile
  ProjectileExhaust           = MissileDefenderMissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicMissileDefenderMissileExhaust
  ProjectileDetonationFX      = WeaponFX_RocketBuggyMissileDetonation
  FireFX                      = FX_BuggyMissileIgnition
  RadiusDamageAffects         = ALLIES ENEMIES NEUTRALS
  ScatterRadius               = 0       ; This weapon will scatter somewhere within a circle of this radius, instead of hitting someone directly
  DelayBetweenShots           = 1000  ; time between shots, msec
  ClipSize                    = 0            ; how many shots in a Clip (0 == infinite)
  ClipReloadTime              = 0    ; how long to reload a Clip, msec
  AutoReloadsClip             = Yes 
  FireSound                   = MissileDefenderWeapon
  WeaponBonus                 = PLAYER_UPGRADE DAMAGE 125%
  AntiAirborneVehicle         = Yes
  AntiAirborneInfantry        = Yes
  ProjectileCollidesWith      = STRUCTURES
  
  
  HistoricBonusTime = 1500
  HistoricBonusCount = 3
  HistoricBonusRadius = 20
  HistoricBonusWeapon = EMPDefenderEMPSmallCreationWeapon
End

;------------------------------------------------------------------------------
Weapon EMPDefenderLaserGuidedMissileWeapon
  PrimaryDamage = 40.0            
  PrimaryDamageRadius = 5.0       
  ScatterRadiusVsInfantry = 10.0     ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
  AttackRange = 300.0     ;Extending this range, allows the special ability to work better.
  DamageType = ARMOR_PIERCING     
  DeathType = NORMAL
  WeaponSpeed = 600               
  ProjectileObject = MissileDefenderMissile
  ProjectileExhaust           = MissileDefenderMissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicMissileDefenderMissileExhaust
  ProjectileDetonationFX = WeaponFX_RocketBuggyMissileDetonation
  RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
  ScatterRadius = 0       ; This weapon will scatter somewhere within a circle of this radius, instead of hitting someone directly
  DelayBetweenShots = 500 ; time between shots, msec
  ClipSize = 0            ; how many shots in a Clip (0 == infinite)
  ClipReloadTime = 0    ; how long to reload a Clip, msec
  AutoReloadsClip = Yes 
  FireSound = MissileDefenderWeapon
  WeaponBonus = PLAYER_UPGRADE DAMAGE 125%
  AntiAirborneVehicle = Yes
  AntiAirborneInfantry = Yes

  ; note, these only apply to units that aren't the explicit target 
  ; (ie, units that just happen to "get in the way"... projectiles
  ; always collide with the Designated Target, regardless of these flags
  ProjectileCollidesWith = STRUCTURES
  
  
  HistoricBonusTime = 1500
  HistoricBonusCount = 3
  HistoricBonusRadius = 20
  HistoricBonusWeapon = EMPDefenderEMPSmallCreationWeapon
End

;------------------------------------------------------------------------------
; firing this weapon just creates an EMP Spheroid
Weapon EMPDefenderEMPSmallCreationWeapon
  DamageType = FLAME
  DeathType = BURNED
  FireOCL = SupW_OCL_PatriotEMPEffectSpheroid
End
GoHomeWorldbuilderYoureDrunk.PNG

Click to View Image32 View(s)


Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Sponsor
SkyMix_RMT
7 years ago
My guess is that you have to provide a damage value of something like 0.00001

That or the name is too long?
Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
7 years ago

My guess is that you have to provide a damage value of something like 0.00001

That or the name is too long?

Originally Posted by: SkyMix_RMT 



Doesn't seem to be the case for the first one. This is a clone of the FirestormSmallCreationWeapon


;------------------------------------------------------------------------------
; firing this weapon just creates a Firestorm object.
Weapon FirestormSmallCreationWeapon
  DamageType = FLAME
  DeathType = BURNED
  FireOCL = OCL_FirestormSmall
End

There's also several more weapons that have even longer names than mine. Such as Chem_SCUDLauncherGunAnthraxGammaPlusOne and the weapon above EMPDefenderLaserGuidedMissileWeapon which both work fine. (I added a simple ProjectileDetonationOCL as a placeholder and it has no issues.

I'm stumped on this one. I'm also stumped because somewhere along the way I must have broken something because trying to play a Skirmish match with a Hard Superweapon General crashes the game after a few minutes. The crash logs were of no help.


Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
UTD^Force
7 years ago
Treat ini code like a script, the script executes each line from top to bottom, and this is how ini code works.
Doing this fixes your problem, to make it simple, you write the code for the thing you want to use before the code of the other thing that uses it.

;------------------------------------------------------------------------------
; firing this weapon just creates an EMP Spheroid
Weapon EMPDefenderSmallCreationWeapon
  DamageType = FLAME
  DeathType = BURNED
  FireOCL = SupW_OCL_PatriotEMPEffectSpheroid
End
;------------------------------------------------------------------------------
Weapon EMPDefenderMissileWeapon
  PrimaryDamage               = 40.0            
  PrimaryDamageRadius         = 5.0     
  ScatterRadiusVsInfantry     = 10.0     ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
  AttackRange                 = 175.0
  DamageType                  = INFANTRY_MISSILE
  DeathType                   = NORMAL
  WeaponSpeed                 = 600               
  ProjectileObject            = MissileDefenderMissile
  ProjectileExhaust           = MissileDefenderMissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicMissileDefenderMissileExhaust
  ProjectileDetonationFX      = WeaponFX_RocketBuggyMissileDetonation
  FireFX                      = FX_BuggyMissileIgnition
  RadiusDamageAffects         = ALLIES ENEMIES NEUTRALS
  ScatterRadius               = 0       ; This weapon will scatter somewhere within a circle of this radius, instead of hitting someone directly
  DelayBetweenShots           = 1000  ; time between shots, msec
  ClipSize                    = 0            ; how many shots in a Clip (0 == infinite)
  ClipReloadTime              = 0    ; how long to reload a Clip, msec
  AutoReloadsClip             = Yes 
  FireSound                   = MissileDefenderWeapon
  WeaponBonus                 = PLAYER_UPGRADE DAMAGE 125%
  AntiAirborneVehicle         = Yes
  AntiAirborneInfantry        = Yes
  ProjectileCollidesWith      = STRUCTURES
   
   
  HistoricBonusTime = 1500
  HistoricBonusCount = 3
  HistoricBonusRadius = 20
  HistoricBonusWeapon = EMPDefenderSmallCreationWeapon
End
 
;------------------------------------------------------------------------------
Weapon EMPDefenderLaserGuidedMissileWeapon
  PrimaryDamage = 40.0            
  PrimaryDamageRadius = 5.0       
  ScatterRadiusVsInfantry = 10.0     ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
  AttackRange = 300.0     ;Extending this range, allows the special ability to work better.
  DamageType = ARMOR_PIERCING     
  DeathType = NORMAL
  WeaponSpeed = 600               
  ProjectileObject = MissileDefenderMissile
  ProjectileExhaust           = MissileDefenderMissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicMissileDefenderMissileExhaust
  ProjectileDetonationFX = WeaponFX_RocketBuggyMissileDetonation
  RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
  ScatterRadius = 0       ; This weapon will scatter somewhere within a circle of this radius, instead of hitting someone directly
  DelayBetweenShots = 500 ; time between shots, msec
  ClipSize = 0            ; how many shots in a Clip (0 == infinite)
  ClipReloadTime = 0    ; how long to reload a Clip, msec
  AutoReloadsClip = Yes 
  FireSound = MissileDefenderWeapon
  WeaponBonus = PLAYER_UPGRADE DAMAGE 125%
  AntiAirborneVehicle = Yes
  AntiAirborneInfantry = Yes
 
  ; note, these only apply to units that aren't the explicit target 
  ; (ie, units that just happen to "get in the way"... projectiles
  ; always collide with the Designated Target, regardless of these flags
  ProjectileCollidesWith = STRUCTURES
   
   
  HistoricBonusTime = 1500
  HistoricBonusCount = 3
  HistoricBonusRadius = 20
  HistoricBonusWeapon = EMPDefenderSmallCreationWeapon
End

EDIT #2: I changed the name of the weapon just in case it was because of the long name, you don't need to do that, because the weapon already used was longer:
MissileDefenderLaserGuidedMissileWeapon
A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs
Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
7 years ago

Treat ini code like a script, the script executes each line from top to bottom, and this is how ini code works.
Doing this fixes your problem, to make it simple, you write the code for the thing you want to use before the code of the other thing that uses it.

Originally Posted by: UTD^Force 



That's actually quite brilliant... Thank you so much!😁 😁
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
UTD^Force
7 years ago
No problem, it's always a good feeling when I get into that notepad editor to check some codes.

EDIT: I like the idea too, really nice!👍
A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs
Gameanater
  • Gameanater
  • 55.5% (Neutral)
  • General Topic Starter
7 years ago

No problem, it's always a good feeling when I get into that notepad editor to check some codes.

EDIT: I like the idea too, really nice!👍

Originally Posted by: UTD^Force 



Thank you!

I could some peeps to test out my ideas since I am limited on time myself... perhaps I should post the files here for all to try? Right now it's mostly minor visual effects and Superweapon General changes
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
UTD^Force
7 years ago
Yeah, you can give it a shot. Maybe after making some more significant changes first.
A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs
Zatsupachi
7 years ago
Did you try saving each ini file separately? Then refreshing the directory?
"It's precision_bomber."
Death Label HAS BEEN RELEASED(go get v0.99):
http://www.moddb.com/mods/death-label/downloads/death-label-ver-099 
Next Episode:
precision_bomber's Zero Hour SCIENCE!