Posted by: thetimn8er - Saturday, July 13, 2013 2:49:00 AM
Hi, I wish to mod the technical so individual technicals gain crate upgrades by purchasing an upgrade within the technical Commandset. I currently have it working for upgrading to crateupgrade 1, but it upgrades all technicals, instead of just the one that purchased the upgrade. Also, I can't find a way to add a second upgrade, as the term Weaponset PLAYER_UPGRADE already is being used.
Posted by: CommieDog - Saturday, July 13, 2013 9:14:19 PM
[quote=thetimn8er;128630]but it upgrades all technicals, instead of just the one that purchased the upgrade.[/quote]
That's probably because you have the upgrade type set to PLAYER. Set it to UNIT instead. Also make sure that the command button used to purchase your upgrade is of the type UNIT_UPGRADE or it won't work.
[quote=thetimn8er;128630]Also, I can't find a way to add a second upgrade, as the term Weaponset PLAYER_UPGRADE already is being used.[/quote]
You can't have two upgraded weapon sets. Your best bet is to have your upgrade spawn a salvage crate right on top of the Technical. The Technical should pick it up automatically.
Posted by: thetimn8er - Sunday, July 14, 2013 3:19:30 AM
[quote=CommieDog;128633][quote=thetimn8er;128630]but it upgrades all technicals, instead of just the one that purchased the upgrade.[/quote]
That's probably because you have the upgrade type set to PLAYER. Set it to UNIT instead. Also make sure that the command button used to purchase your upgrade is of the type UNIT_UPGRADE or it won't work.
[quote=thetimn8er;128630]Also, I can't find a way to add a second upgrade, as the term Weaponset PLAYER_UPGRADE already is being used.[/quote]
You can't have two upgraded weapon sets. Your best bet is to have your upgrade spawn a salvage crate right on top of the Technical. The Technical should pick it up automatically.[/quote]
Thank you so much, you are very helpful [smile]
Posted by: thetimn8er - Sunday, July 14, 2013 3:38:45 AM
[quote=CommieDog;128633]
That's probably because you have the upgrade type set to PLAYER. Set it to UNIT instead. Also make sure that the command button used to purchase your upgrade is of the type UNIT_UPGRADE or it won't work.[/quote]
Hmm. According to the modulelist, Unit_upgrade doesn't exist, nor when I try it does it work... I have the upgrade Type = Unit and the button command = Unit_Upgrade and in the Code, I replace all Player_Upgrade to Unit_Upgrade concerning the weapon change... What did I do wrong?
Posted by: Annihilationzh - Sunday, July 14, 2013 9:53:53 AM
Object upgrades are set in upgrade.ini, not in the individual unit.
Posted by: thetimn8er - Sunday, July 14, 2013 12:10:13 PM
[quote=Annihilationzh;128636]Object upgrades are set in upgrade.ini, not in the individual unit.[/quote]
Perhaps I am not being clear enough. I did change the upgrade type in the upgrade code
[code=plain]
Upgrade Upgrade_TechnicalKPV
DisplayName = UPGRADE:QuadCannonSnipe
Type = UNIT
BuildTime = 5.0
BuildCost = 13794
ButtonImage = TechnicalKPV
End
[/code]
And the button
[code=plain]
CommandButton Command_UpgradeTechnicalKPV
Upgrade = Upgrade_TechnicalKPV
Command = UNIT_UPGRADE
TextLabel = CONTROLBAR:UpgradeChinaOverlordGattlingCannon
ButtonImage = TechnicalKPV
ButtonBorderType = UPGRADE ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:TooltipUpgradeChinaOverlordGattlingCannon
UnitSpecificSound = OverlordTankVoiceModeGattling
End
[/code]
Posted by: thetimn8er - Sunday, July 14, 2013 12:13:53 PM
As well as in the vehicle code where ever Weaponset_Player_Upgrade was
[code=plain]
ConditionState = WEAPONSET_UNIT_UPGRADE
IdleAnimation = UITech_SKL.UITech_STA 0 6
IdleAnimation = UITech_SKL.UITech_IDA
IdleAnimation = UITech_SKL.UITech_IDB
AnimationMode = ONCE
ShowSubObject = 50Cal
WeaponMuzzleFlash = PRIMARY MuzzleFX02
WeaponFireFXBone = PRIMARY Muzzle02
WeaponLaunchBone = PRIMARY Muzzle02
End
ConditionState = WEAPONSET_UNIT_UPGRADE RUBBLE MOVING TURRET_ROTATE
Animation = None
HideSubObject = UITech-SKN
ShowSubObject = 50Cal
WeaponMuzzleFlash = PRIMARY MuzzleFX02
WeaponFireFXBone = PRIMARY Muzzle02
WeaponLaunchBone = PRIMARY Muzzle02
End
ConditionState = MOVING WEAPONSET_UNIT_UPGRADE
Animation = UITech_SKL.UITech_MVB
AnimationMode = LOOP
ShowSubObject = 50Cal
WeaponMuzzleFlash = PRIMARY MuzzleFX02
WeaponFireFXBone = PRIMARY Muzzle02
WeaponLaunchBone = PRIMARY Muzzle02
End
ConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE
Animation = UITech_SKL.UITech_TNA
AnimationMode = LOOP
ShowSubObject = 50Cal
WeaponMuzzleFlash = PRIMARY MuzzleFX02
WeaponFireFXBone = PRIMARY Muzzle02
WeaponLaunchBone = PRIMARY Muzzle02
End
AliasConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE MOVING
AliasConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE FIRING_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE BETWEEN_FIRING_SHOTS_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE RELOADING_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE MOVING FIRING_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE MOVING BETWEEN_FIRING_SHOTS_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE TURRET_ROTATE MOVING RELOADING_A
ConditionState = WEAPONSET_UNIT_UPGRADE FIRING_A
Animation = UITech_SKL.UITech_ATA
AnimationMode = LOOP
ShowSubObject = 50Cal
WeaponMuzzleFlash = PRIMARY MuzzleFX02
WeaponFireFXBone = PRIMARY Muzzle02
WeaponLaunchBone = PRIMARY Muzzle02
End
; AliasConditionState is a new keyword that says,
; "give me another ConditionState exactly like the previous
; one, except with different conditions". Useful when you
; have several states that are the same with only different condition bits.
AliasConditionState = WEAPONSET_UNIT_UPGRADE BETWEEN_FIRING_SHOTS_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE RELOADING_A
; these aliases handle the moving-between-shots case. (we can't actually move-and-fire at the same time.).
AliasConditionState = WEAPONSET_UNIT_UPGRADE MOVING FIRING_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE MOVING BETWEEN_FIRING_SHOTS_A
AliasConditionState = WEAPONSET_UNIT_UPGRADE MOVING RELOADING_A
End
[/code]
Posted by: thetimn8er - Sunday, July 14, 2013 12:14:58 PM
[code=plain]
WeaponSet
Conditions = UNIT_UPGRADE
Weapon = PRIMARY MarauderTankGun
End
[/code]
Excuse my triple post, I can't find a way to post the code on one post
Posted by: Annihilationzh - Sunday, July 14, 2013 1:45:49 PM
[code=plain]Upgrade Upgrade_TechnicalKPV
DisplayName = UPGRADE:QuadCannonSnipe
Type = OBJECT
BuildTime = 5.0
BuildCost = 13794
ButtonImage = TechnicalKPV
End[/code][code=plain]CommandButton Command_UpgradeTechnicalKPV
Upgrade = Upgrade_TechnicalKPV
Command = OBJECT_UPGRADE
TextLabel = CONTROLBAR:UpgradeChinaOverlordGattlingCannon
ButtonImage = TechnicalKPV
ButtonBorderType = UPGRADE ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:TooltipUpgradeChinaOverlordGattlingCannon
UnitSpecificSound = OverlordTankVoiceModeGattling
End[/code]
You don't need WEAPONSET_UNIT_UPGRADE in the unit code.
Posted by: thetimn8er - Sunday, July 14, 2013 3:07:50 PM
[quote=Annihilationzh;128643]You don't need WEAPONSET_UNIT_UPGRADE in the unit code.[/quote]
How do I specify the condition then? ConditionState = Weaponset_Object_Upgrade? I need to specify the condition so that I can change the showobject to 50cal
Posted by: CommieDog - Sunday, July 14, 2013 9:45:38 PM
You're not going to be able to have the code distinguish between two upgraded weapon sets. That's why I suggested spawning a salvage crate instead.
Posted by: thetimn8er - Sunday, July 14, 2013 10:15:00 PM
[quote=CommieDog;128647]You're not going to be able to have the code distinguish between two upgraded weapon sets. That's why I suggested spawning a salvage crate instead.[/quote]
Right, ok, but if I just have one upgrade for a specific vehicle, what code would be needed to not effect other vehicles of the same type?
Posted by: Annihilationzh - Monday, July 15, 2013 5:34:38 AM
I answered this in post #9.
[quote]How do I specify the condition then? ConditionState = Weaponset_Object_Upgrade[/quote]
WEAPONSET_PLAYER_UPGRADE
Posted by: thetimn8er - Monday, July 15, 2013 7:29:01 PM
[quote=Annihilationzh;128650]I answered this in post #9.
WEAPONSET_PLAYER_UPGRADE[/quote]
It works now thanks! Sorry for such a long topic, I'm new to modding.
Posted by: CommieDog - Monday, July 15, 2013 8:42:42 PM
[quote=thetimn8er;128648][quote=CommieDog;128647]You're not going to be able to have the code distinguish between two upgraded weapon sets. That's why I suggested spawning a salvage crate instead.[/quote]
Right, ok, but if I just have one upgrade for a specific vehicle, what code would be needed to not effect other vehicles of the same type?[/quote]
Switch the upgrade's type from PLAYER to UNIT.
Posted by: thetimn8er - Monday, July 15, 2013 8:44:58 PM
[quote=CommieDog;128654][quote=thetimn8er;128648][quote=CommieDog;128647]You're not going to be able to have the code distinguish between two upgraded weapon sets. That's why I suggested spawning a salvage crate instead.[/quote]
Right, ok, but if I just have one upgrade for a specific vehicle, what code would be needed to not effect other vehicles of the same type?[/quote]
Switch the upgrade's type from PLAYER to UNIT.[/quote]
Thanks [smile]