functions

  1. elsemeow

    SOLVED Which way to call a function is more robust?

    Hello! Please, help me with this: What is the difference between these two approaches? Which of these ways will be less likely to change in future updates? Context: Eg. fn_foo function in script scr_script function fn_foo(_arg) { show_debug_message(_arg); } Arbitrary place in the object...
  2. xDGameStudios

    Asset - Scripts [BUFFERS] xBufferViewer is a GUI for buffers (v1.0.1) (FREE)

    [LINKS] https://marketplace.yoyogames.com/assets/9617/xbufferviewer https://xdstudios.itch.io/xbufferviewer [SCREENSHOTS] [INFORMATION] This asset is composed by a BufferViewer structure (new in GMS2.3) that allow for visualising/selecting/copying buffer contents. The viewer GUI is fully...
  3. FoxyOfJungle

    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...
  4. Wonsubon

    SOLVED Using functions in switch statements?

    Is it possible to use functions in a switch statement? I have an object that, when destroyed, will destroy another object with it, but there are multiple security camera objects and only one can exist at a time. if(instance_exists(obj_camera01)) instance_destroy()...
  5. P

    SOLVED How to Update Function Description and Arguments???

    Hello Everybody, I have met the problem while trying to remake some of my functions in GMS 2.3 . I had 6 different scripts for converting coordinates to isometric like in Shaun Spalding's tutorial. Then I decided to use new feature of GMS 2.3 and collect functions from those 6 scripts into 1...
  6. P

    GameMaker Help with angles maths

    Hello everybody. I need help in making my cursor (which is an aim of the player) move randomly around the real cursor(mouse x and y). The problem is I don't know how to create the function of the x and y coordinates of the cursor (which is actually just a point with sprite) the way that it moves...
  7. C

    GML [Solved] Data structures of objects, message passing, and multiple collisions

    I'm new to GMS2, but I have 34 years programming experience, including 4 years video game programming. IDE v2.2.4.474 Runtime v2.2.4.374 I watched all 4 of the 1st game gml videos on youtube and made the game along with them. I've been searching the forums and the docs on yoyogames. I've...
  8. P

    Passing 2 argument with one DS

    Hello Everybody! Im new to Gamemaker 2 so and programming at all so i dont know if there was a way to pass 2 arguments in function with ONE data structure(of any type). I mean imagine for example that you have to create an object with fixed X and Y coordinates that are always same, but is there...
  9. Kezarus

    Asset - Project Free Asset - Monastery Framework

    Monastery Framework OBJECTIVE Create a framework project on GM2 that have some useful functions, GUI elements (buttons, panels, containers), basic Options menu, start Ini files that houses preferences, the basic setup for music, sound and particles. DESCRIPTION Ok, I will have to do something...
  10. S

    GML A way to extract all GML (builtin) functions' metadata?

    Hello, I have been working out on the SDK for Windows DLL extensions... It is going great. But, I do have a question, is there a function in GML which would return a (big) map data-structure, a value containing all builtin GML functions' metadata (information about the function signature...
  11. Fixer90

    GameMaker Script with Unlimited Arguments?

    I am mostly aware of how GML's script system works — with arguments and whatnot. However, I am curious as to if there is a way to make a script with no limit to arguments, similar to some built-in functions in GML (ex. ds_list_add). Is this possible?
  12. Suzaku

    GameMaker Useful functions for the Draw Event

    Im starting to learn how to use the draw event to draw everything in the game and I would like to know some of the most common and useful functions that are helpful to work with the draw event, not only "draw_" functions, I want functions like something to get the borders of the drawn sprites to...
  13. Evanski

    Why is there not a font_get_range?

    Why is there not a function that gets the available range of a font? For example, you have a font (fnt_arial), with a range of 65 - 68 so the available characters from the font is A,B,C,D Now imagine your making a user text input system or just want to see if a font has the character in it So...
  14. T

    GML Functions within script

    Hi all, Is it possible to split your GML scripts into functions? for example I have a piece of code like this: // Jumping if (place_meeting(x, y+1, obj_wall)) && (jump_key) { vrt_speed = jump_power; } // Horizontal Collision checking if (place_meeting(x+hoz_speed, y, obj_wall)) {...
  15. A

    Buffer confussion

    Hello! I've been using buffers to save / load huge amounts of data, to cut the long story short this is the save code: var _cmp = buffer_compress(_data_level, 0, mw * mh * REGION_SIZE); buffer_save(_cmp, string(level_name))//+ "|*.mle")...
  16. L

    GML Aren't variables supposed destroy themselves?[solved]

    Ive used game maker for about 8 years now but haven't really used the debugger ever. I recently started using game maker studio 2 and have a few things that are making me go wtf. so I fired up the debugger and when i pause to check my local variables, i can spot variables that were created in a...
  17. 3

    Shaders How Much Can the GPU Handle in 3 Dimensions?

    Relatively quick question, in the process of drawing 3d models i normally, map out a .obj file to their corresponding; v (x,y,z) , vt (u,v,w) , vn (i,j,k); vertex position in 3d space ,xyz, vertex texture in 2d space with w for mapping ,uvw, and vertex normal for lighting ,ijk,. I've gotten...
  18. Azenris

    GameMaker [Solved] tileset_get_name and tilemap_frame

    Hi, dunno where to post this, but I was needing some functions. I wasn't sure If there are other functions that act the same, if they were missing, or soon to be coming. tileset_get_name : retrieve the resource name of a tileset index Needed some same reasons as sprite_get_name...
  19. HayManMarc

    [SOLVED] Function works; x position variable off.

    Hello, it's me again. I tried to put this code in a script so I could make my own 'region' ( and make that region easier to define), but it doesn't produce the effect I know it's making contact because other code works (for example, reduced hit points). No errors, but no particle effect...
  20. I

    GameMaker Calling Python Functions

    Hello everyone! Would there be a way to call a python function at runtime and somehow process its output?
Top