Scripted weapon-pickup issue [solved]
Posted: Sat Jul 04, 2009 12:53 pm
I've scripted an event where the player enters a region and, upon re-spawning, has access to a new weapon (same basic concept as in Maveritchell's Spira: Besaid). It works near-flawlessly, with one exception: the player can't switch secondary weapons.
I find it strange that this is the problem, as the new weapon takes the place of a primary weapon slot. I would have expected any interference to happen in the primary weapon channel, not the secondary weapon channel.
Here's the script:
And the unit's .odf:
I read somewhere that the order in which the weapons are set up in the .odf affects scripted weapon-changes, so I think my problem lies in how I set that up, but I'm not quite sure what I need to change.
I find it strange that this is the problem, as the new weapon takes the place of a primary weapon slot. I would have expected any interference to happen in the primary weapon channel, not the secondary weapon channel.
Here's the script:
Code: Select all
launcher_pickup = OnEnterRegion(
function(region, player)
KillObject("launcher")
DeactivateRegion("launcher_pickup")
SetClassProperty("rep_inf_trooper_story2", "WeaponName3", "rep_weap_inf_rocket_launcher")
SetClassProperty("rep_inf_trooper_story2", "WeaponAmmo3", 7)
end,
"launcher_pickup"
)Code: Select all
[GameObjectClass]
ClassParent = "rep_inf_default"
[Properties]
MaxHealth = 1400.0
WEAPONSECTION = 1
WeaponName1 = "rep_weap_inf_carbine"
WeaponAmmo1 = 2
WEAPONSECTION = 2
WeaponName2 = "rep_weap_inf_pistol"
WeaponAmmo2 = 0
WEAPONSECTION = 3
WeaponName3 = "rep_weap_inf_pistol"
WeaponAmmo3 = 0
WEAPONSECTION = 4
WeaponName4 = "rep_weap_inf_thermaldetonator"
WeaponAmmo4 = 1
WeaponChannel4 = 1
WEAPONSECTION = 5
WeaponName5 = "rep_weap_inf_bacta"
WeaponAmmo5 = 1
WeaponChannel5 = 1
VOUnitType = 121