Indent "Loading compiled script.." lines by execDepth
by Orion Elenzil · 11/13/2006 (4:42 pm) · 4 comments
You know the lines in your console.log which read "Loading compiled script " ?
And you know how it's sometimes hard to tell from those which scripts have exec()'d others ?
This mod simply indents each line by the current execDepth.
easiest to describe by example;
what used to be this:
is now this:
engine/console/consoleFunctions.cc
near the top of ConsoleFunction(exec, bool, ...),
add these lines:
down towards the bottom of the same function,
replace this line:
.. that's it!
note i originally was using "the dot" as the indent character,
but the GG site ate the resource when i did that, so i changed it to a plain old period.
- thanks to Mike Perry and Josh Dallman for pointing out the problem!
And you know how it's sometimes hard to tell from those which scripts have exec()'d others ?
This mod simply indents each line by the current execDepth.
easiest to describe by example;
what used to be this:
Loading compiled script projects/common/characters/initDatablocks.cs. Loading compiled script projects/common/characters/emote.cs. Loading compiled script projects/common/characters/conversation.cs. Loading compiled script projects/common/characters/f_player/f_player.cs. Loading compiled script projects/common/characters/m_player/m_player.cs. Loading compiled script projects/common/characters/NPC/init.cs. Loading compiled script projects/common/characters/NPC/bouncer1/npc_bouncer1.cs. Loading compiled script projects/common/characters/NPC/dj1/npc_dj1.cs. Loading compiled script projects/common/characters/NPC/dj2/npc_dj2.cs. Loading compiled script projects/common/characters/playerDB.cs. Loading compiled script intersection/server/scripts/aiPlayer.cs.
is now this:
.Loading compiled script projects/common/characters/initDatablocks.cs. ..Loading compiled script projects/common/characters/emote.cs. ..Loading compiled script projects/common/characters/conversation.cs. ..Loading compiled script projects/common/characters/f_player/f_player.cs. ..Loading compiled script projects/common/characters/m_player/m_player.cs. ..Loading compiled script projects/common/characters/NPC/init.cs. ...Loading compiled script projects/common/characters/NPC/bouncer1/npc_bouncer1.cs. ...Loading compiled script projects/common/characters/NPC/dj1/npc_dj1.cs. ...Loading compiled script projects/common/characters/NPC/dj2/npc_dj2.cs. ..Loading compiled script projects/common/characters/playerDB.cs. .Loading compiled script intersection/server/scripts/aiPlayer.cs.
engine/console/consoleFunctions.cc
near the top of ConsoleFunction(exec, bool, ...),
add these lines:
char execDepthToken[] = "."; char execDepthBuf [256] = "";
down towards the bottom of the same function,
replace this line:
Con::printf("%sLoading compiled script %s.", execDepthBuf, scriptFileName);with these lines:execDepthBuf[0] = '[[61000ea18a3bf]]';
for (S32 n = 0; n < execDepth; n++)
{
dStrncat(execDepthBuf, execDepthToken, sizeof(execDepthBuf) - (sizeof(execDepthToken) - 1) * n);
}
Con::printf("%sLoading compiled script %s.", execDepthBuf, scriptFileName);.. that's it!
note i originally was using "the dot" as the indent character,
but the GG site ate the resource when i did that, so i changed it to a plain old period.
- thanks to Mike Perry and Josh Dallman for pointing out the problem!
About the author
#2
And achieve the same results.
11/24/2006 (6:25 am)
Btw, since Con::printf is just a wrapper around the standard printf, you could also do:Con::printf("%-*sLoading compiled script %s.", execDepth - 1, ".", scriptFileName);And achieve the same results.
#3
11/24/2006 (2:12 pm)
wow! awesome, thanks Gregory. I've done it my hacky way for years and never realized printf could do that.
#4
03/10/2007 (7:50 pm)
Thanx Gregory ! 
Community Manager Michael Perry
ZombieShortbus
Glad to help out btw.