#include "LoadLevel1.h"
int LevelGravity;
loadLevel1();
That is how i want to do it. Make a file where i load my script/function (dont now what its called here) and then call them from anywhere. I dont want the program to take a look at the script/function UNTIL i use it, so it doesnt complain about undeclared variables.
Ive found it easier for me to jump right in programming and then experiment with codes. I started programmign i GML "gamemaker language" and mastered the language in one month. I think experimentation is the best way. Maybe not for anyone, but i feel so for me I aldready got a halfstable engine running, started just a few days ago. Knowing 0 about c++.
But.. I know im doing wrong I just like to play around with codes. And if it gets too much then maybe grab a tut, or two. Or maybe drop a question here.
Thanks though, i really should listen to your advice and shut up XD
Did you read what Ion Dune wrote? C++ is NOT NOT NOT a scripting language, so no scripts.
And if you do not declare some variable the compiler will not stop complaining, because your code is getting COMPILED and the compiler MUST NOT ignore your functions/methods whatever.
Btw. your GML is NOT compiled, thats the difference.
If you don't understand what I wrote, then it's one more sign that you should read a book or at least tutorial. C++ is not easy!!:!:
And please next time post some code, so everybody can see what exact problem you have, you will get more response.
OK, C++ is a compiled language, not a script. This does matter, since the compiler does quite a lot of checking of your source as it's compiling it. If there's something wrong, then you want it to fail during compilation. Better that than to have it crash during execution.
What you are asking about is utterly fundamental C/C++. I suggest that you read about:
This is possibly the first post on this forum I feel I have any semblance of authority discussing
I'm kind of starting out with C++ too, but picked up C-Script a few years ago and have been using Python at Uni for all this year. I'm like you, in that I like to get out of depth to learn things (which Irrlicht has been a lot of fun for so far), but if there's one book I recommend, it's C++ For Dummies. I'm not a huge fan of the For Dummies books, as they seem a little hit and miss of how well they're written (since they're by different folks), but I found the C++ one absolutely perfect for me to learn it.
Just a suggestion. Covers everything from ints to polymorphism and templates. Does pointers and classes really well. Read through it once and THEN do the experimenting, and it'll save you buckets of tears.