Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 16/01/2004 16:49:34

Title: how to use inventory items on characters?
Post by: on Fri 16/01/2004 16:49:34
that's maybe a stupid question, but how to use an inventory item on some character or object...

i see under "Interaction" "Use inventory on character", but this works with any inventory i use on this character...

i wanna use the "special" inventory (only one)...

i hope you get it..
Title: Re:how to use inventory items on characters?
Post by: on Fri 16/01/2004 17:05:09
already got it  ;D
Title: Re:how to use inventory items on characters?
Post by: on Sat 17/04/2004 19:15:37
Ive been trying to figer the same thing out for days now... could someone post how to do it?
Title: Re:how to use inventory items on characters?
Post by: Bryan on Sat 17/04/2004 19:41:24
I'd say look in the manual under "Inventory Functions".

But that would be misleading cause it ain't there.  What you want is to check the global variable character[CHARID].activeinv during the interaction.
Title: Re:how to use inventory items on characters?
Post by: on Sat 17/04/2004 20:49:30
you'd think that it would be easyer than that... im still confused.
Title: Re:how to use inventory items on characters?
Post by: .. on Sat 17/04/2004 21:05:19
If i am correct in thinking that you want it so when a player uses a specific inventory item on another player, something happens.

All you need to do is Under 'Use Inventory on Character' in the interactions panel, you select 'Conditional - If Inventory Was Used' then select the inventroy item number, and under this add some child actions (actions that happen if that condition is correct) so For Example

PLAYER USES INVENTORY ON CHARACTER
----Conditional-If Inventry was used(1)
------------+ Game- Display a messag(01)

So it really is simple :P

Quoteyou'd think that it would be easyer than that... I'm still confused.
It Is that simple!
QuoteWhat you want is to check the global variable character[CHARID].activeinv during the interaction.
ARGHH!! DONT LISTEN TO HIM.. HE's CRAZY!!!
Title: Re:how to use inventory items on characters?
Post by: strazer on Sat 17/04/2004 21:08:07
Using script, you would do:

- Choose "Characters" on the left
- Choose the character
- Press button "Interaction..."
- Double-click "Use inventory on character"
- Choose "Run script"
- Press button "Edit script..."
- Write something like this:

if (character[EGO].activeinv == 1) { // if inventory item no. 1 used
   // put stuff to do here
}
else if (character[EGO].activeinv == 2) { // if inventory item no. 2 used
   // put other stuff to do here
}
Title: Re:how to use inventory items on characters?
Post by: on Sun 18/04/2004 17:43:26
Thanks, I got it working now. This is Deathlok by the way but im (planing) on realising a demo soon and I wanted to change my name to something with more character. So from now on I shall be known as Ocean of Darkness.
Title: Re:how to use inventory items on characters?
Post by: TerranRich on Sun 18/04/2004 19:56:15
Great, that's nice. Next time, read the Beginners' FAQ before posting any questions.