#inventory Help

23 messages · Page 1 of 1 (latest)

vernal egret
#

How would I make a inventory using Struct as a list like how Pokémon does it

lethal raven
#

You wouldn't be able to do it with structs alone. You would also need arrays, or another data structure to be able to have a list of items.

#

I would look into arrays and/or ds lists in the manual. I highly recommend arrays though.

#

once you understand structs and arrays, then you can tackle making an inventory

vernal egret
#

i somewhat understand arrays

lethal raven
#

you need to fully understand them and structs. For structs, it would be best if you understood constructors.

vernal egret
#

are there any good videos that aren't old or out of date explaining them

vernal egret
#

GML is now more "OOP" with Structs & Constructors! Watch the video for an in-depth preview of the updated GML.

📃 Read more about the update: https://www.yoyogames.com/blog/549/gamemaker-studio-2-3-new-gml-features

💗 Check out my latest Udemy course: https://www.youtube.com/watch?v=aUq4xBsruHI
(Really appreciate all the support!)

🤝 Join our Di...

▶ Play video
lethal raven
#

sure, they're both short so may as well watch them both

#

sams has multiple parts

#

I'd check out their array videos too

vernal egret
#

so anything that's 2.3 or above that should be fine it looks like

lethal raven
#

it should yes

#

data structures are a bit of an advanced topic in most programming languages, which is why inventories can be overwhelming for a lot of people

#

once you understand them, inventories are much much easier to make

vernal egret
#

i did a while back make a very simple inventory doing this ```global.items =
{
wood: 4,
sap: 10,
woodPlank: 12
}

vernal egret
#

https://www.youtube.com/watch?v=fa26B54JDDk i know i been told NOT to watch this guy but is this video really bad or can i learn something from him

Support me and these videos on Patreon! https://www.patreon.com/peytonburnham

Full tutorial on creating functional items and inventories for ANY game! Hopefully it helps you out and you can get through my rambling!

Menu System Video (very helpful to watch if you're not comfortable with "for" loops and arrays yet): https://youtu.be/xLasKr0ekHY
...

▶ Play video
lethal raven
#

highly recommend not watching any of his stuff, it'll only hurt you in the long run

vernal egret
#

it doesnt look that bad but i trust you

#

he did basically what i want

vernal egret
#
{
    Name = "apple"
    How_many = 0
}

function wood () : Tree() constructor
{
    Name = "Wood"
    How_many = 0
}


function sapling  () : Tree() constructor
{
    Name = "apple"
    How_many = 0
}``` so im trying to make this now im 99% sure the "error" means nothing but i want to make that 100% unless i wrote this wrong it should be fine right
#

and this is the video im copying from just using my own words