Chess Clock, Python, SDL's and Global Animation

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Thu Feb 28, 2013 1:47 pm

Iv been thinking of building a chess clock for one of my ages, so far I found out it may be possible with global animations, sdl,
and a python dummy. what I was hoping to do is set the Chess age to a one hour day use global animations for the minute hand
and every time the minuter hand completes one full animation it would move the hour hand one stage in a 12 stage animation.

I have to be able to turn on and off the global animation (assuming thats possible)
I was thinking of having a one hour animation for the minute hand and have the Chess age set to a 12 hour day for the hour hand but I think thats a bit much.
I was also wondering if I can have two DayLength's a 1 hour DayLengh for the minute hand and a 12 hour DayLengh for the hour hand using prp files

Some how I get the feeling im missing obvious, perhaps a way of setting the DayLengh to a 12 hour day and set the minute hand to rotate 12 times in one day.

this particular project is a bit out of my league but I do have a few ideas on how it might work, I was hoping I could get some of the people here
with more knowledge on coding and game engines to help out with some advise on how it may or may not be possible

Thanks in advance
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Christopher » Thu Feb 28, 2013 2:44 pm

Karkadann wrote:Some how I get the feeling im missing obvious, perhaps a way of setting the DayLengh to a 12 hour day and set the minute hand to rotate 12 times in one day.


Where is the problem with this? You can simply animate the minute hand to rotate 12 times during the day length... This would also be the easiest way.

Christopher
User avatar
Christopher
 
Posts: 276
Joined: Mon Jul 19, 2010 3:25 am

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Thu Feb 28, 2013 2:58 pm

OH I get it, so I just set up the animation to rotate 12 times and set the hour hand to rotate once and set them both on global

Like I said I get the feeling im missing the obvious thank you
/hits self in fore head

I assume that you can stop and start global animation like a normal animation
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Fri Mar 01, 2013 12:44 am

another question, when you type /reset in the old game engine shards does it just reset the puzzles and put the kickables back where they where or does it reset the time as well, because im gonna need a way to reset the clock so that the minute hand is at 12
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Christopher » Fri Mar 01, 2013 1:28 am

I think you don't understand global animations correctly... AFAIK you can't start/stop or reset them. Global animations are a continuous cycle and one cycle has the daylength set in the .age-file.

Christopher
User avatar
Christopher
 
Posts: 276
Joined: Mon Jul 19, 2010 3:25 am

Re: Chess Clock, Python, SDL's and Global Animation

Postby diafero » Fri Mar 01, 2013 4:26 am

As far as I know, /!resetage does not reset the time. The current position in the global animation is calculated based on the current actual time, so it is in sync even across Shards. Hence to sync the hands of the clock, you will have to properly choose the initial position.

However, I see no reason to use global animations for a chess clock. Why don't you go with normal animations? The main feature of global animations is they also proceed when nobody is in the age, but you shouldn't need that for a chess clock.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Fri Mar 01, 2013 10:12 am

Because i never tried hour long, or a 12 hour long animation.? I guess theirs a first time for everything.
I wonder how much lag an animation that long will cause if any?
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Christopher » Fri Mar 01, 2013 12:36 pm

The python api has a function called "animation.speed(...)" So you can make an animation of 1 minute length and slow it down to 1,66% speed. So the function would look like "animation.speed(0,0166)" or "animation.speed(1/60)". This would be a much better way than making an 1 hour animation.

Christopher
User avatar
Christopher
 
Posts: 276
Joined: Mon Jul 19, 2010 3:25 am

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Fri Mar 01, 2013 2:00 pm

umm..........his their a tutorial on how to alter the Python api speed?

Image
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Sat Mar 02, 2013 2:56 pm

So should I wait for the python file or just go ahead and use the one hour animation and the 12 stage animation and add the python file later
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 4 guests

cron