Fixing Buggy Classes

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
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Fixing Buggy Classes

Post by MrMew »

Is it possible to fix a buggy class such as the ep2 jet trooper from the kamino campaign level. Whenever award pistol is given and the weapon switched the game will crash.
And can I give the jet trooper with the sniper rifle the ability to jet?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Fixing Buggy Classes

Post by Anakin »

1) i never noticed that bug are you using custom units??
2) fakeconsole can add jet to every unit
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Fixing Buggy Classes

Post by AnthonyBF2 »

The manual way to fix is these steps:

- Reference rep_inf_default_jettrooper.odf
1) Copy the award weapon slots data from rep_inf_default_jettrooper.odf to rep_inf_ep2_jettrooper_rifleman.odf
2) Erase the jetpack flying codes in rep_inf_ep2_jettrooper_sniper.odf and copy over all of the jetpack information from rep_inf_default_jettrooper.odf
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Fixing Buggy Classes

Post by MrMew »

I assume these are the odfs in C:\BF2_ModTools\assets\sides\rep\odf, because I tried doing that for the sniper and it still doesn't have a jump jet.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Fixing Buggy Classes

Post by AnthonyBF2 »

MrMew wrote:I assume these are the odfs in C:\BF2_ModTools\assets\sides\rep\odf, because I tried doing that for the sniper and it still doesn't have a jump jet.
You are not supposed to edit the files in the assets folder. You need to look up the tutorial for how to create a custom side and then you edit the odf files in the custom side then you will get your changes.
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Fixing Buggy Classes

Post by MrMew »

Diet Dr. Pepper. So I cant just add a line to the game mode Luas to change this at all?
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Fixing Buggy Classes

Post by AnthonyBF2 »

You can using SetClassProperty.
Look in the ODF files for what commands you need and manipulate the character using SetClassProperty with the ODF setting you want to change. In an ODF file, anything under [Properties] can be changed with SetClassProperty.
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Fixing Buggy Classes

Post by MrMew »

Is this close to being right:
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetJump = "5.0" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetPush = "8.0" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetAcceleration = "30.0" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetEffect = "rep_sfx_jetpack" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetType = "hover" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelRechargeRate = "0.12" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelCost = "0.16" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelInitialCost = "0.25" ")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelMinBorder = "0.24" ")

I got an error while munging:

C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\123\123g_eli.lua:18: `)' expected near `5.0'
ERROR[scriptmunge scripts\123\123g_eli.lua]:Could not read input file.ERROR[scriptmunge scripts\123\123g_eli.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

ERROR[levelpack mission\123g_eli.req]:Expecting bracket, but none was found.
File : munged\pc\123g_eli.script.req(1)...

ucft <--
ERROR[levelpack mission\123g_eli.req]:Expecting bracket, but none was found.
File : munged\pc\123g_eli.script.req(1)...

ucft <--

2 Errors 0 Warnings

Not really sure what the errors regarding the ucft is.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Fixing Buggy Classes

Post by AnthonyBF2 »

You never use = inside of SetClassProperty or SetProperty (for objects)

Your should be:

Code: Select all

SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetJump", "5.0")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetPush", "8.0")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetAcceleration", "30.0")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetEffect", "rep_sfx_jetpack")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetType", "hover")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelRechargeRate", "0.12")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelCost", "0.16")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelInitialCost", "0.25")
SetClassProperty("rep_inf_ep2_jettrooper_sniper", "JetFuelMinBorder", "0.24")
SetClassProperty("", "", "")
The first "" is the slot for the class you're going to manipulate. The second "" slot is the class's ODF property you're changing, and the third "" slot is for the values.
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Fixing Buggy Classes

Post by MrMew »

Hypothetically what happens if I may have accidentally edited a file in the asset file and munge a new world? Would it warrant a spawn bug for that unit?
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Fixing Buggy Classes

Post by AnthonyBF2 »

The "spawn bug" is a multiplayer only error which happens randomly. The files in the assets folder are to be used as a reference or to make custom sides. Nothing terrible will happen but I would recommend backing up your project folder and re-installing mod tools.
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Fixing Buggy Classes

Post by MrMew »

The spawn bug was occurring in SP, but it appears it was due to the script. So that's fixed. However I've been playing around with changing weapons using the lua (makes getting a jet trooper with sniper easier), and is there some sort of issue when replacing the primary weapon of the rep_inf_ep3_officer (clone commander class) with the rep_inf_rifle, because as soon as I start the map the game crashes. And the weapon is loaded because another unit with the weapon is in the script.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Fixing Buggy Classes

Post by AnthonyBF2 »

I know you can change primary weapons with SetClassProperty, I am unsure with unlockable weapons. For the primary 4 slots, the Property you would change is:

WeaponName1 Sniper rifle, shotgun, rockets
WeaponName2 pistol, command pistol
WeaponName3 and WeaponName4 are throwable items like detpacks and grenades
Post Reply