Page 1 of 1

Just starting...

PostPosted: Mon Jun 08, 2009 8:47 pm
by sirmatthew
Hello--

My first post here. I've designed a game on paper, somewhat more mathematical than graphic-based, but I think Game Editor just might work for what I'm wanting to do. I'm actually pretty excited about creating it and have spent a couple of days scrolling through the demos, watching tutorials on YouTube, studied some of the wiki pages, and read up on all the keywords. I'm just not finding this to be as easy as advertised. I feel like I'm in a dark room, but I know it will all make sense once I can manage to turn the light on. I'm off all week and planning on sticking with it, but am also hoping someone here can help me find the light switch.

Based on one YouTube video tutorial for activation events I created an actor (number) which can be raised or lowered by clicking one of two other actors (buttons...pacman icons in the attached graphic). It works fine. Just to experiment with variables and such I created another field which should subtract the age from the number 100 and display the result. That part is not working yet no matter what I've tried.

There will be no collisions between player objects during game play as it will be set up like a spreadsheet with each number in its fixed place). I don't understand how to save the final age as a variable for use and display elsewhere in the program. Creation of an int variable hasn't been working for me and I'm going a bit nuts here. How and where should the script be written to accomplish this?

Re: Just starting...

PostPosted: Mon Jun 08, 2009 8:57 pm
by skydereign
Not sure if I completely understand what you are trying to do, so I don't fully grasp your problem, but variables are key for this. There are two ways that you can create variables, one in global code, and one in script editor's add variable. If you are doing it in global code, initializing an int would look like this,
Code: Select all
int age;

age being the name. You would then need to make a name for this code and then click the add button. This variable is open for all to see. The other way is to click the add variable, for now you would just give the variable a name, and then click the add. You want an int, so the defaults are the same. Anyway, since the variable is not actor specific, it would be in global space.
If you make the variable age, then utilize that to store the number, I don't really know how you are holding the number without a variable, unless you are using textNumber, and in that case you could use this built in variable instead, I wouldn't suggest it. So in the text actor displaying the 100-age, you would put this in the draw actor event's script editor.
Code: Select all
textNumber=100-age;

If you post the .ged I could figure out what you are doing, but it is not necessary.
If this is not what you wanted or anything else comes up, I can try to help.

Re: Just starting...

PostPosted: Mon Jun 08, 2009 9:32 pm
by sirmatthew
I had to play with it for a minute, but it worked. That was a big step in the right direction, thank you!

Re: Just starting...

PostPosted: Tue Jun 09, 2009 12:30 pm
by Bee-Ant
use this instead of textNumber
Code: Select all
sprintf(Text1.text,"Your Age : %i",age);

and
Code: Select all
int rest=100-age;
sprintf(Text2.text,"Number of years until you reach age 100 : %i",rest);

You can save 2 actors this way...

Re: Just starting...

PostPosted: Mon Jun 15, 2009 4:02 am
by sirmatthew
Thanks for the replies, they were quite helpful!

I've been toying with GE all week and think I'm finally getting the hang of it now. I created several test files and played with adding activation events, animations, manipulating variables, etc. Just wanted to post this follow-up as I'm sure there might be others who are tempted to give up if they quickly think GE is difficult to learn. Just give it time and keep playing with it. Now that I better understand what the program can do I'm REALLY excited about future projects!!

Next, I'm going to spend some time creating an interface graphic which will be the primary screen in my game. Once that is done I'll be coding all the action using GE. I may have a question or two later on, but wanted to thank you again for helping me so far.