Object doesn't animate

Started by Deabriel, Wed 22/04/2020 21:19:37

Previous topic - Next topic

Deabriel

Hi, I'm not new in ags, I already made games in previous versions, I tried to make a game in the new AGS version 3.5.0, but when I write the command to animate an object, the object doesn't animate, I never ever had a problem like this in other versions, I don't know why

Code: ags
function room_Load()
{
oBird.SetView(4);
oBird.Animate(0, 1, eRepeat, eNoBlock);
}


I tried to put it in the repExec (But it's doesn't work too)

Code: ags
function room_RepExec()
{
  oBird.SetView(4);
  oBird.Animate(0, 1, eOnce, eBlock);
}


I hope anyone can help me or will have a solution to this, thanks

Cassiebsg

#1
Stupid question, but did you remember to link the functions in the room editor?

If so try and move them to "first time enters room"

Also make sure you have the right view. And btw you can use the view name, to make the code more readable.  ;)

oBird.SetView(VBIRD);

EDIT: Oh, and make sure you have at least 3 frames in the loop. only 2 won't work. if your animation only has 2 frames, you can "duplicate" two of the frames like this: 1, 2, 1, 2 (reason for this, I think, is that frame one is "resting position" and thus you only actually have frame 2 to animate.
There are those who believe that life here began out there...

Crimson Wizard

Quote from: Cassiebsg on Wed 22/04/2020 21:52:17
EDIT: Oh, and make sure you have at least 3 frames in the loop. only 2 won't work.

Is this true? Sounds like a engine bug that should be fixed.

JackPutter

I made my last game in version 3.5.0 and I had an object that  animated using a view that only had two frames. I had absolutely no issues.

Cassiebsg might be correct when it comes to characters (one frame is the standing frame and not included when animating, if my thinking is correct) but I don't think the same applies to objects.

With regards to solving the problem in the original post, my only thought is the same as Cassiebsg, as the code itself looks fine. I've facepalmed a few times myself when I wrote out code and realised I never linked it or linked it to the wrong place!

Deabriel

#4
Quote from: Cassiebsg on Wed 22/04/2020 21:52:17
Also make sure you have the right view. And btw you can use the view name, to make the code more readable.  ;)

oBird.SetView(VBIRD);

EDIT: Oh, and make sure you have at least 3 frames in the loop. only 2 won't work. if your animation only has 2 frames, you can "duplicate" two of the frames like this: 1, 2, 1, 2 (reason for this, I think, is that frame one is "resting position" and thus you only actually have frame 2 to animate.
I have the right view, and the animation have 325 frames (I know it's too much, I tried with 10 frames and the animation still doesn't work it)

Quote from: Crimson Wizard on Wed 22/04/2020 22:39:01

Is this true? Sounds like a engine bug that should be fixed.

Mmmh, you tried it and have the same problem? Maybe it's just me or the installation of the engine

Edit: Don't mind it I already fixed it

Deabriel

Quote from: JackPutter on Wed 22/04/2020 22:50:23
I made my last game in version 3.5.0 and I had an object that  animated using a view that only had two frames. I had absolutely no issues.

Cassiebsg might be correct when it comes to characters (one frame is the standing frame and not included when animating, if my thinking is correct) but I don't think the same applies to objects.

With regards to solving the problem in the original post, my only thought is the same as Cassiebsg, as the code itself looks fine. I've facepalmed a few times myself when I wrote out code and realised I never linked it or linked it to the wrong place!

I'm feeling too stupid right now, I was forget to link it in the room editor haha, I was searching for hours what's the problem because in the others rooms I didn't have that problem.
Thanks

Racoon

Don´t worry, you are not the only one that had that problem when starting with AGS  :-D

Cassiebsg

Yes, I was remembering having a character that wouldn't animate, cause I only had 2 frames. Took me long time to figure out why it wouldn't animate. Guess I just remembered that and wasn't aware/realized it did no apply to objects.  (roll)
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk