I'm stuck, Again...
I'm using Abstaubers 9 verb GUI and I'm working with inventory right now. I want to put two actions in one piece of script. But only one of them works (the one of them witch is on top). What I need to do to make this work?
Here's my try:
function icap_OtherClick()
{
if (UsedAction(eGA_LookAt))
{
player.Say("A bottle cap.");
player.Say("What can I possibly do with this?");
}
else if(UsedAction(eGA_UseInv)) {
if (player.ActiveInventory == ihalfbottle) {
player.Say("I need to fill this bottle first.");
}}
else if(UsedAction(eGA_UseInv)) {
if (player.ActiveInventory == ifullbottle) {
player.Say("This will take a sec.");
player.LoseInventory(ifullbottle);
player.LoseInventory(icap);
player.AddInventory(icappedbottle);
}}
else Unhandled();
}
This doesn't make much sense, the second else if will never be checked:
else if(UsedAction(eGA_UseInv)) {}
else if(UsedAction(eGA_UseInv)) {}
The code should look like this:
function icap_OtherClick()
{
if (UsedAction(eGA_LookAt))
{
player.Say("A bottle cap.");
player.Say("What can I possibly do with this?");
}
else if(UsedAction(eGA_UseInv)) {
if (player.ActiveInventory == ihalfbottle) {
player.Say("I need to fill this bottle first.");
}
else if (player.ActiveInventory == ifullbottle) {
player.Say("This will take a sec.");
player.LoseInventory(ifullbottle);
player.LoseInventory(icap);
player.AddInventory(icappedbottle);
}
else Unhandled();
}
Thank you, I think I got it now.