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: Animations for different situations how to use them ????  (Read 5480 times)

0 Members and 1 Guest are viewing this topic.

Endrit

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 62
    • View Profile
Animations for different situations how to use them ????
« on: June 26, 2011, 01:28:00 PM »

Hi to all the wintermute engine forum community ::wave the wintermute engine forum community .
Before i start with the question i ask to apologize my english !!!
Well i'm new in the wintermute engine environment so i need help .
The default character , molly , when she take some think she always has the same animation , but this is not very realistic if she take an object in the floor or up on the wall so i have created for my new character three positions of take and my question is how can i use this three animations for the right situation ?  ???
Thanks to all !
 ::rock
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Animations for different situations how to use them ????
« Reply #1 on: June 26, 2011, 03:55:42 PM »

Yes, she does the same animation when taking items because that is how the items are scripted. You can script which animation plays for different items. For instance, in the demo, inside the book.script in the room scene, the "Take" event is as below:

Code: WME Script
  1.  
  2. on "Take"
  3. {
  4.   // walk to the desk
  5.   actor.GoTo(782, 645);
  6.   actor.TurnTo(DI_UPLEFT);
  7.  
  8.   Game.Interactive = false;
  9.   actor.Talk("OK, I'll take it.");
  10.  
  11.   // play "take" animation
  12.   actor.PlayAnim("actors\molly\ul\take1.sprite");
  13.  
  14.   // hide the book entity and place "book" item into the inventory
  15.   Game.TakeItem("book");
  16.   var EntBook = Scene.GetNode("book");
  17.   EntBook.Active = false;
  18.  
  19.   // play the second "take" animation
  20.   actor.PlayAnim("actors\molly\ul\take2.sprite");
  21.  
  22.   Game.Interactive = true;
  23. }
  24.  
  25.  

The "Take" event is triggered with Object.ApplyEvent("Take"). You can have different code for each object. In the case of the "Book" object that is in the demo scene, the animation that is played is:
Code: WME Script
  1. actor.PlayAnim("actors\molly\ul\take2.sprite");

You can have play animation you wish. Hope this helps.
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Animations for different situations how to use them ????
« Reply #2 on: June 26, 2011, 06:09:12 PM »

Sidenote :

Quote
For actors, you can also specify an animation set name instead of filename.

That means you can simply use PlayAnim("take"); for example. If you use a filename, the animation gets loaded to memory exactly when you call that function, that could cause a small "freeze", depending on the size of the Animation. And it gets loaded every time you call it.

When you put the Animations all in your actor file, they all get loaded at once ( at the time where the actor variable is defined ), so you avoid that "freezing". So PlayAnim(animationset) should be preferred.


Cheers
« Last Edit: June 26, 2011, 06:12:34 PM by Spellbreaker »
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Animations for different situations how to use them ????
« Reply #3 on: June 27, 2011, 07:29:24 PM »

Spellbraker, what you said is valid only for 3D actors right?
Logged

Endrit

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 62
    • View Profile
Re: Animations for different situations how to use them ????
« Reply #4 on: June 27, 2011, 07:49:37 PM »

Guys thanks to all and for all !  ;D
Unfortunately I didn't have time to try your answers code because i'm really-really busy with my own work , this is for me just a passion Hobby or how you want to call it .  ::rock
« Last Edit: June 27, 2011, 07:53:13 PM by Endrit »
Logged

Endrit

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 62
    • View Profile
Re: Animations for different situations how to use them ????
« Reply #5 on: June 27, 2011, 07:52:28 PM »

Ah.......my game is all 2D because my hardware is not one of the best  :'(.
 ::beer ::beer ::beer ::beer ::beer ::beer ::beer ::beer ::beer ::beer ::beer
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Animations for different situations how to use them ????
« Reply #6 on: June 28, 2011, 07:13:59 PM »

Spellbraker, what you said is valid only for 3D actors right?

No, it's valid for 2D Actors. I don't know if it's Valid for 3D Actory, but I guess so.
Logged
 

Page created in 0.087 seconds with 24 queries.