1
Technical forum / Difficulty combining inventory items
« on: June 25, 2015, 12:37:48 AM »
Hi,
I'm trying to follow the technique used in the WME book for combining items in the inventory. I've got other items that work fine so I'm not sure what is wrong here. This is a teaching app for veterinary students.
I have a dog, a syringe, and empty blood tubes in the inventory. The idea is to click on the patient (the dog) with the syringe. The syringe changes to a filled syringe. That part works fine. The next step is to click on the tubes with the syringe or click on the syringe with the tubes. The tubes and syringe are deleted and filled blood tubes are now in the inventory.
Here is the code in items:
And the code for the filled syringe:
and finally, similar code for the empty tubes:
I have sprites for the filled syringe, the empty tubes and the filled tubes, all with the correct names. I don't get any errors. I see the text "use something with something" but nothing happens when I click. Do I need to put anything in the scene? I've deleted the sprites and recreated them without any success and I'm not sure what to try.
Any thoughts?
I'm trying to follow the technique used in the WME book for combining items in the inventory. I've got other items that work fine so I'm not sure what is wrong here. This is a teaching app for veterinary students.
I have a dog, a syringe, and empty blood tubes in the inventory. The idea is to click on the patient (the dog) with the syringe. The syringe changes to a filled syringe. That part works fine. The next step is to click on the tubes with the syringe or click on the syringe with the tubes. The tubes and syringe are deleted and filled blood tubes are now in the inventory.
Here is the code in items:
Code: [Select]
ITEM
{
CURSOR_COMBINED = TRUE
CAPTION = "Filled Syringe"
NAME = "syringeFull"
IMAGE = "items\syringeFull.png"
CURSOR = "items\syringeFull.sprite"
CURSOR_HOVER = "items\syringeFull_h.png"
SCRIPT = "items\syringeFull.script"
}
ITEM
{
CURSOR_COMBINED = TRUE
CAPTION = "Blood Tubes"
NAME = "tubes"
IMAGE = "items\tubes.png"
CURSOR = "items\tubes.sprite"
CURSOR_HOVER = "items\tubes_h.png"
SCRIPT = "items\tubes.script"
}
ITEM
{
CURSOR_COMBINED = TRUE
CAPTION = "Filled Blood Tubes"
NAME = "tubesFull"
IMAGE = "items\tubesFull.png"
CURSOR = "items\tubesFull.sprite"
CURSOR_HOVER = "items\tubesFull_h.png"
SCRIPT = "items\tubesFull.script"
}
And the code for the filled syringe:
Code: [Select]
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
Game.SelectedItem = "syringeFull";
}
////////////////////////////////////////////////////////////////////////////////
on "tubes"
{
Game.Interactive = false;
actor.Talk("I'll fill these blood tubes");
Game.TakeItem("tubesFull");
Game.DeleteItem("tubes");
Game.Interactive = true;
Game.DeleteItem("syringeFull");
}
and finally, similar code for the empty tubes:
Code: [Select]
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
Game.SelectedItem = "tubes";
}
on "syringeFull"
{
Game.Interactive = false;
actor.Talk("I'll fill these blood tubes");
Game.TakeItem("tubesFull");
Game.DeleteItem("syringeFull");
Game.Interactive = true;
Game.DeleteItem("tubes");
}
I have sprites for the filled syringe, the empty tubes and the filled tubes, all with the correct names. I don't get any errors. I see the text "use something with something" but nothing happens when I click. Do I need to put anything in the scene? I've deleted the sprites and recreated them without any success and I'm not sure what to try.
Any thoughts?