structs

  1. Crimson

    GMS 2.3+ Setting Uniforms for Structs in Shaders

    So, I've got a shader, and it has a struct. I'm trying to pass through values with shader_set_uniform_f, and it's not doing anything. In the Fragment shader, I have: struct Moop { vec3 pos; vec3 rot; vec3 scale; }; uniform Moop moop; And in the creation event of the object...
  2. P

    SOLVED Debug Message of Structs causes Crash

    I'm working on something using structs instead of objects because I'll need a ton of them. One functionality that I want these structs to have is for them to have an inventory and for them to be able to receive input from other structs and give output to other structs. What I did to achieve that...
  3. J

    GMS 2.3+ Help with Structuring Data for Chess and Structs Question

    So currently I'm storing the id's of all my chess pieces into an 8x8 ds_grid representing the chess board. Instance variables such as has_moved are referenced and changed to deal with castling and double pawn moves ect. This worked perfectly fine until I started to work on the ai. Only after...
  4. S

    SOLVED Way to use Variables(Strings) in Struct Pathing?

    Hello All, I am hoping this to be a very easy question that I may have overlooked in the manual, but I can't seem to find the answer. The title may be a little confusing so let me break it down. Lets say I create this struct: var stats = { stat0 : 23 stat1 : 24 } Keeping it basic...
  5. Moon Goat

    SOLVED Can't seem to get a constructor to work

    I'm trying my hand at using constructor functions, but I can't seem to get them to work. I have a single constructor function that looks like this: /// @function thing(_x, _y); /// @param {real} _x Creation point x /// @param {real} _y Creation point y thing = function( _x...
  6. FeetUpGaming

    GMS 2.3+ Sequence Object/Instance Struct

    Hey all, so i've been trying to figure this out for a while, using the forums google etc to find resources or documentation about it, but can't find anything. I have a sequence which plays as a cutscene and uses sprites. The sequence gets paused to wait for player input but this also pauses...
  7. Kezarus

    SOLVED Is delete operator really required?

    I'm cofused about the documentation of Structs. On the segment that reads: "When a struct is no longer required it can be removed from memory using the delete operator, which flags the struct as being able to be garbage collected. This is not strictly required as the garbage collector may do...
  8. FoxyOfJungle

    GMS 2.3+ Why use "static function()" inside a struct function??

    I tried to look in the manual but I couldn't find exactly what I wanted, it's because I'm using structs and I ended up in a situation where I need to use one function inside the other, but I saw people using static, but I don't know what the function is, I click on the function and it doesn't...
  9. xDGameStudios

    GML [TEXT TUTORIAL] Hash Tables Explained - Structs vs Maps

    GM Version: Studio 2 Target Platform: Windows / All Download: n/a Links: n/a [FACTS] Hash tables are "constant time" but they are constantly slower than arrays (by "very" little). Both ds_maps and structs are hash tables, so they store data as [key: value] pairs. [HASH TABLE] An hash table is...
  10. samspade

    GMS 2.3+ JSON with Structs in 2.3.1

    Now that we can load json data as structs and arrays, I have a question. I can take the following data and load it in: { "Some Data" : "Hello World", "Some More Data" : "Goodbye" } And that will give me a struct with two variables containing the strings hello world and goodbye...
  11. netoxinaa

    GMS 2.3+ Getting the name of a constructor

    Hello. I'm having a little issue trying to compare an item object with its constructor. I have this constructor function called Cellphone and my player has in its inventory an object made from that constructor. So what I want is to check if the player has in its inventory the item Cellphone. So...
  12. FoxyOfJungle

    GMS 2.3+ Disabling Garbage Collector: What are the risks?

    As we know, we now have the Garbage Collector, the only problem is that it uses 14% of the CPU with only 2 loops (and some other simple layer functions) in an empty project on a Ryzen 5 CPU. When disabled using gc_enable(false), the performance drastically increases, using between 0 and 1% of...
  13. X

    GMS 2.3+ Struct confusion

    I am trying to learn about structs in GM but am having problems understanding them from the documentation I want to create a function in a script that takes some parameters and uses them to construct and return a struct after applying some calculations For example I thought this would work...
  14. samspade

    GMS 2.3+ Bug or not with struct inheritance?

    I think there is a problem with method variable constructors and inheritance, but I'm not sure if this is a bug, intended behavior, or I've made a mistake in my code. The following will work whether it is put in a script asset or an object (so long as you respect scope if its in an object)...
  15. P

    GMS 2.3+ Arguments aren't shown in the Constructor Function

    I don't know if it should be this way, but if it does than it's just really bad and disgusting. I've tried to develop attacks for AI mobs in my game using new Structs, and this is the code I've ended up with(please let me know if there are any other problems except for the one I will explain...
  16. Bart

    GMS 2.3+ "Constructor methods", assigning a creating struct's id to a newly created struct

    Hi all. I'm trying to do a seemingly simple thing using the new structs in GM2.3: /// Convenient macro definition #macro log show_debug_message /// Function definitions in script asset function ins(creator) constructor { self.creator = creator; log(self); } /// Struct definition...
  17. FrostyCat

    Asset - Scripts Lightweight Data Structures

    Lightweight Data Structures Giving ds_*() functions a run for their money since 2020 Overview This library implements struct-based, GC-friendly equivalents of GameMaker Studio's built-in data structures. It also adds the ability to save both single-layer and nested structures, in plaintext and...
  18. A

    GMS 2.3+ Need Help Using Sequences for Character Animations

    I am working on a RPG that has various armor and animations using different sprites to piece together the characters. The new sequences pretty much does that and it will make it a lot easier to make new animations. All I need to do is figure out how to change the sprites within the sequence...
  19. DarthTenebris

    GMS 2.3+ Struct

    Hello everybody, I recently got to try out the new features, and the new structs made me think a bit. I have a script called EngineUI, which I intend to house all the GUI elements I'm going to make programatically. Previously, I made an object for every button I added. With the new structs, I...
  20. MoonShroom

    Calling another struct within a struct constructor

    Hi all, I am currently trying to initialize a struct inside of a struct constructor, like so: /// @function Rectangle(X, Y, Width, Height) /// @param {real} X /// @param {real} Y /// @param {real} Width /// @param {real} Height /// @desc Stores a set of four reals that represent the location...
Top