Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Akumayo on Mon 19/01/2004 01:12:44

Title: Multiple Inventory "if" interactions
Post by: Akumayo on Mon 19/01/2004 01:12:44
Say i want to make a character that transforms when an inventory item is used on it.  Easy, right, wrong, i want there to be three different things to use on it, the player chooses which one.  But, Whenever I use child actions: Use Inventory item; if inventory item was used, item 01, change player view 01, if inventory item was used, item 02, change player view 02, if inventory item was used 03, change player view 03.      It makes it so that i can only use item 01.  How do i make it so that each one will turn the player into a different thing ???
Title: Re:Multiple Inventory "if" interactions
Post by: Darth Mandarb on Mon 19/01/2004 05:22:00
Don't forget to use the 'Stop Running More Commands' code to "return;" from the if statement.

That might help.

If not, explain more what you want to do and we can help with the scripting!

Do you have to use the items in a specific order?

])]V[
Title: Re:Multiple Inventory "if" interactions
Post by: on Mon 19/01/2004 08:16:43
From the interaction editor, instead of choosing the "if inventory item was used" conditional, choose "Run Scritp", click the Edit Script button, and type in:

if (character[GetPlayerCharacter()].activeinv == 1) {
// your commands, like SetCharacterView
} else if (character[GetPlayerCharacter()].activeinv == 2) {
// your commands, like SetCharacterView
} else if (character[GetPlayerCharacter()].activeinv == 3) {
// your commands, like SetCharacterView
}
Title: Re:Multiple Inventory "if" interactions
Post by: Akumayo on Fri 23/01/2004 01:43:09
Thanks... that works perfectly