GameMaker 'Structs' Tutorial

preview_player
Показать описание

A quick primer on structs, what they are, how to make them and use them. Structs are a relatively new feature of GML as the language continues to modernize along with GameMaker itself.
Рекомендации по теме
Комментарии
Автор

Shaun's brilliant tutorials taught me enough about coding that I managed to pick up C#. I still use GM2 for some projects but it's worth knowing that a LOT of these tips translate to other languages!

BritBox
Автор

It helps to hear gms concepts from different creators. Thanks for showing it in use (creating the helmet and shield) without much preamble. It's strange but I find lengthy explanations harder to grasp because they talk more conceptually instead of how something is immediately useful. Once I see something is useful, I get it.

stubz
Автор

Short and to the point. Exactly what I needed. Thanks Shaun!

ikonhero
Автор

Best GMS tutorial channel on Youtube, thank you so much for what you do!

GlamourSwinexXx
Автор

Structs are also so good to save data with json, thanks a lot for your amazing work !

buuduuthe
Автор

I've never heard of structs until now. They look amazing thanks for the video.

sebastianlucas
Автор

Thanks for the simple but effective explanation!

hristoborisov
Автор

I've been putting character stats and stuff like that in arrays this whole time... It looks like it'd make a LOT more sense to put that all into a struct. Thanks for the video.

Jsitun
Автор

Omg, this is going to make my dialogue code so much more readable!

mayazimmerman
Автор

This is very useful! Yet another reason why I will always credit you in my future games

ArisTheMage
Автор

I find an array of structs to be ideal for tracking item data in my (eternally in development) RPG. The only wrinkle seems to be that I need to loop through my empty object pool at initialisation time to define each struct member in each array element, along with its defaults. It takes so little time for this one-off task that I hide it in the launch code.

item_master_list = array_create(ITEM_MAX_MASTER, noone);
for (var f = 0; f < ITEM_MAX_MASTER; f++) {
item_master_list[f] = {
item_name : "",
item_type : ITEM_TYPE.NOTHING,
item_level : 0
// lots of other struct members here...
}

After that, it's as easy as ...
function Item_Set_Name(item_id_in, item_name_in) { // bounds checking not shown
= item_name_in;
}

I forgot about member elements possibly being functions. I can do a lot with that! Many of my game's items need to trigger some function on use, so this will be perfect. Thanks Shaun!

garypatterson
Автор

So if you were to make a Pokemon clone, is this how you'd store attack attributes (type, base damage, etc)? As well as Pokemon themselves (types, base stats, abilities, natures)

anonymone
Автор

Your tutorials are well detailed and excellent, I would like a new tutorial series on platform fighting games because the old one does not use StateMachine and the Scripts have changed, ... if you can

blueper
Автор

very cool, how would it be if I wanted to organize by character name in alphabetical order? imagining that I have a list of estructs

fabioem
Автор

Structs are so much handier than DS maps! Also much easier to turn into JSON to store in a save file. No more copying maps to other maps.

NaudVanDalen
Автор

Is there any way to transfer the
structure of an object in one room to an object in another room? For example the second room is the level, while the first room is the equipment menu: the item has a structure of 3 variables, the id of the character, the id of its slot and the id of the item in that slots. If the third variable of the structure is zero, then it has nothing equipped in that slot. Once the equipment is chosen, the structure will be transferred to the other room in the character object structure where he will receive the upgrades of the equipped items.

guidomenicacci
Автор

Where do I put these type of codes
In the Player or Script or something

BlazonStone
Автор

how would i change a variable of a struct that I have created with a constructor?

sickdewd
Автор

Hello, please teach the rain in Game Maker 2

xshayanwx
Автор

hi shaun, good video, can you upload a video about the joints? to create an articulated arm please

mafyproyect