Using BF2ModTools debug interface (FAQ)

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

User avatar
cbadal
Corporal
Corporal
Posts: 155
Joined: Sun Jan 18, 2015 5:23 pm
Projects :: SWBF2 XBOX Mod Environment
Games I'm Playing :: SW Battlefront 2
xbox live or psn: No gamertag set
Contact:

Re: Using BF2ModTools debug interface (FAQ)

Post by cbadal »

I'm curious, is there a way to print out some info to the screen (via Lua code) when trying to debug?
Like those battlefield updates (red or blue) where "Han Solo has killed stormtrooper12"

Also, is there a way to run a custom debug function by typing into the SWBF2 command line?
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: Using BF2ModTools debug interface (FAQ)

Post by Anakin »

idk abput the debug interface but using
print("Hello World")
you can print into the debug log file.
User avatar
cbadal
Corporal
Corporal
Posts: 155
Joined: Sun Jan 18, 2015 5:23 pm
Projects :: SWBF2 XBOX Mod Environment
Games I'm Playing :: SW Battlefront 2
xbox live or psn: No gamertag set
Contact:

Re: Using BF2ModTools debug interface (FAQ)

Post by cbadal »

Maveritchell wrote:While there may be a few (or more than a few) who already know this or at least parts of it; this is some really simple stuff that I just honestly hadn't even looked at until someone asked me how to do something specific; I looked a little harder at BF2Modtools and realized there were a few things that even after a while spent modding, I never used.

BF2Modtools.exe is, as you know, the developer executable version of the game. You can access a pseudo-command line in the tools by pressing the "`" button (this is the button to the upper left of your keyboard, just next to "1" and under "Esc").

There is a long list of things you can do using this particular interface. If you press "Tab," you can scroll through a list of command prefixes (like ai., combo., render., etc.). If you press enter on just a prefix, you can see a list of suffixes that you can use with that prefix to create a full command.
Image

For example, you can see how I used the command "EntityProp.Enable" (which toggles prop meshes, but not collision meshes, on and off) to make normal Mos Eisley:
Hidden/Spoiler:
Image
Look like this:
Hidden/Spoiler:
Image
You'll note you can also access anything you could previously access through the original fake console (not counting Zerted's additions) in this menu as well.

Some of the commands in here, you will notice, require you to run a command line parameter before opening the modtools. For example, combo. commands will ask you to set "/debugcombos" on the command line to use them, like this:
Image
You can either run your modtools through the command prompt, or you can use a batch file like this one:
"BF2ModToolsDEBUG.bat Download

That batch file can be used by placing it in your "GameData" folder (with BF2Modtools.exe) and running it instead of the modtools.exe. It enables the combo debug commands and the animation debug commands, two of the more useful ones I saw. Any additional debug commands can be enabled by opening up the batch file and editing it as common sense would dictate.

So, for example, now that you have combo debug commands open, you can use it to show the damage area of combos, like this (note that the red wireframe spheres represent area in which damage is being done;):
Image
Note that this uses the command "combo.Damage". At any time you may exit out of the debug interface by pressing the "`" key again.

(You may notice in the last picture I removed the green bar; this is not recommended as it will remove the interface (menus etc.) entirely.)
All of the images in this post are gone.
My 'BFront2.log' file isn't showing up for some reason. Would it be possible to paste in the contents of that "BF2ModToolsDEBUG.bat" file into a code block?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Using BF2ModTools debug interface (FAQ)

Post by Marth8880 »

cbadal wrote:My 'BFront2.log' file isn't showing up for some reason.
http://www.gametoast.com/viewtopic.php?f=27&t=13806
See the note to Vista users in question #4.
cbadal wrote:Would it be possible to paste in the contents of that "BF2ModToolsDEBUG.bat" file into a code block?
No need for the batch file. Just right-click your debugger's exe, Create Shortcut, then open the shortcut's Properties and add /debugcombos (starting with a single space) to the end of the Target field's contents. Note that it *might* need to be -debugcombos instead.
User avatar
cbadal
Corporal
Corporal
Posts: 155
Joined: Sun Jan 18, 2015 5:23 pm
Projects :: SWBF2 XBOX Mod Environment
Games I'm Playing :: SW Battlefront 2
xbox live or psn: No gamertag set
Contact:

Re: Using BF2ModTools debug interface (FAQ)

Post by cbadal »

Thanks for the Quick reply.
I was able to get the log file by running the 'BF2_ModTools_NoDVD.exe' program as 'Administrator'.
Post Reply