Page 1 of 1

How can I change the weapons of the units?

Posted: Sun Sep 26, 2010 8:00 am
by Ridago
I wanted to know, how i can change the blaster rifle for example from a normal clonetrooper to a chaingun or to another weapon.

Thanks for answeres!

Re: how can I change the weapons of the units?

Posted: Sun Sep 26, 2010 9:09 am
by Deviss
well there are 2 ways:
1) creating your custom side and in rep_inf_default_rifleman.odf change rep_weap_inf_rifle to rep_weap_inf_chaingun like this:
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "rep_inf_default"


[Properties]
WEAPONSECTION = 1
WeaponName = "rep_weap_inf_rifle"
WeaponAmmo = 4

WEAPONSECTION = 2
WeaponName = "rep_weap_inf_pistol"
WeaponAmmo = 0

WEAPONSECTION = 3
WeaponName = "rep_weap_inf_thermaldetonator"
WeaponAmmo = 4
WeaponChannel = 1

WEAPONSECTION = 4
WeaponName = "rep_weap_award_rifle"
WeaponAmmo = 4

WEAPONSECTION = 5
WeaponName = "rep_weap_award_pistol"
WeaponAmmo = 6

VOUnitType = 121
2) via lua, changing class property so add this line:
SetClassProperty("rep_inf_default_rifleman", "WeaponName1", "rep_weap_inf_chaingun")
in this case you need have charged under rep.lvl line, rep_inf_ep3_officer because he have the chaingun

Re: how can I change the weapons of the units?

Posted: Sun Sep 26, 2010 10:29 am
by Ridago
What do you mean with the part: "in this case you need have charged under rep.lvl line, rep_inf_ep3_officer because he have the chaingun"

Ich have changed the properties, but it doesnt works. when I play my map, the clonetrooper had still the normal blaster rifle? Why it doesnt works?

Re: how can I change the weapons of the units?

Posted: Sun Sep 26, 2010 11:04 am
by Fiodis
Look in the FAQ thread at custom side tutorials.

Re: how can I change the weapons of the units?

Posted: Thu Sep 30, 2010 9:50 am
by stardestroyer001
Ok. So in the ODF file for your trooper (data_ABC/Sides/rep/ODF)[replace ABC with your map name], you'll see a specific line that says, "WEAPONSECTION=1". You'll have a couple lines under that; somewhere in there it will say the weapon name. Switch the weapon name in there with the name of the weapon you wish to use. Then, save, and go to data_ABC/Common/scripts/ABC and open the ODF that you want the Clone Trooper with the new weapon to be in (c=Clone Wars, con=conquest, ctf=Capture the Flag, eli=Hero Assault). Scroll down until you reach:

ReadDataFile(SIDE//rep.lvl)
If you haven't done so already, change the above to this:
ReadDataFile(dc:SIDE//rep.lvl)
Then munge (Set the dropdown list to "EVERYTHING" or "rep", have Common checked) and play.
*I suggest running the debug program, it'll tell you if you did anything wrong)