function

  1. G

    How to play once the animation of die before function( game_restart(); )

    I'm making 2d platformer in GMS Language. I've a varibale "hpHero" and i did like " if hpHero=0 { game_restart(); } but I need to play the animation of die before game will restart,pls help me
  2. FoxyOfJungle

    GMS 2 [SOLVED] zip_unzip() - How to save in a different location?

    The new version of Game Maker Studio 2.2.3.436 lets you disable the engine sandbox, this works with the "file_" functions, but doesn't work with zip_unzip(). Is there any way to extract a zip to any location outside of "appdata"? I'm basically doing an update system, and I need to extract the...
  3. syscall

    GMS 2 Is there SDK or a hack/way to call GML builtin function from external side?

    Hello, This would be my second post (as well as thread) :) The title pretty much says it all about here. In my previous thread, I have talked a bit about my first extension (in my first game built using GameMaker). So far I have been able to call external functions from GML scripts. Our...
  4. syscall

    GMS 2 Suggestion: Calling convention option for external functions

    Hello, I am very new to the world of GameMaker, I have just started using it since last week... But, I am fairly experienced in several of other programming languages (such as C++, C#, JavaScript). That being said, I am the one who prefers object-oriented programming. So, I started to learn...
  5. D

    GMS 2 Does GMS2 allow to create custom functions?

    Hi! Can't find the info about custom functions inside my scripts or events. Is there any possibility to do something like this? switch(item.type){ case "weapon": func_do_something(); break; } func_do_something(){ //some code here }
  6. EvanSki

    GMS 2 [Solved]How do I do the script @param stuff?

    I want to start messing around with the @params like this /// @Description A test of the params /// @param Object /// @param x /// @param y /// @param count scr_testparam(obj_enemy,256,145,69) But what I want to know is how would I use it with the Built in variable (argument0-15) I'd love to...
  7. Architheutis

    Strange random-behaviour

    Hi Folks, On running a code like this, ALWAYS results "6 Knifes". It only changes by adding or deleting one or more weapons. But after changing the ammount of the choice, the same weapon is shown again and again. CasualWeapon_ = choose("Crossbow", "6 Knifes", "Hellbarde", "Warhammer", "10...
  8. V

    [SOLVED] Call external function in DnD

    Hi, I'm newbie programming in GMS2, really I'm using DnD. I've finished my first game and now it's time to distribute it. I'm going to publish it in BLUR app. This really needs very few steps for integration: 1. Place this rcode before the end of the </body> (closing tag) in “index.html”...
  9. E

    GMS 2 Need Help With "draw_set_halign()" Function

    I'm creating a simple inventory screen for my game in its own room. The room currently only has two objects that possess draw events (to clarify, there are other objects in the room, these two are the only ones that use the draw event). The first object, called "obj_inva1amountcounter" counts...
  10. N

    Discussion can we have function like variable_global_get_name()

    Can we have variable_global_get_name() *function that gets name of all exist global variable in the room as an array of string I am trying to make debugger and already work around another similar function like variable_instance_exit /get_name /get /set which goes pretty well but when work around...
  11. F

    old code

    Hi, i found some 10 year old code for gesture recognition, and since its free i copied it. one error appears, and its something about a function called : line_distance. apparently this doesnt exist now. does anyone maybe know what this did, and if there is an equivalent function now. in this...
  12. T

    modular variables?

    Hey guys. I was wondering if it was at all possible to create modular variables in our scripts... Which I guess are kind of like arrays? Here's an example of what I mean: Var mod = ”” Var [mod]dog = 0 Var breed = 1 If (breed = 1) { mod = ”bull” } else mod = "lab"...
  13. zendraw

    Windows [SOLVED]Q:Display color values

    Hi, does some1 know how can i get to display the hex value of a color? Do i have to create such a script myself?
  14. F

    GMS 2 Using move_towards_point(x,y,speed) to make a path not functioning properly

    step event for Obj_cutscene_prop1: If !place_meeting(Obj_trigger1.x,Obj_trigger1.y,Obj_cutscene_prop1) { move_towards_point(Obj_trigger1.x,Obj_trigger1.y,4) sprite_index =spr_jack_oshimatao_walking_south_east image_speed =4 } If place_meeting(Obj_trigger1.x,Obj_trigger1.y,Obj_cutscene_prop1) {...
  15. M

    GML Get Specific value in Grid with String or Func

    Hello, I started a little bit to discover the Grid since yesterday to learn more and I face a little problem. For the example I have this : Text = ds_grid_create(3, 2); I reduced to the simplest. What I am trying to do, to simplify my task for later, is to access with eg "K1" as a...
  16. Patrick Johnson

    GMS2 While and If statements Error Malformed

    I'm having an issue with the "while" and "if" statement in my code. I run the compiler but it says that the function is malformed, regardless of whether or not I use "while" or "if". It works fine in GMS 1.4 but not GMS2. /// Code in the game > o_enemy > create event ///...
  17. I

    GMS 2 Alternative for "Approach" in GMS 1.4

    Hello! I have being watching one YT tutorial, and the tutor was using GMS 2, and he used "Approach" function. I wonder what is an alternative for "Approach" function, in GMS 1.4. Thank you
  18. S

    The Return statement doesn't work in the script

    Hi, In a nutshell, I want to use the scr_zx() I created besides this: if (keyboard_check_pressed(ord('Z')) or keyboard_check_pressed(ord('X'))) so I created the scr_zx() function where i've put: return (keyboard_check_pressed(ord('Z')) or keyboard_check_pressed(ord('X'))) then I replaced the...
  19. J

    GMS 2 view_wport vs. view_set_wport

    What is the difference between using these? The documentation declares the first (view_wport) as a variable and the second (view_set_wport) as a function. But, for example, view_wport can be used to set and get the port width without using the functions. So why use the functions if I can just...
  20. Simon Gust

    Legacy GM Test FunctionA() against FunctionB()

    Might as well make it a thread if that is legal. What I want here is for people to take similar functions or whole methods and compare their speed. Like distance_to_object() vs distance_to_point() vs point_distance(). While the functions are different and might not work for every situation, it...
Top