Pritator Source

Joined
Feb 22, 2008
Messages
2,427
Reaction score
757
Does anybody have the new pritator source code, that one with NPC Editor function? I tried using reflection, but it seems that he programmed in german and, really, .net reflector is not soo good lol

that part when he draws those little green dots in the map according to the npc position really interested me. I think I saw one time some source for pritator, cant remember for sure now.

thanks
 
It was a project to learn to program. I'm not sure they are "errors" so much as very poor coding style, and a lack of planning ahead. Which the author freely admitted. (if not in those exact words)
 
I'm fairly sure it was passed to me by Sumomo. I doubt he went to the trouble to decompile his own source to zip it up and share it with us. XD

It all looks perfectly normal to me, considering he only just figured out what a comment was when he stopped working on it and decided it needed to be rewritten from scratch. :lol:

Most of the "generic" nature of it is how vb.Net wizardy stuff makes things if you don't put your own stamp on it. Like classic VB where every button was Command1, Command2 etc. and you still see that many people don't bother to give controls a sensible name. :(:
 
Probably not as bad as my "PT Protector" source code that is full of the most stupid, random variable names (like "pork", "burger", etc).
Its not that bad dk :(: It is pretty awesome tho.

What I think that every coder should do, is use the "International standards", like, an
interger variable: iVariable
string: szName

use camel case in methods:
ThisIsMyFunction();

I myself dont do everything that I said, but mostly by lazy XD, but its annoying.. look at the pritator source ie:
Konstanten
Funktion

lol, they should be written in english aswell, but thats just my opinion XD
 
What I think that every coder should do, is use the "International standards", like, an
interger variable: iVariable
string: szName

That's not a "standard", it's called "Hungarian notation".
And imgo it's stupid ;)

it's like calling int theInt ... int iAge... compiler know what type it is and when you change it you will have to change everything.
 
OT:
Hmm. Trouble is, once you're into object land you almost never refer to a standard data type. It's all pointers to overloaded objects of one kind or another, and their are millions of the buggers for each framework.

If you find that iAge needs to become lAge you can run a cross file search and replace. Actually, an "int" used to be a 16bit signed integer figure when I started seeing this notation used first, and could easily be a 64bit one (or 128bit on most consoles) under the same reasoning today... rendering it's meaning pretty vague.

*Some* notation of what type is often helpful. I like to name forms and controls FrmThis, BtnThat, TxtTheOther, LblBoring, ChkTickled, RadPink or WHY. (That's "What Have You" as in "or what ever else" for the acronymically challenged English reader)

What I find really annoying is strings, and the idea that a string is just a string. It is not. Is it a *WCHAR, *char, lpszAnsiString, lpszOEMString, Pascal or BASIC string, UTF16, UTF8, (BASIC or C style for either) etc. etc. etc.

*WCHAR is not the same as *UnicodeString (or a UTF16 string) for example, because *WCHAR is Microsoft MBCS format, not standard 16bit Unicode. BASIC and Pascal strings are (traditionally) recorded with an int / long length and then a "stream" of bytes of that length following... they can encode a null (zero) byte within the string and are great for using as dynamically allocated and changing memory buffers. A C style string starts with the first character and ends when it hits a 0 byte... or word if it's a mult-byte C string. The actual C string (or ZString, as zero terminated) is an array of type char but the char type is not defined by the C standard as being a byte, or a UBYTE or anything at all, which is why types of byte and UBYTE commonly exist, differentiated from the char type. (traditionally, char was a 7bit unsigned integer)

So even saying lpsz (Long Pointer to a String which is Zero terminated) doesn't tell me quite all I would like to know about this "string" thing. :lol:

Still, since I am used to looking at disassembled code and making it more readable, anything which reduces the time it takes you (especially if you aren't the original author) to actually understand what the code is doing is great. ^_^
 
OT
For the love of god, Sheen stay with CamelCase:
SheenBR - Pritator Source - RaGEZONE Forums


Unless you are planing to do code obfuscation using Hungarian notation :)

HN had some sense in C but now it's useless and confusing.
M$ created HN to produce more bugs in Windows OS.
 
Still OT:
Actually, I believe that M$ adopted HN from another firm when they acquired a major employee, and made some Windozeish modifications to it.

I keep thinking about how cool and yet incredibly odd the Variant type was in classic VB. It would hold just about anything, a "string", a number, integer, float, an error or VBs freaky idea of a boolean. (a four state bool?) So you could declare everything as Variant, and put numbers and words and truth states and files and rich text and everything into it at different stages of the program, and VB would just work it all out for you. Of course, if you got it wrong it would still compile, and run without a hitch, only your result would be completely nonsensical. :lol:

Going back further, we used to need to use notation in every place a variable name appeared to identify it's type. Largely because not all languages required you to "declare" variables before hand, so any word that wasn't a "keyword" was assumed to be a variable. The norm was that it would be a float, or "real" number. Strings typically had to start or end with $, and integers with a %. Sometimes you got an @ to indicate some small integer, or a pointer.

All of which is no better or worse than operator overloading in OOP. It's great! But hold on, is . a property of, or is it ->? Form.Caption.Text, or TForm->Caption->C_Str? Oh! You mean it depends what framework I'm using? Well, hang on, I'm using several frameworks by different developers, and I want to move the bitmap from this file container class with the image framework I chose into the GUI framework I'm using by someone else... But... No... So is it... Gahhh! :grr: Maybe someone should have developed a "standard" before introducing such a powerful tool. :lol:
 
Good God, if I ever saw you using Hungarian Notation, Sheen, I would slap you...

The only time I ever use anything close to HN is when naming winform control instances, purely for convenience. ie. lblName for a label.
 
Last edited:
Hungarian notation is a must when coding in C++.

Code:
string sName;
char szName[30];
const char * pszName = "Filter";

void DoStuff(const char * _pszName)
{

}

void DoStuff(int _iValue)
{

}

BYTE byValue = 0;
USHORT usValue = 0;
int iValue = 0;
int * piValue = &iValue;
float fValue = .0f

s -> string
sz -> string terminated by zero
i -> int
by -> byte
pi -> pointer to int
us -> unsigned short
psz -> pointer to string terminated by zero
f -> float
_ -> for all parameters in methods

Also global variables should start with g_ and member variables m_.
extern MyClass * g_pMyClass;

However, in OOP global variables shouldn't exist.


I strictly stick to these conventions while coding in any language.
 
I think it depend on person. I would never use it. Linux kernel also don't use Hungarian Notation. And for me Linux kernel is a master piece of standards. Code is easy to read and straight to the point.



Encoding the type of a function into the name (so-called Hungarian
notation) is brain damaged - the compiler knows the types anyway and can
check those, and it only confuses the programmer. No wonder MicroSoft
makes buggy programs.

I believe that those are words of Linus Torvalds.

For me names with sz, i, pi... and so on look like haXoR language >=P
Maybe I'm too old.

PS. In C# (I think) even MS left HN. Everything is an object.
 
Last edited:
I think it depend on person. I would never use it. Linux kernel also don't use Hungarian Notation. And for me Linux kernel is a master piece of standards. Code is easy to read and straight to the point.





I believe that those are words of Linus Torvalds.

For me names with sz, i, pi... and so on look like haXoR language >=P
Maybe I'm too old.

PS. In C# (I think) even MS left HN. Everything is an object.

Not everyone codes in a development environment that has intellisense, I find myself coding in notepad all of the times and because of this notation I can easily remember all variables throughout the entire source code. Which I can't do when I am using plain words. Also the link you have provided: do_stuff(), lots of underscores in methods is C and not C++. For your information the linux kernel was written in C and not C++.
 
Back