Changing ODF ingame

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
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Changing ODF ingame

Post by trainmaster611 »

I remember a few eons ago, someone posted a topic about 'pickupable' weapons. In that thread, Zerted said it would be possible to change the ODF ingame, but it would change all the units that share that ODF.

Now I'm interested in making a unit's ODF properties change ingame (regardless of the bug) for a map I'm working on. Would anyone know how to do that?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Changing ODF ingame

Post by Maveritchell »

You've got to tell us what you want to do. You can change some things, and you can't change others.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Re: Changing ODF ingame

Post by trainmaster611 »

I was going to change the weapon.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Changing ODF ingame

Post by Maveritchell »

trainmaster611 wrote:I was going to change the weapon.
More specific. Melee weapons can't be changed, everything else can be changed using SetClassProperty (example below), provided it replaces an already-existing weapon (I did this in Spira: Besaid, if you want an example of how it would work).

Ex.

Code: Select all

SetClassProperty("all_inf_unit", "WeaponName1", "all_weap_inf_weapon")
SetClassProperty("all_inf_unit", "WeaponAmmo1", "5")
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Changing ODF ingame

Post by [RDH]Zerted »

Changing most weapon properties causes crashes for other players in MP games.
Post Reply