Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mariano Cirigliano on Fri 05/11/2010 18:08:54

Title: Error with Dialog and AddInventory Item
Post by: Mariano Cirigliano on Fri 05/11/2010 18:08:54
My code:

@12
Character: ¿¿41.489.590??.
Char1: ¡¡CORRECTO!!... me sorprende tu agilidad mental, como te prometí aquí tienes el objeto del que te hablé antes.
Character: Muchas gracias, veamos de que se trata.
Char1: Aquí tienes.
option-off-forever 8
option-off-forever 9
option-off-forever 10
option-off-forever 11
option-off-forever 12
option-off-forever 13
option-off-forever 14
option-off-forever 15
player.AddInventory(imoneda);
return

ERROR!!

Hello everybody, I need to conclude the dialog the CHARACTER receives an item to the INVENTORY. The object is called MONEDA. I hope you will understand the problem. Thank you.
Title: Re: Error with Dialog and AddInventory Item
Post by: amanta4ray on Fri 05/11/2010 18:46:31
I don't know if this is what you are looking for, but when you use script in dialogs, you need to put a space before it.  Also, you are turning off option 12 before it gets to the part of giving the player the inventory item.  Maybe something like this....

@12
Character: ¿¿41.489.590??.
Char1: ¡¡CORRECTO!!... me sorprende tu agilidad mental, como te prometí aquí tienes el objeto del que te hablé antes.
Character: Muchas gracias, veamos de que se trata.
Char1: Aquí tienes.
   player.AddInventory(imoneda);
option-off-forever 8
option-off-forever 9
option-off-forever 10
option-off-forever 11
option-off-forever 12
option-off-forever 13
option-off-forever 14
option-off-forever 15
return

Title: Re: Error with Dialog and AddInventory Item
Post by: Khris on Fri 05/11/2010 19:17:27
Quote from: amanta4ray on Fri 05/11/2010 18:46:31Also, you are turning off option 12 before it gets to the part of giving the player the inventory item.  Maybe something like this....
That doesn't matter, it's not like the script after @12 screeches to a halt just because option 12 gets turned off.
Title: Re: Error with Dialog and AddInventory Item
Post by: Mariano Cirigliano on Fri 05/11/2010 23:27:43
Thank you very much!!  ;D
Title: Re: Error with Dialog and AddInventory Item
Post by: amanta4ray on Sat 06/11/2010 12:03:25
You are welcome..I'm glad I could help!!