• 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!

function

  1. E

    New to GM, Unknown Function or Script Help

    Hi, I am trying to create a FPS, and i have run into some errors. I have three: Unknown Function or Script: 'external_call' Unknown Function or Script: 'external_define' Unknown Function or Script: 'd3d_model_load' I have downloaded the latest version of GM. Thanks!
  2. Daniel Mallett

    Question - Code arguments in scripts

    I'm having trouble passing arguments to scripts. I get the following error:- Object: obj_grid Event: Step at line 74 : function "spt_reorder" expects 7 arguments, 6 provided However if I remove the code in bold I.E both the send and receive argument it's fine. spt_reorder(x,y,x +...
  3. C

    Sin function not working

    Hi. I'm fairly new to GM2 and programming in general so sorry if this is a stupid question. Im trying to make my object slowly pick up speed in the y direction and then slow down gradually, essentially the first arch of a sin function. So, I am trying to use a sin function to dictate the...
  4. T

    Question about Passing the interaction of an object to another

    While I'm trying to make a clicker game, i found out that 'set health' function does not have an option to pass this interation to another obejct. What I want to do is to click on the background to reduce the health of the monster. Wherever I click, monster gets damage. this is what i want to...
  5. 2

    Can Studio 1 or 2 detect Wacom Tablet as Touch Function or Event

    Do touch events or functions in GM Studio 1 or 2 work only with touch screens? Can they work with Wacom Tablets? I don't a have touch screen, but I do have a Wacom tablet, and it does allow hand gesture type stuff. Will it register as a touch screen does? Any difference between GM Studio 1 and...
  6. I

    GML [CLOSED] Functions as Parameter

    Hello, since script_execute(my_script); is taking only a name of a script, I came up with this question: Is there any way to pass a built-in function or script as a parameter into a script? I looked it up in the GML Reference, it does not provide an answer. As an example: A script which...
  7. H

    choose() seems to pick more than one variable

    Hi! I am having trouble with the 'choose()' function. I have made two variables, rupee and heart, both of which are set to create an instance of either a heart or a rupee when activated. I have set up a 'random()' function as well that sets a 1/3 chance for either one of these variables to be...
  8. Z

    Legacy GM Q:Tiles

    Is there a chanse yoyo will make a deactivating function for tiles? currently im tryin to tile up an overworld but i end up with 50k+ tiles that i have no controll over. now if it were instances, i culd just deactivate the lot of them and things wuld be fine and dandy. how does one deal with...
  9. B

    Question - Code GMS2: Functions not in documentation

    I was typing in 'debug' and noticed 2 functions... debug_get_callstack(); debug_event(string); Have these functions been implemented, if so, what do they do or are they just reserved just like #region and #endregion macro's?
  10. S

     [SOLVED] get gamemaker version?

    I think there should be a way to get from a function or constant what exact version of GameMaker a game was compiled with. GameMaker Studio 2, just like 1.4, has a ton of bugs, especially with HTML5. This would also be useful for people writing extensions because, if a certain update of...
  11. D

    Legacy GM [SOLVED] function "then"

    Hey folks, little quick question,...somehow, I tripped over this function "then" but it doesn't seem to exist any information about it? So... how does this function work and where could (or should?) I use it?
  12. J

    [Maths] Exponential function for cámera speed

    Hey there! I'm doing a camera muvement based on the mouse position according to the border of the camera, so, I what to make it so that while more close the mouse is to an edge of the camera, it move faster. But over the game, the point the mouse has to reach to de camera starts moving...
  13. R

    Legacy GM Two questions.

    Hi everyone! I'd like to know if it's possible to call a piece of code (something like a function) of an object from another one. Because I want to make things more organized in my code, and instead of writting it every time I need, I would just have it written in one object, and call it when...
  14. T

    directory_destroy is not working

    Hello. I have been trying to find out why the function directory_destroy() is not working for me (it just does nothing), and I read on a forum post that this happens when the directory's path includes non Latin characters (which happens to be true in my case). Is there another way to erase...
  15. Z

    Discussion [SUGGESTION] script_execute() shortcut and more...

    I have two suggestions I'd like to make for GMS2 that I feel like is something little that would make more traditional OOP users happy. That would be a script_execute() shortcut. At the moment, we can access scripts stored in variables by using script_execute. That is great and all, but it'd...
  16. S

    GameMaker code never gets executed

    can someone tell me why the code in case three never gets executed? my state is 3 I checked in the debugger. /// @description Update Window // You can write your code in this editor switch (state) { case 0: if (mouse_check_button_pressed(vk_left)) {...
  17. D

    HTML5 button to switch to fullscreen

    Hi people, Is it possible to make an button to switch between normal screen and HTML5 fullscreen. Like I did it with this code in PhP: But I want to make an button inside my game... So i dont need to make an button with html... Can someone help me? Greets, Dennis
  18. J

    GML Move function

    Hello, I am watching a tutorial from 2015 and in it the guy uses move(hspd, vspd); Game Maker Studio Professional 1.4 won't launch the game and says that this is an error.
  19. S

    Question - Code New function for draw_enable_alphablend?

    Attempting to create a level transition based off of legend of zelda, though when I was following a tutorial from an older version of GM, the guy used a function named draw_enable_alphablend. Unfortunately, this function looks to have been either removed or changed. Does anyone know what...
  20. V

    Question - Code Potential bug with surface_copy_part()?

    I have converted a little project I was trying around with in Game Maker: Studio to GMS2 and had unexpected results. When trying to fix the problem I was able to trace it back to one particular function, namely surface_copy_part(). What I am experiencing, is that the resulting image will be...
Top