Here's a bunch of tricks that REALLY help me doing any sort of work with the PotC code:
1. Don't use Windows Notepad as text editor; I use Notepad++ which is much better, free and can be found here: http://notepad-plus-plus.org/download/v6.7.5.html
2. Another complete and utter lifesaver that I use is WinMerge: http://winmerge.org/downloads/
This allows you to compare code files and folders with each other and find all differences.
3. Add your PotC folder to the Windows Search Index: http://windows.microsoft.com/en-us/windows/improve-windows-searches-using-index-faq#1TC=windows-7
That way, when using the regular Windows search functionality, it won't just search in the filename, but also in the file CONTENTS! And it is QUICK!
You can now use Windows Search to find all files that contain reference to certain function or variable names.
Then open all in Notepad++ and use "search in all files" and you'll have a list of all uses. And all that within a minute or so.
This is all based on free programs and built-in Windows functionality, but unlocks some really quite powerful options.
4. The wonderful world of CONSOLE!
- Open PROGRAM\console.c
- Find:
- Immediately below the last line shown here, add whatever code you want to execute
- Press F12 while ingame to execute
If you use windowed mode, this allows you to execute any code "on the fly" while you're still in the game.
There are a whole bunch of pre-defined sections of code available in the switch statement below. Change switch(0) to whichever one you want.
Outcomment whatever code you want to use.
The default "0" case does the following things:
- If in boarding, enable reload (for if you get stuck during boardings)
- If ashore or in boarding, set player to player type (returns control if you are stuck and unable to move)
5. DumpAttributes allows you to to see all the data for any "reference" in the game, which could be a character or a location or a ship or anything else.
Easiest is to run this through console (see above). The results are put into compile.log; delete that file prior to running this line to get a "clean" one containing only the data you want.
Examples:
6. TraceAndLog combines the LogIt/Log_SetStringToLog and Trace commands.
In other words, this logs something to the screen so you can see it while in the game, but also writes it to compile.log so that you can find it later.
1. Don't use Windows Notepad as text editor; I use Notepad++ which is much better, free and can be found here: http://notepad-plus-plus.org/download/v6.7.5.html
2. Another complete and utter lifesaver that I use is WinMerge: http://winmerge.org/downloads/
This allows you to compare code files and folders with each other and find all differences.
3. Add your PotC folder to the Windows Search Index: http://windows.microsoft.com/en-us/windows/improve-windows-searches-using-index-faq#1TC=windows-7
That way, when using the regular Windows search functionality, it won't just search in the filename, but also in the file CONTENTS! And it is QUICK!
You can now use Windows Search to find all files that contain reference to certain function or variable names.
Then open all in Notepad++ and use "search in all files" and you'll have a list of all uses. And all that within a minute or so.
This is all based on free programs and built-in Windows functionality, but unlocks some really quite powerful options.
4. The wonderful world of CONSOLE!
- Open PROGRAM\console.c
- Find:
Code:
void ExecuteConsole()
{
ref pchar = GetMainCharacter();
ref ch;
int i;
int limit;
- Press F12 while ingame to execute
If you use windowed mode, this allows you to execute any code "on the fly" while you're still in the game.
There are a whole bunch of pre-defined sections of code available in the switch statement below. Change switch(0) to whichever one you want.
Outcomment whatever code you want to use.
The default "0" case does the following things:
- If in boarding, enable reload (for if you get stuck during boardings)
- If ashore or in boarding, set player to player type (returns control if you are stuck and unable to move)
5. DumpAttributes allows you to to see all the data for any "reference" in the game, which could be a character or a location or a ship or anything else.
Easiest is to run this through console (see above). The results are put into compile.log; delete that file prior to running this line to get a "clean" one containing only the data you want.
Examples:
Code:
DumpAttributes(pchar);
DumpAttributes(characterFromID(character_id));
DumpAttributes(GetShipByID(id));
DumpAttributes(Locations[FindLocation(pchar.location)]);
6. TraceAndLog combines the LogIt/Log_SetStringToLog and Trace commands.
In other words, this logs something to the screen so you can see it while in the game, but also writes it to compile.log so that you can find it later.
Last edited: