Page 1 of 1

Animation dilemma

PostPosted: Tue Aug 26, 2008 1:58 am
by ardent red
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

Re: Animation dilemma

PostPosted: Tue Aug 26, 2008 6:16 am
by D'Lanor
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).

Re: Animation dilemma

PostPosted: Tue Aug 26, 2008 10:08 pm
by ardent red
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).

Re: Animation dilemma

PostPosted: Tue Aug 26, 2008 10:29 pm
by Grogyan
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:)

Re: Animation dilemma

PostPosted: Tue Aug 26, 2008 10:43 pm
by ardent red
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!