Page 2 of 2

Re: Using BF2ModTools debug interface (FAQ)

Posted: Mon Dec 25, 2017 8:32 pm
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?

Re: Using BF2ModTools debug interface (FAQ)

Posted: Tue Dec 26, 2017 6:22 am
by Anakin
idk abput the debug interface but using
print("Hello World")
you can print into the debug log file.

Re: Using BF2ModTools debug interface (FAQ)

Posted: Sat Dec 30, 2017 2:26 pm
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?

Re: Using BF2ModTools debug interface (FAQ)

Posted: Sat Dec 30, 2017 2:39 pm
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.

Re: Using BF2ModTools debug interface (FAQ)

Posted: Sat Dec 30, 2017 4:06 pm
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'.