hi,
I want to use an inventory item, on other inventory item, to create a new item
how to i do that ?
Doubleclick on Inventory items. Then doubleclick on the item you want something to be used on. Click on the lightning bolt and select "Use inventory on this item" In this example I use a magnet
in the script: (without the // stuff)
if (player.ActiveInventory==istring){ //The item to be used on the magnet
cEgo.LoseInventory(imagnet); //player lose magnet
cEgo.LoseInventory(istring); //player lose string
cEgo.AddInventory(imagstring); //player gets magnet with string attached to it
}
else{
Display ("That won't work"); //player tries to use something else on the magnet
}
}
thank you..... :smiley:
Mouth for war, use the code tags:
(http://www.adventuregamestudio.co.uk/forums/Themes/AGSCompact/images/BBCode/code_code.png)
Second of all, if you're going to post code to assist people, try to use indentation so they can learn from your example instead of spawning even more unreadable script. Thanks.
Because of your lacking indentation you failed to notice you had an extra closing brace.
if (player.ActiveInventory==istring) { //The item to be used on the magnet
cEgo.LoseInventory(imagnet); //player lose magnet
cEgo.LoseInventory(istring); //player lose string
cEgo.AddInventory(imagstring); //player gets magnet with string attached to it
} else {
Display ("That won't work"); //player tries to use something else on the magnet
}
Ahh i was unaware of those tags. Sorry about that :-)