Animated character moving wrong [SOLVED]

Started by , Thu 09/12/2004 13:56:33

Previous topic - Next topic

ggp

Ive made a character loop for a lady who is putting a flower into a vase. I made 4 pictures for the loop and in each one the only thing that changes is her arm moving up and down. However when i play the loop, as well as her arm moving her entire body is jumping left to right. This also happend to another character with a similar animation (where only her arms should be moving, but her whole body jumps left to right.)
Any idea why it's doing this, and how to stop it ?

strazer

If you have frames of different width, each one will be centered across the character's x coordinate.
You could make each frame of the animation the same width or align all frames to one side. Use SetCharacterViewEx for this.

ggp

Ok ive set character view under the room settings interations, but it says under it 'Release character view to release it' how do i do that......or do i have to use SetIdle Animation to start the loop running ? If so, then how do i get more than one drop down from the tree to have 2 commands under Player enters screen (after fadein) ? Because thats where i'd need to change it isn't it ?
Sorry - im useless!

strazer

#3
Quotehow do i get more than one drop down from the tree to have 2 commands under Player enters screen (after fadein) ?

Right-click on the parent and choose "New action...".

QuoteOk ive set character view under the room settings interations, but it says under it 'Release character view to release it' how do i do that......or do i have to use SetIdle Animation to start the loop running ?

Idle animations are automatically triggered if a character does nothing for a specified period of time (default 20 sec).
Better start a normal animation and have it repeat. I see that option is not available from the interaction editor, so you have to use scripting. Don't worry, it's not difficult:

Say you want to continously animate character LADY putting flowers in a vase when the player enters the room.

Room interaction editor -> Player enters screen (before fadein) -> "Run script" ->

Code: ags

SetCharacterView(LADY, 3); // view 3 is the view with the animation
AnimateCharacter(LADY, 0, 0, 1); // continously animate LADY using loop 0 of her current view (3)

(Modify the names and numbers to your needs and check the manual for the parameters you can use.)

This way, the lady is continously putting flowers in the vase in the background while the player can walk around the room.
Use "Character - Release character view" or the ReleaseCharacterView function to stop the animation.

Now, if you don't want to adjust the frame widths, use SetCharacterViewEx instead of SetCharacterView to align the frames to a particular side. Check the manual!

Edit:

Thinking about it, using the idle view is a good idea. Adjust the frame widths and use an idle delay of 0 to have her animate continously when she's not doing anything else.

ggp

Ive set the character as idle and set the delay to 0 so it's constantly playing (scripting scares me!)
Anyway i also ended up re sizing the frames to be all the same width.
It's working noe, thanks for your help. (And i have read the manual - several times, but sometimes it's not all that clear, hence posting questions in the forum  :))

TerranRich

Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk