Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Problem with PlayAnimAsync  (Read 3789 times)

0 Members and 1 Guest are viewing this topic.

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Problem with PlayAnimAsync
« on: August 21, 2006, 08:44:29 PM »

For playing random animations I use PlayAnimAsync (Filename).

I have noticed two troubles:

- when this function PlayAnimAsync() is caused, all animations on the screen freeze.
- after execution PlayAnimAsync(), I do ChangeScene(). Very often the program crashes and creates dump.

It is possible for something to make with it?
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Problem with PlayAnimAsync
« Reply #1 on: August 21, 2006, 09:14:05 PM »

call StopAnim() before the Game.ChangeScene();

Again, what do you mean by all animations on the screen freeze. Is it 2d or 3d animation. Is there anything in the log file?
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: Problem with PlayAnimAsync
« Reply #2 on: August 22, 2006, 09:14:33 AM »

At me 2D animation and functions StopAnim() for it are not present.

I used actor.Reset () before call ChangeScene(), but it not effective.

Function PlayAnimAsync() reads from a file. And during the moment of reading all animations and movement of the cursor stoped.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Problem with PlayAnimAsync
« Reply #3 on: August 22, 2006, 02:11:32 PM »

how big is your animation you're trying to load? (in MB)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: Problem with PlayAnimAsync
« Reply #4 on: August 22, 2006, 02:43:43 PM »

2.3 Mb

And it is possible to make once loading with save in memory?

If this animation was already play, it again to not load.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Problem with PlayAnimAsync
« Reply #5 on: August 22, 2006, 04:39:53 PM »

yes, you insert it in the scene as an inactive entity. this way it's memory cached for the scene.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problem with PlayAnimAsync
« Reply #6 on: August 22, 2006, 07:08:25 PM »

Yup, pre-caching is the key here. Attach the animation to some hidden entity in the scene. That way the animation frames get loaded on scene transition and don't block the game flow when the animation is actually executed.

As for the crashing, can you post the wme_crash.txe file?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: Problem with PlayAnimAsync
« Reply #7 on: August 25, 2006, 09:10:54 AM »

Yes, thanks, very well. But it is a little not so.

I have 3 idle behaviour of the main actor.
I used function Game.CreateEntity(Name), and then Entity.SetSprite(Filename).

For 8 directions on 3, 24 objects turn out.
When I have made it, at me game began to be loaded very for a long time, and then strongly to brake.

I have already despaired, that that will fail.
But me there has come an idea to insert these animations into the actor, as TALK_SPECIAL:

TALK_SPECIAL
{
        SPRITESET
        {
          NAME = "idle01"

            LEFT = "actors\Stas\ll\idle01.sprite"
            RIGHT = "actors\Stas\rr\idle01.sprite"
            UP = "actors\Stas\uu\idle01.sprite"
            DOWN = "actors\Stas\dd\idle01.sprite"

            UP_LEFT = "actors\Stas\ul\idle01.sprite"
            UP_RIGHT = "actors\Stas\ur\idle01.sprite"
            DOWN_LEFT = "actors\Stas\dl\idle01.sprite"
            DOWN_RIGHT = "actors\Stas\dr\idle01.sprite"
      }
}

Now I call actor.PlayAnimAsync("actors\Stas\ll\idle01.sprite").

And all OK. Game is fast loading, normally works and does not brake all stage.
Logged
 

Page created in 0.041 seconds with 21 queries.