Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Combining Inventory Items to Produce New Item  (Read 3873 times)

0 Members and 1 Guest are viewing this topic.

Wraith

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
  • I put the "EW" in "Newbie".
    • View Profile
    • Archetype Illustration & Design
Combining Inventory Items to Produce New Item
« on: October 27, 2003, 05:14:16 PM »

Howdy,
   Can you take that solution to the "Inventory Items Combining" post (June 08) one step further for me?  I have a boot, a screwdriver and battery defined in the item.items file and nicely placed in the inventory with their scripts in place.  Let's say I want to use the screwdriver on the boot (pretend the boot has a battery pack inside) and then have the battery (extracted) now show up in the inventory...How can I code that?  So far I've placed in the "boot" script file some lines like this:

on "screwdriver"
{
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Combining Inventory Items to Produce New Item
« Reply #1 on: October 27, 2003, 05:28:26 PM »

Hmm, providing the code above is attached to the "boot" object, it *should* work.
Make sure the script is attached correctly and that the screwdriver item has a NAME property defined in the items file.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Wraith

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
  • I put the "EW" in "Newbie".
    • View Profile
    • Archetype Illustration & Design
Re:Combining Inventory Items to Produce New Item
« Reply #2 on: October 27, 2003, 06:01:49 PM »

...what could it be?  The checklist goes:
1)  I've got the items listed/defined in the items.items file (for each item I had to start with a new:
ITEM
{...  
 heading for each item I wanted to definition)
2)  The items each have their own scripts for how to behave in the inventory window (boot.bmp & boot_h.bmp files & stuff)
3)  The "boot" script has the "on "screwdriver"" code in it.
Anything obviously missing?  Let me know. I'm going to double-check my work.
 Thanks.
-W
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Combining Inventory Items to Produce New Item
« Reply #3 on: October 27, 2003, 06:11:28 PM »

The items definition file should contain sections like these:

Code: [Select]
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "Boot"
   NAME = "boot"
   IMAGE = "items\boot.bmp"
   CURSOR = "items\boot.bmp"
   CURSOR_HOVER = "items\boot_h.bmp"
   SCRIPT = "items\boot.script"
}

ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "Screwdriver"
   NAME = "screwdriver"
   IMAGE = "items\scrw.bmp"
   CURSOR = "items\scrw.bmp"
   CURSOR_HOVER = "items\scrw_h.bmp"
   SCRIPT = "items\scrw.script"
}


And then the "items\boot.script" should contain the code you wrote above. One possibility is that you're referencing a wrong script (wrong path). In that case, a missing file warning would be listed in wme.log.
I can't think of anything else at the moment.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Wraith

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
  • I put the "EW" in "Newbie".
    • View Profile
    • Archetype Illustration & Design
Re:Combining Inventory Items to Produce New Item
« Reply #4 on: October 28, 2003, 12:56:51 AM »

Excellent!  It worked!  Turns out I did have a couple of things wrong with the name of the items and a path.  Progress!  Now on to the next mountain!
-W
« Last Edit: October 28, 2003, 01:00:50 AM by Wraith »
Logged
 

Page created in 0.039 seconds with 20 queries.