If I may, I'd like to delve deeper into modifying units... I want to be able to 'edit' the weapons... but I cannot figure out how to achieve this. It seems as if it should be simple enough to do, however I keep coming up empty handed...
Lets work with the Scud Launching RPG Trooper... lets say I want to edit the 'weapon' he's shooting, in this case it being the "Demo_SCUDLauncherGunExplosivePlusTwo". So I look at the weapons scripts, find that weapon...
Code:Weapon DEMO_SCUDLauncherGunExplosivePlusTwo
PrimaryDamage = 400.0
PrimaryDamageRadius = 50.0
SecondaryDamage = 75.0
SecondaryDamageRadius = 100.0
ScatterRadiusVsInfantry = 30.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
AttackRange = 450.0
MinimumAttackRange = 200.0
PreAttackDelay = 500
PreAttackType = PER_SHOT ; Do the delay every single shot
DamageType = EXPLOSION
DeathType = EXPLODED
FireFX = FX_ScudLauncherIgnition
ProjectileObject = SCUDMissilePlusTwo
ProjectileExhaust = ScudMissileExhaust
VeterancyProjectileExhaust = HEROIC HeroicScudMissileExhaust
ProjectileDetonationFX = WeaponFX_DEMO_SCUDMissileDetonationExplosive
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS NOT_SIMILAR
FireSound = ScudLauncherWeapon
DelayBetweenShots = 1
ClipSize = 1 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 10000 ; how long to reload a Clip, msec
; Uses a clip of one to get the Reloading modelcondition
; 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
WeaponBonus = PLAYER_UPGRADE DAMAGE 125% ; AP rockets upgrade for SCUD launcher
End
Now I would assume that I should be able to just write the following into my 'map.ini' file:
Code:Weapon Demo_SCUDLauncherGunExplosivePlusTwo
DelayBetweenShots = 333
ClipSize = 3
End
And it should work... well I guess I assume wrong, because this seems to make the unit "shoot blanks" you can see him try to shoot... it does the "launch" effect, three times, 333ms apart from eachother as it should, but he isn't actually launching a anything anymore. (I have tried to keep the rest of the weapon script with it, to see if that helps, it doesn't... and I didn't really expect it to since the map.ini only applies that which you have changed.)
Now I would preferrably be able to make my very own custom weapon so any other unit (ie: the real scud launcher) isn't sharing this special attack. So how would I go about getting the following script to work?
Code:Weapon Custom_SCUDLauncherGunExplosivePlusTwo
PrimaryDamage = 400.0
PrimaryDamageRadius = 50.0
SecondaryDamage = 75.0
SecondaryDamageRadius = 100.0
ScatterRadiusVsInfantry = 30.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
AttackRange = 450.0
MinimumAttackRange = 200.0
PreAttackDelay = 500
PreAttackType = PER_SHOT ; Do the delay every single shot
DamageType = EXPLOSION
DeathType = EXPLODED
FireFX = FX_ScudLauncherIgnition
ProjectileObject = SCUDMissilePlusTwo
ProjectileExhaust = ScudMissileExhaust
VeterancyProjectileExhaust = HEROIC HeroicScudMissileExhaust
ProjectileDetonationFX = WeaponFX_DEMO_SCUDMissileDetonationExplosive
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS NOT_SIMILAR
FireSound = ScudLauncherWeapon
DelayBetweenShots = 333
ClipSize = 3 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 10000 ; how long to reload a Clip, msec
; Uses a clip of one to get the Reloading modelcondition
; 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
WeaponBonus = PLAYER_UPGRADE DAMAGE 125% ; AP rockets upgrade for SCUD launcher
End
Object Demo_GLAInfantryTunnelDefender
WeaponSet
Conditions = None
Weapon = PRIMARY Custom_SCUDLauncherGunExplosivePlusTwo ;Demo_SCUDLauncherGunExplosivePlusTwo
Weapon = SECONDARY DemoTunnelDefenderRocketWeapon
Weapon = TERTIARY TerroristSuicideNotARealWeapon
PreferredAgainst = PRIMARY INFANTRY VEHICLE STRUCTURE
PreferredAgainst = SECONDARY AIRCRAFT
AutoChooseSources = SECONDARY NONE
AutoChooseSources = TERTIARY NONE
End
ReplaceModule ModuleTag_03
Behavior = AIUpdateInterface ModuleTag_03_Override
Turret
TurretTurnRate = 60 ; turn rate, in degrees per sec
TurretPitchRate = 60
FirePitch = 25 ; Instead of aiming pitchwise at the target, it will aim here
AllowsPitch = Yes
ControlledWeaponSlots = PRIMARY
End
End
End
Locomotor = SET_NORMAL MissileDefenderLocomotor
End
I have tried to add the code that the 'weapon' referrences for 'FX' and all, to see if keeping them relative to the same file might make it able to 'read' it, but that doesn't change anything, and I didn't expect it to... all I can really do is Trial and Error.
I hope this isn't too much to ask, if you do not have the time to explain this to me, but know somewhere that I can read up on the information I'd need to achieve my desired result I would indeed be greatful for that as well. I can't find any tutorials on this sort of scripting, the best I can do is dig through the game files and try to understand what they're doing, and look at mods other people have made to try to connect some dots.
Thank you for your time!