Page 1 of 1
Changing Weapon
Posted: Mon Dec 07, 2009 8:58 pm
by KnightsFan
What I'm trying to do is change my character's weapon. It never changes, and I'm not getting any errors related to the unit, nor the weapon.
I changed the "WeaponName" to "WeaponName1" in the ODF, and put this in my script when an objective is completed:
Code: Select all
SetClassProperty("usf_inf_rev", "WeaponName1", "usf_weap_inf_m249")
Both the class and the weapon do exist and work.
Re: Changing Weapon
Posted: Mon Dec 07, 2009 9:05 pm
by Fiodis
You do know that the unit in question has to enter and exit a cp (usually done through respawning) for the change to take effect, right?
Re: Changing Weapon
Posted: Mon Dec 07, 2009 9:09 pm
by KnightsFan
Uh, no, I didn't. *is embarrassed*
Well, that... changes things. I don't suppose there's a way around it, like killing and respawning in under a second? Or changing the ordnance, rate of fire and geometry of the gun?
Re: Changing Weapon
Posted: Mon Dec 07, 2009 9:15 pm
by Fiodis
Create a CP that you can enter from far away (not sure about that, maybe properties in ZE or the odf), place one and give it a unique name, kill it upon mission start, and when you want to change someone's weapon, respawn the cp, force them into it like you would into a vehicle, force them out as you would a vehicle, and kill the cp. I think that ought to work. Not sure if you can treat CPs as vehicles, though.