Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Fri 14/01/2005 19:08:07

Title: Play sound fx get inventory [SOLVED]
Post by: Candle on Fri 14/01/2005 19:08:07
Try to find the code if you get a inventory item I can play a sound ?
Title: Re: Play sound fx get inventory
Post by: Ishmael on Fri 14/01/2005 19:12:34
Probably the easiest way is to use the Play Sound command (PlaySound(int sound); if you're scripting) just after the Add Inventory command.
Title: Re: Play sound fx get inventory
Post by: Candle on Fri 14/01/2005 19:14:18
Ok thanks I'll try it .
Title: Re: Play sound fx get inventory
Post by: Scorpiorus on Fri 14/01/2005 19:17:06
Alternatively, the on_event function may be made use of:

main global script:

function on_event(int event, int data) {

Ã,  Ã, if (event == ADD_INVENTORY) PlaySound(xxx);
}
Title: Re: Play sound fx get inventory
Post by: Candle on Fri 14/01/2005 19:42:16
Thanks Scorpiorus , The sound was kind of annoying so went  with a txt prompt .
Title: Re: Play sound fx get inventory
Post by: Ishmael on Fri 14/01/2005 20:02:29
Ach, I had all forgotten on_event...
Title: Re: Play sound fx get inventory
Post by: Candle on Fri 14/01/2005 20:18:40
Wow that works slick for messages to .
function on_event(int event, int data) {

    if (event == ADD_INVENTORY) DisplayMessage(506);

}