Ok, I have a puzzle that the main character must give the other characters
a correct inventory item.
If they give a wrong item, then I need to have the game return without crashing.
I checked the help on disk and online
I was unable to make it work.
I used inventory on a character and I assume if the correct inv is not given
I need to use, if else.
I do the game on my other computer now which is not net enabled yet.
If I have to, I can copy what I have to a blank cd and transfer it over. I would rather not.
Just use "else" if you're not introducing another condition. Also, please provide more info when asking for help, and the code used :)
Yeah, just use else like this:
function character_UseInv()
{
if (player.ActiveInventory == iCorrectItem) {
...
}
else {
...
}
}
You can use "else if" in case you have more than two conditions:
if (player.ActiveInventory == iBanana) {}
else if (player.ActiveInventory == iApple) {}
else if (player.ActiveInventory == iPhone) {}
else {}
And:
http://www.adventuregamestudio.co.uk/manual/ifelsestatements.htm
Thanks, like I said I did read the if else documentation.
I will try it out now. It is greek to me right now.
Just go at it step by step.
It's either:
if (CONDITION) {COMMANDS} else {COMMANDS}
or:
if (CONDITION) {COMMANDS} else if (CONDITION) {COMMANDS} else {COMMANDS}
That's plain English and simple logic. Programming doesn't get much easier than that.
It is solved. Thanks everyone.