I am trying to do a basic item pick up. Here is what code I used.
function oGiantKey1_Interact ()
{
oGiantKey.Visible = false;
player.AddInventory (oGiantKey1);
}
Why is nothing going on?
Why the @#[* you are not creating an inventory item in the editor ?! :)
From the Manual :
Every inventory item which the player may carry during the game at one time or another is listed under the "Inventory items" node. Here, each item has a number and a script name which you use in scripts to identify the object. To create a new item, right-click on the "Inventory items" node.
The script then should look like something like this.
function oGiantKey1_Interact ()
{
oGiantKey.Visible = false;
player.AddInventory(iGiantKey1); //add the inventory item
}
I am doing that because this is day four for me working on this stuff. Thank you a thousand times over!~
Oh well, good luck then, you're welcome ~
I am still having the same issue
Okay :)
Did you create the Inventory item ?
To create a new item, right-click on the "Inventory items" node in the tree.
Change the script name of the item, call it :
iGiantKey1
Then, when you interact with the object :
function oGiantKey1_Interact()
{
oGiantKey.Visible = false;
player.AddInventory(iGiantKey1); //add the inventory item
}
I made the inventory item but cannot get it into my room. Sorry for being such a n00b about all this.
Let's say that you have created your inventory item in the node tree, and you rename it : iGiantKey1
Then you can choose if the player start with that item when the game first start
(but this is optional, not to solve this issue)
After this, you interact with your object.
By doing this the object become not visible and the player add the Inventory item, of course, not the object.
So then, where you want to store it ?
In an InventoryWindow i guess.
Just create a Gui. Inside of it add an InventoryWindow.
All you need is to read the dynamic helps. You can check the dynamic helps inside AGS by pressing F1
Thank you so much. I was misreading the dynamic help.
Hello Anpiel.
There are some tutorials (https://www.facebook.com/video.php?v=945414198816924&permPage=1) which can help you get started with the AGS. There are video tutorials too. :)
Thanks for the heads up