Posted by: unnem - Monday, April 22, 2013 11:13:31 AM
I have very weird problem.
I created unit with suicide weapon and command button that detonates it.
but when im trying to use it theres an error. game crash etc.
here is weapon code:
[code]
Weapon CampaignBombpackWeapon
PrimaryDamage = 6000.0
PrimaryDamageRadius = 220.0
ScatterRadiusVsInfantry = 0.0
AttackRange = 30.0
DamageType = EXPLOSION
DeathType = EXPLODED
WeaponSpeed = 999999 ; ignored for projectile weapons
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS SELF SUICIDE
DelayBetweenShots = 1 ; time between shots, msec
ClipSize = 1
ClipReloadTime = 1000
AutoReloadsClip = No
FireFX = Effect
DamageDealtAtSelfPosition = Yes
End
[/code]
unit code:
[code]
[...]
WeaponSet
Conditions = None
Weapon = TERTIARY CampaignBombpackWeapon
AutoChooseSources = TERTIARY NONE
End
[...]
CommandSet = CampaignBombpackHolderCS
[...]
[/code]
(only important things)
and command button code:
[code]
CommandButton Command_BombPackDetonateNow
Command = FIRE_WEAPON
WeaponSlot = TERTIARY
Options = OK_FOR_MULTI_SELECT
ButtonImage = SSTerroristCarBomb
ButtonBorderType = ACTION
End
[/code]
anyone have idea what could be wrong?
[unit using this ability in mission automaticly - IF: unit "unit" enter area "area" THEN: use command button ability Command_BombPackDetonateNow]
==========================================
I just tried to detonate it using button and it works. Theres something wrong with map but i have no idea what... Script is:
[code]
*** IF ***
Unit 'officer' enters area 'reportin'
*** THEN ***
Show military briefing String: 'SCRIPT:3' for 7500 milliseconds.
Boundary Green becomes the active border.
Move camera to Waypoint 'northcam' in 2.00 seconds, camera shutter 0.00 seconds, ease-in 0.00 seconds, ease-out 0.00 seconds.
Enable Script 'Lose'.
Unit 'officer' use Ability 'Command_BombPackDetonateNow'.
[/code]
I tried to do it with disabled "win" or "lose" scripts because i thought game can't destroy unit that is needed or something :P but game still crashing.
Also exactly same thing with bomb truck. So isn't about unit... Any ideas? :/
Posted by: CommieDog - Monday, April 22, 2013 10:06:33 PM
From what I remember of the Generals INI code, the Bomb Truck has a module that allows the AI to use its abilities. Maybe that has something to do with it.
Posted by: unnem - Tuesday, April 23, 2013 4:40:51 AM
but which one?
i can see only SpecialAbility [disguise], StealthUpdate, CreateCrateDie, FXListDie, TransitionDamageFX, FlammableUpdate, SubObjectsUpgrade [show part of model], FireWeaponWhenDeadBehavior, ProductionUpdate, SlowDeathBehavior, and other basic like ActiveBody etc. Also when i tried to use bombtruck in editor game crashed.