Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Inventory items on actors  (Read 2491 times)

0 Members and 1 Guest are viewing this topic.

nakker101

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Inventory items on actors
« on: March 28, 2007, 12:48:00 AM »

Hi
Congratulations for this great software!  I'm new with it and I try to learn as much as I can.
By using the 2D demo I created some more rooms and scenes,some items for the inventory
and a new actor in place of Molly. How can I use an inventory item on the actor,so that something
else happens like an animation or a video when the actor uses the item on himself or on another entity
 in the scene?Something more difficult:How is it possible to use something in a specific scene only?
For examble:Molly is at the street and I try to use the book she has taken from the desk on her.She
says"This is not a good place to read.Maybe I sould go in the office".When I do the same in the room
 she says OK and a video appears where she reads or  just any animation I may think.
 In my actors script interactive value is true.
 Thank you a lot anyway and congratulations again.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Inventory items on actors
« Reply #1 on: March 28, 2007, 06:59:01 PM »

How can I use an inventory item on the actor,so that something else happens like an animation or a video when the actor uses the item on himself or on another entity in the scene?
Edit actor's script and add event handlers, such as:
Code: WME Script
  1. on "book"
  2. {
  3.   this.PlayAnim("path\reading_book.sprite");
  4. }
  5.  


Something more difficult:How is it possible to use something in a specific scene only?
For examble:Molly is at the street and I try to use the book she has taken from the desk on her.She
says"This is not a good place to read.Maybe I sould go in the office".When I do the same in the room
 she says OK and a video appears where she reads or  just any animation I may think.
Code: WME Script
  1. on "book"
  2. {
  3.   if(Scene.Name=="room") this.PlayAnim("path\reading_book.sprite");
  4.   else this.Talk("This is not a good place to read.");
  5. }
  6.  


In my actors script interactive value is true.
Yup, the actor needs to be interactive for the above to work.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

nakker101

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Inventory items on actors
« Reply #2 on: April 12, 2007, 09:23:01 PM »

Thank you a lot Mnemonic for spending time to help me!
Logged
 

Page created in 0.069 seconds with 25 queries.