Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: seraphimdreamer777 on Fri 31/07/2009 18:12:55

Title: How do you make character use one item at a time
Post by: seraphimdreamer777 on Fri 31/07/2009 18:12:55
I'm sorry if I'm being a pain by posting too much but I need help again.

I'm trying to make it where my character can use two different items but not at the same time.
But she keeps using both when I select a certain item. how do I get her to use only one item.
Here is my code

function cmary_UseInv()
{
//Mary puts on black silk dress
cmary.ActiveInventory = idress;
player.ChangeView(1);

//Mary puts on maid outfit
cmary.ActiveInventory = imaid;
player.ChangeView(5);
}


Title: Re: How do you make character use one item at a time
Post by: Matti on Fri 31/07/2009 19:11:43
You set the player's active inventory? Then of course she uses both items one after another (visually at the same time).

I guess you were going to check the active inventory instead of setting it..

Like this:

function cmary_UseInv()
{
//Mary puts on black silk dress
if (cmary.ActiveInventory == idress){
  player.ChangeView(1);
}

//Mary puts on maid outfit
if (cmary.ActiveInventory == imaid){
  player.ChangeView(5);
}
}

Title: Re: How do you make character use one item at a time
Post by: seraphimdreamer777 on Fri 31/07/2009 19:29:35
Thanks it works now.