How do you view debugging output?

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
[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:

How do you view debugging output?

Post by [RDH]Zerted »

In my script I have a string and I want to see its value so I know if everything is working. Is there any way I can do this?

The only way I can thing of, is creating a file then writing the string to that file. There has to be an easier way than this. Anyone?
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: How do you view debugging output?

Post by [RDH]Zerted »

So anyone have any ideas on getting output other than using ShowMessageText() ? Developers, where is print() displaying to and how can I view its output?
PAN-Fnord

RE: How do you view debugging output?

Post by PAN-Fnord »

print() is displaying to the stdout of the program, and I forget if print() is disabled in release builds or not. If it does work, print() should output to the logfile from BF2_modtools.exe.

Maybe you could just display an objective-update message with that string, instead...
Mike Z
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: How do you view debugging output?

Post by [RDH]Zerted »

Thanks. Now if I had only bought the cd version...

I'm only seeing UpdateObjectiveMessage() in ObjectiveSpaceAssault.lua. I'm not really sure what the objective message that is being updated is.

My end goal is to limit the type of units a player can use based on the rank in the player's user name (BFG tournment members have ranks). I can determine if a string contains a rank by using find(), but I don't think I've been able to get the player's name. I can't really tell because I don't have a way to output the string I'm testing. Can you think of anything else that might help with this?
PAN-Fnord

RE: How do you view debugging output?

Post by PAN-Fnord »

If you want to display something in the "X Killed Y" display list, you can use
ShowMessageText(string)
optionally you can give it a team number that you have defined to only show it to that team
ShowMessageText(string, REP)

CTF uses this for flag notifications.
Mike Z
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: How do you view debugging output?

Post by [RDH]Zerted »

Is there a way to tell it what X is? For example, can I somehow pass in "whatever" in ShowMessageText so it says "whatever killed Y" instead of "X killed Y" or are those variables hard coded inside the game? I know I could do ShowMessageText( "message.whatever" ), but can it be done the other way?
Post Reply