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: Apply Money on Cup and receive Book. How to scripting  (Read 3622 times)

0 Members and 1 Guest are viewing this topic.

Hansen

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 17
    • View Profile
Apply Money on Cup and receive Book. How to scripting
« on: July 03, 2009, 02:07:24 PM »

Hi to all!
I have question.

So. I have 3 items. Money, Сup and Book.
I need apply Money on Cup in inventory, and receive Book.
Please help. How to create this script?


This code in Cup script doesnt work!

on "Money"
{
  Game.Interactive = false;
  actor.Talk("I guess I find the book");
  Game.CreateItem("book");
}

PS. Sorry for my english.
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Apply Money on Cup and receive Book. How to scripting
« Reply #1 on: July 03, 2009, 03:01:56 PM »

Code: WME Script
  1. on "Money"
  2.   {
  3.   Game.Interactive = false;
  4.  
  5.   Game.DropItem("Money")//Delete Money item
  6.   Game.DropItem("Cup")//Delete Cup item
  7.  
  8.   Game.TakeItem("Book")//Add item to invetory, item "Book" must be present in "items.items" file (and also with is image/sprite and script)
  9.  
  10.   actor.Talk("I guess I find the book");
  11.  
  12.   Game.Interactive = true;
  13.   }
  14.  
Logged

Hansen

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 17
    • View Profile
Re: Apply Money on Cup and receive Book. How to scripting
« Reply #2 on: July 03, 2009, 03:43:57 PM »

Thanks a lot, Azrael!  :) You helped me very much!
Can I ask you once more question. If we have "Cup" not only as item, but as entity too. How can I delete it from the scene with the script? With your code the "Cup" drops from the inventory and appears on the table  >:(
« Last Edit: July 03, 2009, 03:45:58 PM by Hansen »
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Apply Money on Cup and receive Book. How to scripting
« Reply #3 on: July 03, 2009, 06:29:19 PM »

Try Game.DeleteItem(); istead of DropItem.
Logged
 

Page created in 0.043 seconds with 24 queries.