Animation dilemma

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Animation dilemma

Postby ardent red » Tue Aug 26, 2008 1:58 am

Hey all.

I've encountered a problem (no duh, AR :P, get on with it ). A puzzle in my age involves rotating several disks with patterns drawn on them. When the disks are rotated into the right combination, the patterns will line up and... currently undecided things happen. The disks are rotated by pushing a button (or some similar mechanism. but that's not my problem). Anyhow, as we probably all know, it's not too hard to come up with ideas, but putting them into practice is another thing entirely. I don't think it's possible to rotate an object bit-by-bit with one clickable easily using AlcScript (like, push the button, object a rotates 40 degrees. push it again, it rotates another 40 degrees etc.), but I'm sure it can be done with some clever python coding- which is where you guys come in. I managed to work out that there should probably be some variable for the rotation of the objects, which is added onto every time the button is pushed, and actions occur when a group of variables have certain values. An example (if you'll excuse the pseudo.functions):

Code: Select all
rotobj2 = 0
if button.pushed:
    rotobj2 = rotobj2 + 1
if rotobj2 = 9:
    rotobj2 = 0
rotobj1 = 0
if button.pushed:
    rotobj1 = rotobj1 + 1
elif rotobj1 is 4 and rotobj2 is 2:
    puzzle.solved
elif rotobj1 is 9:
    rotobj1 = 0


So, my question really boils down to this: how do I code animations and events for Uru using python, and would there be a way to do what I want in AlcScript without resorting to convoluted methods like making multiple button objects, each tied to a specific animation, that appear and disappear every time the button is pushed.
I've had a go at using the search function, but I couldn't be bothered to look through all of the pages once I managed to find a group of keywords that didn't cause an error.

Thanks,
AR
ardent red
 
Posts: 150
Joined: Fri Apr 18, 2008 3:41 pm
Location: The big little New Zealand

Re: Animation dilemma

Postby D'Lanor » Tue Aug 26, 2008 6:16 am

This is not an easy "how do I do this" question. It is a design project which could keep a programmer busy for at least a few days (if not weeks).

I would be interested to pick this up but I am currently working on an equally complicated project for someone else. And after that I plan to get back to my own age Prad.

So just a few pointers for now. You definitely need Python because you have to use SDL states. All actions and responders must be passed to the Python file using pythonfilemods. Python then receives a notification from the activator (button) and it retrieves the current rotation state from the SDL. Then it runs the proper animation responder to advance to the next step and saves the new state.

It should not be too hard to split up a full rotation into different animations and assign each of them to a different responder (or make a responderlist maybe).
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Animation dilemma

Postby ardent red » Tue Aug 26, 2008 10:08 pm

Thanks for the reply! Don't worry about being busy- I'll struggle on, hehe (let's hope I don't explode too much of my age in the process :D ). How do I make an SDL file, though? There's information on what to put into an SDL file in the wiki, but none on how to make one in the first place (or I've missed it, which is more likely).
ardent red
 
Posts: 150
Joined: Fri Apr 18, 2008 3:41 pm
Location: The big little New Zealand

Re: Animation dilemma

Postby Grogyan » Tue Aug 26, 2008 10:29 pm

ardent red wrote:Thanks for the reply! Don't worry about being busy- I'll struggle on, hehe (let's hope I don't explode too much of my age in the process :D ). How do I make an SDL file, though? There's information on what to put into an SDL file in the wiki, but none on how to make one in the first place (or I've missed it, which is more likely).


Easy, I use PlasmaShop, and just create new SDL

I too have a complicated puzzle to do in my shell, but i'm learning python first -> hence the wizard (no not Oz :lol:)
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Animation dilemma

Postby ardent red » Tue Aug 26, 2008 10:43 pm

hence the wizard (no not Oz :lol:)


*clacks ruby red shoes together* I wish I knew python... I wish I knew python... I wish I knew python... *opens eyes* oh noes. I don't have the super-powers or mentality of a ninja coder... yet. Looks like that trick only works for inter-dimensional travel :lol:

Thanks for the tip, though- it's good to know that the first step is a simple one!
ardent red
 
Posts: 150
Joined: Fri Apr 18, 2008 3:41 pm
Location: The big little New Zealand


Return to Scripting

Who is online

Users browsing this forum: No registered users and 10 guests

cron