New to Game Editor and have ?

Game Editor comments and discussion.

Re: New to Game Editor and have ?

Postby skydereign » Sat Feb 19, 2011 12:31 am

Ah, well there are things called variables. They hold information, in this case we are talking about an integer. It holds a number, so you can store values in that number, like 0 or 1, that you can use later. In this case the variable gameState holds the current state of the game. 0 is for unpaused, and 1 is for paused.

Creating a variable:
1. Go to the script editor.
2. Click the button [Variables]
3. Click [Add].
4. Type in the variable name, in this case gameState.
5. (Notice that is is integer) click [Add]
6. Click [Close]

After that the code will work. Here are some simple things you can do to manipulate variables.
Code: Select all
variable=5; // sets the variable equal to 5
variable+=5; // increases the variable by 5
variable-=5; // decrease variable by 5
variable*=5; // multiplies variable by 5


Lastly, the most important thing with variable is that you can use them to make events do different things.
Code: Select all
if(gameState==0)
{
    PauseGameOn();
    gameState=1;
}
else
{
    PauseGameOff();
    gameState=0;
}


The above code will do essentially the same thing that the original code I sent you does. The if statement checks if the variable gameState is equal to zero, and if so execute the code within the {}. If not (else), execute the code after the else. If you want I'll pm you a better description of variables.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Sat Feb 19, 2011 12:49 am

sure PM me that. Keep in mind that I am new to code so you have to be very detailed because it might be a little over my head.

But the pause work. you are really helping me out very much.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Sat Feb 19, 2011 10:45 pm

So i have yet another question. I have a actor that is a "try again" botton. So basically what I want it to do is reset the game to the start screen and reset everything so the player can start over. So basically what I want the botton to do it to make the game go back to the way it is when you just lunch the game.I got the exit botton going but I jave no idea what to put for a complet reset. I am sure that its going to be easy but I have no idea how to do this.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby skydereign » Sun Feb 20, 2011 1:39 am

Well, if you don't mind loading the game again, you can use LoadGame().
Code: Select all
LoadGame("yourgameName.ged");


Otherwise, you'll have to reset all of the actors to the way they were at the start of the game. Only disadvantage of the above way is if your game is really big, it would take longer to reload everything.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Sun Feb 20, 2011 2:51 am

I guess that would be the easy way. To reset all the actors seems to be more complicated. Ill try that and see what If its not to much waiting. Also my PNG files are 16bit. If I make them 8bit would they still work or would they be a problem?
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Sun Feb 20, 2011 2:57 am

With the reload game there are 2 things I want to ask.

1. Will I still be able to save a high score? I still have not got that high score thing done but that is one thing I need to do.

2. Since this is going to be for the iphone will this still work in the iphone also?

Thanks for all your help.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby skydereign » Sun Feb 20, 2011 4:53 am

LoadGame should still work on iPhone, but i have heard one case of it acting weird. In your case there is only one ged, so it shouldn't. 8bit pngs should be fine. For hiscores, you'll need to use saveVars and loadVars, so using LoadGame shouldn't effect that. You might try looking at some saving tutorials, it'll explain the mechanics of saving.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: New to Game Editor and have ?

Postby again » Sun Feb 20, 2011 5:13 am

Ok I have a GED with highscore save here

viewtopic.php?f=6&t=9119

Its a Mario-kart mini game after you play it , your highscore is saved. The way you might want to do it might be different. In any case just ask and we will assist you.
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Mon Feb 21, 2011 7:48 pm

thanks guys for the help I will look into this also and checkout the file to see how you did it and get a idea on how its done. So far I have learned a lot more than I thought I would and its all thanks to people like you. Again I cant say thank you enough times.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Thu Feb 24, 2011 12:30 am

Well it looks like I fail at saving the hi score. I looked at your mariocart game and tryed to see what you did to save the hi score but I could not get it to work. Other stuff I have been able to make work but this is just killing me for some reson. I guess I am not geting it at all. :(
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby again » Thu Feb 24, 2011 3:33 am

Ok dont get down on yourself , get tough and ready to code. Open your game right now and let"s do this ok!!!! Lets get the highscore done now!!!

Step by Step Go name your highscore actor highscore ok before starting the rest. Also name your regular score actor score ok that make this easier and bug-free.

1)Go to global code(the tab on top bar of screen) declare variable

NAME: hscore
SAVEGROUP: nscore

2) Ok go click on your player( the person you controling) click on collision , pick any object that kills you, and put this code in script editor

Code: Select all
saveVars("h.file","nscore");
hscore=highscore.textNumber;


3)ok now go click on the highscore actor( make sure the name of highscore is highscore) now click on create actor and go to script editor
and put this code in

Code: Select all
loadVars("h.file","nscore");
highscore.textNumber=hscore;


4th and final step (yes its almost over) Click on your highscore / click on draw actor / and put this code

Code: Select all
if(score.textNumber>highscore.textNumber)
{
highscore.textNumber=score.textNumber;
hscore=highscore.textNumber;
}


Thats it your done and it will work . If in the crazy case it doesnt , look over the code. Remember to name your regular score name it score and your highscore name it highscore. Also on your computer a h.file will be in the folder. Thats your highscore save file so dont worry its not something wierd. Best of luck!!!!
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Fri Feb 25, 2011 1:59 am

thanks that did it. I did not really understand what is going on but it worked. I kind of have a idea what this did but not sure why it did it. Basically what kills my main actor is time so I had to make the time be the one that acted like the bad guy that kills you. So i applyed this that you posted to my situation but like I was saying I really dont know why it works this way. I am not a coder so its a little harder for me to see what is going on.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby again » Fri Feb 25, 2011 1:21 pm

REDNSX wrote:thanks that did it. I did not really understand what is going on but it worked. I kind of have a idea what this did but not sure why it did it. Basically what kills my main actor is time so I had to make the time be the one that acted like the bad guy that kills you. So i applyed this that you posted to my situation but like I was saying I really dont know why it works this way. I am not a coder so its a little harder for me to see what is going on.


Basically what you did was

1) Made a variable and put it in a save group (name, save group)
2) Made the variable equal the highscore ( highscore.textNumber=variable)
3) Now when you die you made the variable saved and made a separate file which to save ( saveVars " your made up file""save group your variable is in")
4) Finally you made the variable load in the highscore when the game starts (loadVars"your made up file name" "save group your variable is in" )

Hope that help trust me saving in general is probaly one of the most complex parts of game making. Why do you think iphone has so many unlimited random repeatitve games. Because they dont know how to install save features. I am happy that you got it to work and look forward to seeing your progress.Never quit and stay up!! Your going to love the games you make and if you pursue it futher , you might but able to make some money with it :D
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

Re: New to Game Editor and have ?

Postby REDNSX » Sat Feb 26, 2011 2:22 am

Ok i see what is going on now. I think I got it.

I have notice thet my frame rate is droping sometimes. I have not add new actors but since all the game is in one file the actors are cloned a lot of time. I know there is a region tool but I would have to include everything in the file to use it so basically I would be right were I started. Is there a way to make different regions that are only active when the view is in the region. When the file was only one level it was runung great but now that I have 3 level and 2 bonus level it seems to slow down sometimes. So is there a way to make regions active only when the view actor is in it?


Thanks.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: New to Game Editor and have ?

Postby again » Sat Feb 26, 2011 2:40 am

Yes there is its called activation regions. Ok open game editor and along the top bar you will see something called Regions.Click on it and a tab called pops up. Click on activation region and a yellow box will appear. Click on the edges of the yellow box to stretch it and make it bigger. Make the yellow box go around your 1st level. Now go and get another activation region and put it around your 2nd and 3rd level. Make sure each activation region touches each other , a little over lap wont be a problem. Now your game will only load what is in the activation region and will shut off whats in the other activation regions.
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

PreviousNext

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest