help???

Non-platform specific questions.

help???

Postby SuperSonic » Mon Jun 20, 2011 11:55 pm

Does anyone know how to change the speed of an animation? :|
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby skydereign » Tue Jun 21, 2011 7:44 am

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

Re: help???

Postby SuperSonic » Tue Jun 21, 2011 3:51 pm

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:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby schnellboot » Tue Jun 21, 2011 4:35 pm

if(animpos==3 or whatever)PlaySound("sound", 1.000000, 1);
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: help???

Postby SuperSonic » Tue Jun 21, 2011 5:06 pm

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? :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby Game A Gogo » Tue Jun 21, 2011 5:12 pm

add a variable as a trigger.
Code: Select all
if(animpos==3)
{
    if(sotr==0)
    {
        playsound();
        sotr=1;
    }
}
else sotr=0;
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: help???

Postby SuperSonic » Tue Jun 21, 2011 5:26 pm

Perfect :mrgreen:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby SuperSonic » Tue Jun 21, 2011 11:45 pm

@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
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby skydereign » Tue Jun 21, 2011 11:51 pm

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

Re: help???

Postby SuperSonic » Wed Jun 22, 2011 1:30 am

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
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby skydereign » Wed Jun 22, 2011 2:04 am

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

Re: help???

Postby SuperSonic » Wed Jun 22, 2011 3:29 am

Thanks. I'll have more questions soon so be prepared^^
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby SuperSonic » Wed Jun 22, 2011 1:13 pm

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?
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: help???

Postby lcl » Wed Jun 22, 2011 7:21 pm

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

Re: help???

Postby SuperSonic » Thu Jun 23, 2011 1:13 pm

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 :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest