question about events

You must understand the Game Editor concepts, before post here.

question about events

Postby sillydraco » Sat Apr 11, 2009 1:13 am

well i was trying to figure out how i would do lives and a game over screen, is there a way activate an event when another event A (collision with baddie -> destroy actor Player) occurs once, and activate a different event when event A occurs the second time, and the third, etc? basically im looking for something simple that i can use for other things too, such as limiting jumping and making floors only able to be walked on three times before destroying themselves.
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: question about events

Postby skydereign » Sat Apr 11, 2009 1:25 am

Variables. You can make them one of two ways. But you will need to start using script editor if you don't already. But scripting will allow you to do almost anything you want to do. There is a button at the bottom left of the script editor that adds variables. You would create an int. You can then use this int (basically a number), and change it and reference it. I prefer to declare them in global code, also found at the bottom of the script editor, or the top of gE. If you are using global code, put this in,
Code: Select all
int VAR;

VAR would be the name of the integer you are using. So in this case it is just a count that you would increase upon destruction. So at the trigger of A, increase it. And since A occured and VAR was 0, do event, if VAR is 1 do other event.
Code: Select all
if (VAR==1)
{
    // put code here, so you know // comments code, meaning it does not look at code behind the double slash
}


I think this may be achieved through activation events, but you will still need a variable to record how many events have happened. Sorry if this wasn't that easy to understand... I can try again if you wish.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: question about events

Postby sillydraco » Sat Apr 11, 2009 1:36 am

thanks! is there a place that lists the actual code of each event? like there is the changeanimation one, and im guessing there is one for each event to put in script editor!
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: question about events

Postby skydereign » Sat Apr 11, 2009 1:55 am

Yeah, the second button from the left will give you all the functions you use, or most of them anyway.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: question about events

Postby sillydraco » Sat Apr 11, 2009 2:05 am

wait, the second button from the left...in the Game Editor? because that would be Add Actor :3
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: question about events

Postby skydereign » Sat Apr 11, 2009 3:14 am

No, when you add an event, then set it to script editor, the button called variables/functions. Using script editor instead of single events, you can add as many events as you want. An example being, you might be used to doing keydown change animation and keydown, moveto. Instead those can both be in the script editor. All of the functions can be used there. Just find it and use it.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: question about events

Postby sillydraco » Sat Apr 11, 2009 3:18 am

aha i see! thanks! this makes things sooooo much easier :D
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest