Page 1 of 2

help???

PostPosted: Mon Jun 20, 2011 11:55 pm
by SuperSonic
Does anyone know how to change the speed of an animation? :|

Re: help???

PostPosted: Tue Jun 21, 2011 7:44 am
by skydereign
You have to control it yourself using animpos. I made a time puzzle platformer based off being able to edit the flow of time using this. For example, you what to be able to edit the fps. So, every number of frames you want to change the animation. If the animation should run at 30fps then every frame you should increase animpos.
Code: Select all
animpos=(int)(animpos+1)%nframes;

Now, if you wanted it at 15fps, you would have to do it every other frame.
Code: Select all
timer++;
if(timer==2)
{
    animpos=(int)(animpos+1)%nframes;
    timer=0;
}


But if you want it to be variable, you should do it something like this. Note, this doesn't account for fps faster than 30 though that is completely possible. timer and anim_fps are both variables (make it actor if it is actor specific).
Code: Select all
timer+=anim_fps;
if(timer>=30)
{
    animpos=(int)(animpos+1)%nframes;
    timer=0;
}

Re: help???

PostPosted: Tue Jun 21, 2011 3:51 pm
by SuperSonic
Thanks, +point :wink:

Now here's another question (I might as well post it here)^^

How do I play a sound every time my character reaches a certain frame? (this would be for footsteps of course) :wink:

Re: help???

PostPosted: Tue Jun 21, 2011 4:35 pm
by schnellboot
if(animpos==3 or whatever)PlaySound("sound", 1.000000, 1);

Re: help???

PostPosted: Tue Jun 21, 2011 5:06 pm
by SuperSonic
But if I use the draw actor event to do this then it will play the sound over and over until the animpos changes. Know what I mean? :)

Re: help???

PostPosted: Tue Jun 21, 2011 5:12 pm
by Game A Gogo
add a variable as a trigger.
Code: Select all
if(animpos==3)
{
    if(sotr==0)
    {
        playsound();
        sotr=1;
    }
}
else sotr=0;

Re: help???

PostPosted: Tue Jun 21, 2011 5:26 pm
by SuperSonic
Perfect :mrgreen:

Re: help???

PostPosted: Tue Jun 21, 2011 11:45 pm
by SuperSonic
@Gogo: I gave you a point :wink:

Well I might as well post all of my questions here :roll:

1. Is there a global variable for the width and height of your game resolution?
2. How do you import graphics into your game? (I'm not talking about add animation, I mean when you export a game and then add graphics from a picture on your computer)
3. Can someone upload a good tutorial on how to use regions?
4. Is there a way to configure controls in realtime?

I think that's it for now. Thanks in advance :P

Re: help???

PostPosted: Tue Jun 21, 2011 11:51 pm
by skydereign
1. You can use view.width and view.height. Technically it isn't global but since there is only one view it essentially is.
2. You'd have to use fopen to import new graphics, usually bmp files. There are a lot of sources on the forums about using and importing bmp files.
3. A good tutorial on regions? Any region types in mind? You could be talking about activation, filled, wire frame, or canvas.
4. You can change controls in real time. gE has a built in function to do this using remapKey.
Code: Select all
remapKey(fromKey, toKey);
// so for example
remapKey(KEY_a, KEY_b);
// will map a to b

Re: help???

PostPosted: Wed Jun 22, 2011 1:30 am
by SuperSonic
1. You can use view.width and view.height. Technically it isn't global but since there is only one view it essentially is.
2. You'd have to use fopen to import new graphics, usually bmp files. There are a lot of sources on the forums about using and importing bmp files.
3. A good tutorial on regions? Any region types in mind? You could be talking about activation, filled, wire frame, or canvas.
4. You can change controls in real time. gE has a built in function to do this using remapKey.

2. Ok so use fopen to open graphics. But how do I use them?
3. I mean regions used to make multiple levels

Re: help???

PostPosted: Wed Jun 22, 2011 2:04 am
by skydereign
Well here is an example ged that loads bmp files. You have use a canvas actor though.
http://game-editor.com/forum/viewtopic.php?f=6&t=5778&p=40393&hilit=bmp+loader#p40393

I don't think there is a definitive tutorial on activation regions. Usually most questions answered about activation regions were individual in nature. If I can find the time I could put one together for you.

Re: help???

PostPosted: Wed Jun 22, 2011 3:29 am
by SuperSonic
Thanks. I'll have more questions soon so be prepared^^

Re: help???

PostPosted: Wed Jun 22, 2011 1:13 pm
by SuperSonic
These ones are a little more advanced :twisted:

1. How do I import my game into xcode?
2. how do I make text messages in my game?
3. What are the basics to creating 3d type games in GE?

Re: help???

PostPosted: Wed Jun 22, 2011 7:21 pm
by lcl
SuperSonic wrote:These ones are a little more advanced :twisted:

1. How do I import my game into xcode?
2. how do I make text messages in my game?
3. What are the basics to creating 3d type games in GE?

What do you mean by that?
I can't help you in those other ones, but I may be able to help you with that one
if you tell me what you mean. :D

Re: help???

PostPosted: Thu Jun 23, 2011 1:13 pm
by SuperSonic
Oh sorry, I didn't mean to be vague :roll:

What I meant was, when you play a rpg like "Winter Blast", characters will talk to each other using pop-up messages. I was wondering how to do that :)