Item combination in invwntory. Help needed.

Started by , Thu 26/01/2006 09:12:15

Previous topic - Next topic

Grissly

I want to have in my game possibility to combine two or more things in inventory Can anyone provide help? Where to begin... how to script.
Thanks in forward

Khris

#1
In AGS, click on Inventory items in the left menu, then select the item from the list, then click on the Interaction... button.
A window opens, there you double-click on Use inventory on this item.

Now you can add interactions, or you choose Run Script, click on Edit script... and enter the appropriate code in the text window.
If you decide to script rather than use interactions, your code should look something like this:
if (player.ActiveInventory==iMatches) {
Ã,  player.LoseInventory(iCandle);
Ã,  player.AddInventory(iBurningcandle);
Ã,  player.Say("The candle is burning now.");
}
else if (player.ActiveInventory==iKnife) {
Ã,  player.LoseInventory(iCandle);
Ã,  player.AddInventory(iFigurine);
Ã,  player.Say("I've carved a small figurine out of the candle.");
}
else {
Ã,  player.Say("What's the point?");
}


In this case, the script would be the candle's, with the if-clauses checking which object was used on it.

Grissly

Thanks.
Altough I know, how to add interactions, idea with script example was great... that was what I was lookin for.

SMF spam blocked by CleanTalk