Page 1 of 1

Newbie advice/questions?

PostPosted: Tue Nov 22, 2011 7:02 am
by AltruismIsDead
I had been messing with Game Editor on and off for sometime, and to be frank my knowledge of programming is slim to none.

I've recently picked up some Beginners guides for programming in C, C++ and C# and had been looking over many of the tutorials listed on these forums.

Some of the burning questions I've been wanting to know, is instead of using the "Add Actor - script editor" can I basically use the Global Code editor to do all of my coding? And if so, which programming language works best with it? C or C++ ?

Then also is there different keywords used in game editor that aren't used in C/C++ ?

(My apologies in advance for this next long explanation of what I intend to do)

Basically I want to either create an actor, either via the Add Actor function, or through the Global Code editor, and give him inherited events from the script I wrote in the Global Editor (basically for walking, jumping, health bar, attacking/attack animation and so on)

Now I am running into problems defining these variables to be used for my Actor and am coming across script errors when saving the code (obviously I know this error is on my behalf due to my lack of programming knowledge)

I've browsed the list of Game-Editor Keywords, but I was wondering if there was such a keyword for how they use the Actor Control - Events - Key Down to define in the global script?

I really appreciate any help you can offer me. If you want a general idea of the type of game I am making (side scroller) I have a brief youtube video posted when I first started goofing around with GE.

http://www.youtube.com/watch?v=03AMooXE9bs
(Please remember this was what I first made when I first started using GE ;)

Re: Newbie advice/questions?

PostPosted: Tue Nov 22, 2011 7:43 am
by Chai
AltruismIsDead,

I watch your video and I think.
It is not a bug of the program. It is because of your code is not complete.

For the moon walk it can be because you can press 2 buttons for 2directions at the same time on Keyboard but not on the joystick. However, If you can clear for more code or event. You can fix this problem.

The Infinite Jump,
can be fix by code. such as add the variable for your actor.

CHAI

Re: Newbie advice/questions?

PostPosted: Tue Nov 22, 2011 10:06 am
by AltruismIsDead
Yeah, after a little research I was reading that those are basically the fundamental new user mistakes, by just going to create actor - key down - left x=x-5 (not exactly sure if that is 100% correct) but I had been reading on other peoples methods to completely avoid the moonwalk as well as the infinite jump, but unfortunately it makes no sense to me :(

Basically I don't understand if they mean by declaring a new "jump" variable, as in do you use the: "Global Code Editor - Variable - User Variable" and add it in through that, or if you can just declare/ #define / whatever a jump variable in the Global Code and use it as an Inherit Event for the character? Or by doing so would you have to basically completely code all of the Actors codes & actions?

Also I was still really curious as for what would be the best programming language to learn/most compatible with Game-Editor? I have read that you can edit the source code with C & C++ but that is beyond my level of experience.

But thanks for the comment and inspiration! Once I get more time to finish up reading some of those books I'll have to go over more of the tutorials here and see if I can comprehend them :)

Re: Newbie advice/questions?

PostPosted: Tue Nov 22, 2011 10:31 am
by skydereign
The programming language to learn is C, since gameEditor's script is a subset of the full C programming language (with some gE functions added). You don't need to learn C to the extent that you are a C programmer. gE makes it so you only really need to know a few things to start off. As you get better you'll learn more and more techniques, but as far as getting started, you need to know what a variable is, and how conditional logic works.

Now, you can't use global code to do everything. Global code is a place where you define variables and functions. The event scripts belong to the individual actors that you put them in. With those scripts, they can interact. The only way to have code you wrote in global space run in an actor's event is if you called a function that was defined in global space.

It seems one problem you are having is that you seem to be trying to make a game without adding an actor. There is a difference between Add Actor, and Create Actor. CreateActor is a way of creating objects while the game is running. Add Actor is adding new elements to the project, that can then be used in the game. So, you can't create an actor that doesn't exist (meaning you never used Add Actor to make it).

Now you need to understand that a variable holds a value. You can change the value as the game goes on, but the variable will always hold the value you tell it to. This is just a way for the game to remember things. Now to create a variable, you can go to global code, and add a script like this.
Code: Select all
int var_name;

That would create an integer called var_name. In the case you mentioned, you would want to add a jump variable. Also, I'd suggest trying the state method for moonwalking, so you might also declare a variable state (I bring up the state method as you should know you can declare multiple variables in a single global script).
Code: Select all
int jump;
int state;


Here' s a link to a tutorial on the state method that I wrote for another user. It isn't fully completed, but it gets the main point across. It currently assumes you know what a variable is though. http://game-editor.com/State_Method

Re: Newbie advice/questions?

PostPosted: Tue Nov 22, 2011 11:57 am
by AltruismIsDead
Thanks for the fast reply, it definitely did clear up a lot of my preconceptions about Game Editor.

I don't know why I was under the impression that you could basically code all of the actors scripts/actions etc through the Global Editor and just assign it to him and make changes when needed.

And it's greatly appreciated heading me towards learning C over the other programming books I picked up. I am only a couple chapters in and am slightly grasping the concepts of declaring variables, along with the pros and cons of using them over float variables/floating-point values and stuff like that. Hopefully I'll get more of a grasp on programming since I was never good at math and mainly had focused most of my time ever since getting a PC on graphic design.

Unfortunately I am sure I'll be running out and picking up more books on learning C and by the time I finish with those I'll have better questions to ask :)

Once again I greatly appreciate your comments and look forward to reading your tutorials and learning as much as possible.

Re: Newbie advice/questions?

PostPosted: Tue Nov 22, 2011 12:40 pm
by lcl
Hello AltruismIsDead!
Welcome to forum! :)

I don't know if it is useful to start trying to learn C from a book, because
those books have quite much information that is useless when using GE (Game Editor).

I have used GE about two years now, and I started with no knowledge of C or any other similar language. And I've learnt so much within these two years. I've not read any books or done anything else than used GE and challenged myself to do things that are on the boundaries of my skills. One thing that really teaches much is to look other peoples codes and try to write a code which has the same results. Sometimes I've even learnt by simply writing the exactly same code as someone else has written; while writing I've been asking myself questions like: "What does this part do?".

Of course, reading a C book has its own advantages, but you will still have to learn by trying, you can't learn to ride a bike from book, can you? :wink:

It's all about how interested and motivated you are to learn. And it seems that you are very motivated. :wink:

- lcl -

Re: Newbie advice/questions?

PostPosted: Wed Nov 23, 2011 5:54 am
by AltruismIsDead
Thanks LCL, and everyone once again. This has been a really great and helpful community and definitely appreciate all the advice everyone has given me.

I don't know if anyone has every played or modified Duke Nukem 3D, but back then I used to program using their "game.con, user.con and defs.con" files which I had to learn by myself, it was basically a simplified C language for adding new character actors, effects etc but was very limited. I am guessing Game Editor will be sort of like that. Like how you mentioned, look at tutorial programs and other code and piece it together to see how the pieces fit into the puzzle.