• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

fake types header?

rags707

Landlubber
I've tweaked some of the PotC code for fun. But I'm finding it really a pain to hunt down silly syntax errors and such. I was wondering, has anyone put together a fake types header, maybe with prototypes for some of the engine functions so that i could #include that file, and compile in my usual c compiler?

Does PotC do anything really outside the bounds of C syntax rules that would prevent this from working?
Not to actually compile and run PotC code, just so I could have the compiler guide me to all the little mistakes.

Thanks for your time.
 
I wished I could help you, but I don't have much true programming knowledge and actually don't have a clue what you are asking. Sorry... <img src="style_emoticons/<#EMO_DIR#>/oops3.gif" style="vertical-align:middle" emoid=":eek:ops2" border="0" alt="oops3.gif" />
 
What I mean is to create a header file that has definitions for the data types used in PotC. I don't all the things included in a Ship, but this would be an example.

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
struct Ship
{
     int MaxCargo;
     float MaxSpeed;
     float MaxTurn;
     int NumCannons;
}
<!--c2--></div><!--ec2-->

What I'd like to make is a header file that would contain definitions for all the PotC data types. object, ref, aref, character, ship, Dialog, and other stuff like that. Then you #include this header to a PotC file, say enc_officers.c then actually compile the code using a c compiler. I code using Visual Studio .Net for instance. The advantage to this being the compiler would direct you to any errors you've made, like missing semi colons, non matching {}, wrong number of () and the like.

Currently I can open and edit the PotC files in my compiler, but all I get is a bunch of undefined functions and types errors making it no better than any text editor except maybe for the keyword coloring.

I'd be willing to work on putting something like this together if one doesn't exist, but I'd really appreciate some help from the community as I don't know what all the types are, or what they are used for. If I could get that kind of info from some of you more experienced modders I think this could become a very useful tool for PotC, and later for AoP. As I understand it AoP is built on the same code base as PotC. Sure there will be differences, but the underlying structure (data types!) should be mostly the same.

Does that help clarify what I'm aiming at?
 
<img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />
Maybe you need to talk to ALEXUSB he is member of this forum ,but also has <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
in russia his own potc mod called Sea legend is back . He has combailed all his modded files they are not open code and he says it is faster this way. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
<a href="http://legend.seaward.ru/eng/index.html" target="_blank">Sea legend is back</a>
here is link to his russian mod pages this is english version.
I hope that link works. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />
Bye CapHawk <img src="style_emoticons/<#EMO_DIR#>/type_1.gif" style="vertical-align:middle" emoid=":nk" border="0" alt="type_1.gif" /> <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Back
Top