• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

methods

  1. Tangerine

    GameMaker Question about scripts/functions

    Hello! I was reading the manual about scripts and functions. At some point it says that it is not recomended to name functions in a script with the same name of the script asset name... However when I create a script asset, Game Maker by default creates a function with the same name of the...
  2. FrostyCat

    GML GML FAQ - Passing Local Variables into a Method's Body

    GM Version: GMS 2023 and up Downloads: N/A Links: N/A Last Updated: 2023-07-09 (Adding 2023.6+ struct shorthand) GML FAQ - Passing Local Variables into a Method's Body This article covers two basic patterns for passing local variables into the body of methods. Common applications include the...
  3. B

    GameMaker Methods Inside Struct Not Working Properly

    I'm working on a player state machine. I want to create movement states based on smaller predefined movements (so that I can mix and match to create those movement states). For example, rather than just have a default player state that contains all the code for that state, I would like to...
  4. Lumenflower

    SOLVED Arguments when defining method variables within a function

    Hello, I have been working on a little text-based project recently based on an unfinished entry into one of the jams a few months back. Instead of typing in commands and having it be interpreted by a parser, certain words are highlighted in colour so the player can click them and choose from a...
  5. NikkoTC

    Asset - Scripts GML-Classes - GML script providing OOP features.

    What is it? GML-Classes is a script that provides some OOP functionality that allows you to define classes, their constructor and destructor, and call parent methods in overridden methods. Why does it exist? The main reason is convenience, in particular the convenience of calling parent...
  6. ConstaChymic

    Method() memory management?

    Helper functions around methods don't seem to mention needing to use delete on them or otherwise clean them up, but I'm still worried something like this ///@func from_user(buffer, width, height, userfunc) static from_user = function (bff, i_w, i_h, userfunc) { if ((i_w <= 0...
  7. C

    Inputting Methods Into Scripts

    Hello forums! Long time no see. I have a quick question that I need answered, and I know somebody here can do it for me. The question is: Is it possible to input method variables into script functions? Here's an example of what I'm trying to do, but which doesn't work: // Step Event: Test =...
  8. Nick Nishort

    [SOLVED] Are instance method variables duplicated for each instance or not?

    Hello! It isn't entirely clear to me how the instance method variables work. For example I have the following code: // Object Create Event method_var = function() { // do smth... } Will "method_var" variable contain the copy of the function, which will recreated for each new instance (and...
  9. Bart

    "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...
  10. Erik Leppen

    How to use methods? What's "self" in methods? How to get the method's "parent instance" from within the method?

    I'm trying to wrap my head around the new 2.3 functionalities and end up getting errors I have no clue about. Can someone please tell me how to actually use these new functions in order to gain any advantage over the old way of doing things? What i want to do is couple any scripts that "belong"...
  11. flyinian

    SOLVED What are some ways to create a menu system?

    I am creating a menu system for my game and was wondering what methods are out there. A little bit about what I'm doing, What I have so far is several buttons. if one button is pressed it creates its items, if a different button is pressed if destroys the items from the last and creates its...
  12. P

    Organization, method of handling?

    Hello, I'm planning to make a short interactive story and this is always bothering me, it's a linear short interactive story so for example it should go something like this, introduction --> player is in bed --> player gets out of bed, etc etc, my question is how do i go on about handling the...
  13. S

    "Methods"/"Member Script" functionality improvement

    Was wondering how any of you would improve on this. I have an object called oMethod. this object is a parent object for all objects I wish to use my Method system. I also have one script called method(name, *args); here it what it looks like after creating this object... any children...
Top