How can I change the weapons of the units?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Ridago

How can I change the weapons of the units?

Post 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!
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

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

Post 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
Ridago

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

Post 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?
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

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

Post by Fiodis »

Look in the FAQ thread at custom side tutorials.
stardestroyer001
Sergeant Major
Sergeant Major
Posts: 239
Joined: Fri Apr 16, 2010 7:02 pm
Projects :: Space Coruscant [before it corrupted]
Games I'm Playing :: World of Warships
xbox live or psn: StarDestroyer75
Location: Canada
Contact:

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

Post 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)
Post Reply