HELP: Rebel 2 weapons with SWITCH_Weapon, 3 suicide. How to?
Hello everyone. I'am pretty new to modding and started learning a few weeks ago. Now I'am running into a problem.
What do I have in mind?
I would like to have a GLA rebel with two weapons and who can commit suicide. I would like to be able to switch between the two weapons.
The rebel has by default the RebelMachineGun. By upgrade it can purchase a MolotovCocktail. Suicide is the third weapon.
How far did I get?
With the SWITCH_WEAPON option in CommandButton.ini I'am able to switch between the two weapons. In myfaction.ini I inserted the code for suicide.
What are my problems?
1. After purchasing both upgrades and I build a rebel, by default the suicide option works.
But when I first use one of the switches for switching weapon and then using the suicide option something strange happens.
The rebel doesn't commit suicide but starts firing with the last chosen weapon from SWITCH_WEAPON. The rebel doesn't uses its third weapon.
2. When I build a rebel and target him to destroy something, per example his own barrack, and I did not use one of the switches for choosing a weapon, the rebel start using both weapons. In the command GUI both icons from the SWITCH_WEAPON options flash on and off.
What does the code look like?
################################################## #####
CommandButton.ini
################################################## #####
.
.
CommandButton Command_InfOnly_RebelSwitchToMachineGun
Command = SWITCH_WEAPON
WeaponSlot = PRIMARY
Options = CHECK_LIKE OK_FOR_MULTI_SELECT
TextLabel = CONTROLBAR:RebelMachineGun
ButtonImage = SSArmMob
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:ToolTipSwitchToRebelMachineGun
UnitSpecificSound = RebelVoiceAttack
End
CommandButton Command_InfOnly_RebelSwitchToCocktail
Command = SWITCH_WEAPON
WeaponSlot = SECONDARY
Options = CHECK_LIKE OK_FOR_MULTI_SELECT NEED_UPGRADE
Upgrade = Upgrade_InfOnlyGLAInfantryRebelMolotovCocktail
TextLabel = CONTROLBAR:MolotovCocktail
ButtonImage = AngryMobFireBomb
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:ToolTipSwitchToRebelMolotovCocktail
UnitSpecificSound = RebelVoiceAttack
End
CommandButton Command_InfOnly_TertiarySuicide
Command = FIRE_WEAPON
WeaponSlot = TERTIARY
Options = OK_FOR_MULTI_SELECT
TextLabel = CONTROLBAR:SuicideAttack
ButtonImage = SUSuicideAttk
ButtonBorderType = ACTION ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipGLASuicideAttack
End
.
.
################################################## #####
Faction.ini
################################################## #####
object GLARebel
.
.
DefaultConditionState
Model = UIRGrd_SKN
IdleAnimation = UIRGrd_SKL.UIRGrd_STN 0 35
IdleAnimation = UIRGrd_SKL.UIRGrd_IDA
IdleAnimation = UIRGrd_SKL.UIRGrd_IDB
AnimationMode = ONCE
WeaponLaunchBone = PRIMARY Muzzle
WeaponFireFXBone = PRIMARY Muzzle
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponFireFXBone = SECONDARY Muzzle
WeaponLaunchBone = SECONDARY Muzzle
TransitionKey = TRANS_Standing
End
.
.
WeaponSet
Conditions = None
Weapon = PRIMARY GLARebelMachineGun
Weapon = SECONDARY NONE
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = TERTIARY NONE
End
WeaponSet
Conditions = PLAYER_UPGRADE
Weapon = PRIMARY GLARebelMachineGun
Weapon = SECONDARY InfOnly_GLARebelMolotovCocktail
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = PRIMARY FROM_SCRIPT FROM_AI DEFAULT_SWITCH_WEAPON
AutoChooseSources = SECONDARY FROM_SCRIPT FROM_AI
AutoChooseSources = TERTIARY NONE
End
Behavior = WeaponSetUpgrade ModuleTag_10
TriggeredBy = Upgrade_InfOnlyGLAInfantryRebelMolotovCocktail
End
Behavior = CommandSetUpgrade ModuleTag_60
CommandSet = InfOnly_GLAInfantryRebelCommandSetUpgrade
TriggeredBy = Demo_Upgrade_SuicideBomb
End
.
.
################################################## #####
Possible solution for problem 1?
Make the third weapon the third in the row for SWITCH_WEAPON. Change CommandButton.ini like this:
CommandButton Command_InfOnly_TertiarySuicide
Command = SWITCH_WEAPON
WeaponSlot = TERTIARY
Options = CHECK_LIKE OK_FOR_MULTI_SELECT
TextLabel = CONTROLBAR:SuicideAttack
ButtonImage = SUSuicideAttk
ButtonBorderType = ACTION ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipGLASuicideAttack
End
By this way I 'MUST' target the rebel first before it commits suicide, Just like the terrorist. It doesn't commit suicide at the current location.
Problem 1:
How to solve the problem that I can use the SWITCH_WEAPON option and commit suicide?
Problem 2:
I've been playing with AutoChooseSources = PRIMARY FROM_SCRIPT FROM_AI DEFAULT_SWITCH_WEAPON. Tried different entries like FROM_SCRIPT, FROM_AI and FROM_PLAYER for PRIMARY, SECONDARY en TERTIARY but I'am looking for a needle in a haystack.
Who can help me out?
Thanks in advance.
|