User talk:X

From ENIGMA
Revision as of 05:56, 5 September 2013 by X (talk | contribs) (→‎Variable Types and Data Structures: Quick reply)
Jump to navigation Jump to search

Welcome

Hello there! I am Robert the Wiki's current organizer and oversight. Due to your recent contributions I have decided to grant you administrative privileges which should aid in your article contributions. I personally want to thank you for coming along and helping with the project, as I myself can get quite stressed with the workload between the compiler and IDE augmentations.

You seemed to be a tad bit confused with the function documentation format as I could tell with ds_grid_add_grid_region, so I thought I could offer you some help. For data types you should create a new column to the tables such as with draw_background, or simply Parameter !! Data Type !! Description I would also like to let you know that most data types can be found in the common headers folder for most of the major systems, for instance with graphics also here is the file containing the data structure definitions, also don't worry about placing the WIP template on the top of all function pages, I avoided that to not scare people away from editing so they could very easily edit the function docs and also becuase I do regular maintenance using AWB with User:FrogotoBot

Also, avoid explicitly mentioning functions as being GameMaker or LateralGM related, as that can get overly technical since LGM is really a separate project which can still be used for just GameMaker IDE on Linux, unless of course it is necessary to mention that for instance a function behaves differently in ENIGMA & LateralGM. You can also now modify our MediaWiki:Geshi.css and MediaWiki:Vector.css style sheets with Admin privs as I have tried to avoid hard coding things for instance how parameter names are italic in the function doc tables. I am still in the process of updating the constants articles to use the same table template though.

Ohhh and Actions have all already been documented, there is no need for Drag and drop, unless of course for maybe a separate tutorial.

That said, thank you for the contributions, and your welcome to stay as long as you like! :D RobertBColton 00:04, 20 August 2013 (MDT)

Thanks for the upgrade; I will change the functions and delete Drag and drop. We can always revive it if we ever want an extreme-beginner level tutorial.--X 03:46, 20 August 2013 (MDT)
Son of a gun, we have this bug with administrators being downgraded and it just happened to you. It used to happen to me all the time and they got so tired of it I was just made a bureaucrat. I am going to file a bug report on the websites repository. For now, just leave me a list of things you need deleted or moved and I can handle it for you. RobertBColton 10:05, 20 August 2013 (MDT)
No problem, Drag and drop was the only one that needed deleting/moving for now. Also just noticed that the message below the editing box redlinks to ENIGMA:Copyrights.
Holy cow, you work quick man, just put the link MediaWiki_Markup over on MediaWiki help. There is also Special:SpecialPages which can help you find redlinks and pages that get stuck in loops, etc. I have also filed a bug report on the demotion thing here, it demotes me too, I have to bureaucrat myself every time I log in, hopefully we will resolve it when we get around to our php upgrade, then we will have the regular Wikipedia editing toolbar as well. RobertBColton 01:06, 21 August 2013 (MDT)

Variable Types and Data Structures

Howdy doo.

std::string is the standard (std) string object in C++ it is basically just a class/struct or as you may think of it an object that holds const char* or an array of char, char is a data type 0-255 representing each letter of the alpha bet ABCDEFG etc. and is also sometimes referred to as byte because it is the same amount of data in a single byte, an integer for instance is 2 bytes, when signed it uses both bytes to represent a number in the range of -32000 to 32000 when unsigned it uses both bytes to represent 0 to 65536 or something, for more information on C and C++ data types, just Google, but I also made a useful table at Data type

But basically, std::string is just usually what we use to represent Game Maker's equivalent of string(), because again, it is the C++ standard

Here is another example...

unsigned abc = 5;
unsigned int abc = 5;

Both mean the same thing. And the same for this...

signed abc = 5;
int abc = 5;

Because integer is signed by default, float and double are as well but they can never be made unsigned like an integer can. Now the reason this comes into play with ENIGMA is, for instance you would never have a sprite id that is negative so it would be safe to use unsigned, however we do not actually do this because sometimes people pass things like -1 for d3d_model_draw to indicate they don't want the model textured.

The difference in double and int for x and y in those data structure functions is, that they should all be unsigned I believe. You can never use 0.5 for instance as the x cell in a data structure grid, know what I mean? I think whoever wrote those, which was User:polygone was just confused, and they will most likely be rewritten so that x and y are unsigned to prevent array index out of bounds.

Now as for boolean, true and false are a keyword in C++ but not C just like in GML or EDL.

Here is example code...

bool myfunction() {
  if (foo == bar) {
    return true;
  } 
  return false;
}

I make it practice of referring to bool/boolean as true or false on function articles and never 0 or 1, but actually true is just any positive number, which makes this code work...

if (myvector.size()) {
  // if the size of my vector is larger than 0
}

You could note that somewhere in some article somewhere what true or false is the equivalent of. Because actually in Game Maker, any number that is not 0 is counted as true including negative numbers, which makes our collision functions not work out of the box, because Game Maker returns -4 meaning there was no collision which ENIGMA does the same, but the difference is...

if (!collision()) {
  // there was no collision
}

Should be written as...

if (collision() == -4) {
  // there was no collision
}

In ENIGMA, so far we just leave it like this, but there really isn't much we can do because negative numbers are not true in C/C++

Oh and also, variant means the data type varies it could be a string a boolean an integer a float, etc. it is the equivalent of Game Maker's var foo, bar;

Also, I have am way swamped with coding man I am in the middle of redesigning this sprite editor, so I have decided to make you a bureaucrat to the Wiki. Simply go to Special:UserRights to give yourself administrative privileges when you need to move articles and delete things, I would have just made you an admin but our Wiki software is currently broke with the forum database so you get automatically demoted when you log in, we have yet to fix it, at any rate you have been doing a good job so I am counting on you and giving you my trust, so don't mess it up :)

Also when you move pages you need to delete the original page after it is moved because the Wiki just adds a #REDIRECT to the new page. If I were you I would also just redirect Constant Double and other data types to Data type article to make them all findable in one place, and it is a lot less work on Wiki editors.

That was a good explanation - now I can fill out all those functions' return values correctly. I'll make myself an Admin when I next need to move/delete a page - thanks for the trust in the meantime. --X 03:56, 5 September 2013 (MDT)