Wildingthing
4 years ago
I'm trying to add a dozer suicide weapon - it wouldn't actually explode the dozer, but would instead kill its own pilot (e.g. for an ally to take the dozer).

I created the weapon using the bombtruck suicide as a template:

Weapon AbandonDozer
PrimaryDamage = 1.0 ;was 150.0
PrimaryDamageRadius = 1.0 ;was 6.0
AttackRange = 1.0 ; must be very close to use this weapon!
DamageType = KILL_PILOT
DeathType = NORMAL
WeaponSpeed = 99999.0
ProjectileObject = NONE
DamageDealtAtSelfPosition = Yes ; this is a suicide bomber... remember?
RadiusDamageAffects = SELF SUICIDE
DelayBetweenShots = 0
ClipSize = 1
ClipReloadTime = 1000
AutoReloadsClip = Yes
FireFX = WeaponFX_UpgradeMineDetonation
FireSound = RebelWeapon
End

This works in theory - I've tested it with a humvee. However when I give a dozer this weapon, I can't make it attack.

I tried to give it a command button:

CommandButton Command_AbandonDozerNow
Command = FIRE_WEAPON
WeaponSlot = PRIMARY ; Best if this matches up with an AutoChoose listing that forbids this slot normally
Options = OK_FOR_MULTI_SELECT
TextLabel = CONTROLBAR:DetonateBombTruck
ButtonImage = SSTerroristCarBomb
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:TooltipDetonateBombTruck
End

And edited the commandset to match.

When I set AbandonDozer as a default primary weapon, pressing the new button instead activates DozerMineDisarmingWeapon

WeaponSet
Conditions = None
Weapon = PRIMARY AbandonDozer
End
WeaponSet
Conditions = MINE_CLEARING_DETAIL
Weapon = PRIMARY DozerMineDisarmingWeapon
End

If I change AbandonDozer to a secondary weapon on either weaponset, and update the commandbutton to WeaponSlot = SECONDARY, the game crashes when I try to activate it. The game even crashes if I delete the MINE_CLEARING_DETAIL weaponset altogether.

I have added CAN_ATTACK to the dozer's KindOf... what could I possibly be missing??
Sponsor
AdrianeMapMaker
4 years ago
look for the bomb truck codes or those things in the demo general and see what they have
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb 

UserPostedImage