How to add unit customization (in-game)

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

MasterSaitek009
Black Sun Slicer
Posts: 619
Joined: Wed Aug 23, 2006 4:10 pm

RE: Re: RE: Re: RE: How to add unit customization (in-game)

Post by MasterSaitek009 »

What if you made different units with every possibility covered.
So if a person with a pistol walked into region rifle their unit would be switched to unit with a rifle and a pistol.
So instead of adding something to the existing class it would switch you to a whole new unit with the proper weapons.

This method would probably include a 400 line long if-then or a huge switch statement (does stripped down BF2 LUA even have switch?)
But who cares it would be awesome if it worked!
Syth
General
General
Posts: 784
Joined: Thu Apr 13, 2006 8:46 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: happy fun island

Post by Syth »

As I said this
well my idea was that youd have 9 units-
3-4 units that would be customizable, and 6-5 would be pre-made units that would be primaraly AI.
would get around this...
I thought I heard that a script like this will cause all fellow units of your class to take on the weapon change

You see, youd have 3-4 units that would be affected by weapon regions. In the LUA you set the limit of each of these units to 1 (so the AI dont use them). Then there would be room for 5-6 more units on your team, which would be normal units that the AI would use, uneffected by what weapon regions you go to.
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:

Post by [RDH]Zerted »

Your ideas would work Syth. You would use SetClassProperty() to change the values. Instead of regions (or in addition to), you could make droppable weapon packs like those health/ammo packs.

The game crashes when you add too many units to the two human playable teams. There is a single method which lets a unit be used by all teams, but I have never looked into what this does to the unit selection screen.
Post Reply