Newbie advice/questions?

Game Editor comments and discussion.

Newbie advice/questions?

Postby AltruismIsDead » Tue Nov 22, 2011 7:02 am

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 ;)
User avatar
AltruismIsDead
 
Posts: 38
Joined: Mon Sep 19, 2011 10:55 am
Location: Milwaukee, WI
Score: 6 Give a positive score

Re: Newbie advice/questions?

Postby Chai » Tue Nov 22, 2011 7:43 am

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
User avatar
Chai
 
Posts: 361
Joined: Sat Apr 30, 2005 2:26 pm
Location: Thailand
Score: 30 Give a positive score

Re: Newbie advice/questions?

Postby AltruismIsDead » Tue Nov 22, 2011 10:06 am

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 :)
User avatar
AltruismIsDead
 
Posts: 38
Joined: Mon Sep 19, 2011 10:55 am
Location: Milwaukee, WI
Score: 6 Give a positive score

Re: Newbie advice/questions?

Postby skydereign » Tue Nov 22, 2011 10:31 am

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
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Newbie advice/questions?

Postby AltruismIsDead » Tue Nov 22, 2011 11:57 am

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.
User avatar
AltruismIsDead
 
Posts: 38
Joined: Mon Sep 19, 2011 10:55 am
Location: Milwaukee, WI
Score: 6 Give a positive score

Re: Newbie advice/questions?

Postby lcl » Tue Nov 22, 2011 12:40 pm

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 -
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Newbie advice/questions?

Postby AltruismIsDead » Wed Nov 23, 2011 5:54 am

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.
User avatar
AltruismIsDead
 
Posts: 38
Joined: Mon Sep 19, 2011 10:55 am
Location: Milwaukee, WI
Score: 6 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest