Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Inventory items combining  (Read 3478 times)

0 Members and 1 Guest are viewing this topic.

SFDevil

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 2
  • I'm a llama!
    • View Profile
Inventory items combining
« on: June 08, 2003, 10:21:33 PM »

Hey y'all !

Lately I've been messing around with this engine, and so far I'm very pleased :)
But for some reason I can't use items in inventory on other items in inventory (that's what I do to get them 'combined', right ?  ::)). When I try to 'apply event', it seems like the engine evaluates and thus executes it as a simple left-click.

Any suggestions to what should I do to fix this problem ? :)
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 combining
« Reply #1 on: June 09, 2003, 07:39:13 AM »

Hi and welcome,

in case you started your project using the "Basic project" template, there is all the necessary code already prepared for you. This code will handle the following:
When you select an inventory item, the mouse pointer will change its shape. Now when you click another inventory item (or any other object within a scene), the clicked object will recieve an event. The name of this event equals to the name of the item you've initially selected form the inventory, e.g. you select a "book" item and click another item. That item will receive a "book" event.
So, let's presume you have two items defined in your items.items file, "item1" and "item2", both of them have a script attachet to them. Now all you need to do is to write something like this to the item1's script:

Code: [Select]
on "item2"
{
  actor.Talk("The player just tried to combine item1 and item2.");
}


I hope that helps.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SFDevil

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 2
  • I'm a llama!
    • View Profile
Re:Inventory items combining
« Reply #2 on: June 10, 2003, 06:44:47 PM »

Well, I found the problem...was a different thing, but thanks anyway :)
Logged
 

Page created in 0.043 seconds with 23 queries.