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

script

  1. David Lorenz

    SOLVED Using a Script's arguments in a method it contains.

    Hello everyone! I just tried to write a script that contains a Time Source and it seems like I can't use the Script's arguments inside the method I want to call with it. (The following code is just an example) function...
  2. B

    GameMaker A script that could check if a specific sprite has been used

    I want to have a script that is running in the back of the game where if a specific sprite is used, something would happen. I can't seem to find a way for the game to check if a sprite is being used at the current moment or not, can anyone help?
  3. S

    GameMaker put scripts in queue without immediate execution

    hi, i want to store scripts in queue to execute them later in a specific order. my code looks like this: ds_queue_enqueue(queue_name,script_name(script_var)) the problem is that the script will be executed immediatly. is there a way to store the script and execute it later via ds_queue_dequeue?
  4. R

    GameMaker Problem With Collision Objectcs

    I'm programming the game in gamemaker and I have a problem with collisions of objects, the debugger shows that everything is fine but when I start the game this pops up: ___________________________________________...
  5. kun4i

    SOLVED What did I do wrong in this script?

    All I really wanna accomplish with this post is to know what I did wrong in this script so I can familiarize myself more with GML. (The function is called inside a Draw event.)
  6. G

    Question - Code with(){} with scripts bug, need help(GM:S1.4)

    I have a function that lists all collisions with specified object: ///instance_place_list(object) var obj=argument0; ids = ds_list_create(); with(obj) { if(place_meeting(x,y,other.id)) ds_list_add(ids,id); } return ids; This function runs for every enemy in every step to check...
  7. Rafael Augusto

    Windows "draw sprite shadow" finding the sprite that will have shadows

    I have a question about the script "draw sprite shadow" how to locate the sprite that will be placed in the shadow with the code: draw_shadow(5,315, c_black, 0.5) I got it by "draw_sprite_ext_shadow" but mine game is big I need a simpler solution like the one mentioned first. link:Script
  8. Bingdom

    Asset - Scripts JS Arrays

    Github Marketplace JS Arrays is a small free library that aims to extend native array functions to provide identical functionality to JS arrays. Some useful examples array_map() // Creates a new array that contains just the names of items var items = [{ name: "Sword", type: TYPE.melee }...
  9. G

    GML Creating a new object/class from code, how?

    To start with, I don't mean create an instance, like you would with Instance_Create_Depth/Layer. Just so there's no confusion. So what I am talking about is creating a new object from whole code, likely from an external file. An example would be... So the question is somewhat twofold. 1) how...
  10. clee2005

    GameMaker Build scripts - pre_package_step.bat

    Hey gang, I'm wanting to use the pre_build scripts to copy some files and change values so the addition of these scripts is great. What I now need is a means of knowing what the configuration is for the running build. The pre_build script would copy different files or insert different values...
  11. 31Nf4ChZ4H73N

    SOLVED Variable not set before reading it error when calling a function defined in script

    I have two objects oObject1 and oObject2 and one Script myScript. myScript just returns 0 for testing purposees function myScript(){ return 0; } in the create event of oObject1 I create oObject2 and store its id in the variable obj2. Then I execute myScript in obj2 by using obj2.myScript...
  12. D

    GameMaker Strange script behavior with an array push

    Hello again. Today I was attempting to push a newly created struct which takes an objects variables and saves them to itself, and pushes it into an array like so: with (obj_items) { var _saveItems = { obj : object_get_name(obj_items), allItems : myInventory }...
  13. late77

    SOLVED GameMaker Studio 2. Problem with scripting.

    Hello. I'm trying to do script, that allows user to set values for a circle. Issue could be that boolean, because it get value that is number. In any event I think its not the problem, since GameMaker will interpret a real number equal to or below 0.5 as a false value, and any real number...
  14. DemogorgonXD

    Variable not set before reading it - Error with a script.

    I made a player object, and I am trying to make cases and when I copied the movement code to the script and called the script from the step, I got the error down below. I am attaching my script and my player object. please help! I have come to the conclusion that it might be because I never...
  15. K

    Followed youtube tutorial for sonic fangame and can't jump.

    I have been following this youtube tutorial for a basic sonic engine for a fan game i want to make: i have been following the tutorial and had no problems until after i finished the collision scripts. This is apparently a problem a number of people in the comments have but no one posted a...
  16. X

    Functions Cause Memory Leak?

    I've created a set of functions inside a script, but using those functions seem to cause a memory leak. I saw a thread talking about this on the forum, but it was posted in October 2020, and I just found the leak now. I don't know if this helps, but here is my function inside of my script...
  17. David Lorenz

    SOLVED Play a sound once every time a variable changes of an integer, inside an Approach_Number Script

    Hello everyone! I am trying to modify a simple approach_number script to include the possibility to specify a sound in it's arguments to play it as the returned value gradually changes by integer numbers. I was able to set the new argument and play the sound but couldn't find a way to play the...
  18. N

    code it so when you press a walk direction it plays a walking animation.

    So I have made the walk cycles and my code for walking is outdated, here is the code x = x +0; if keyboard_check(ord("A")) { x = x - 10 } if keyboard_check(ord("D")) { x = x + 10 } if keyboard_check(ord("W")) { y = y - 10 } if keyboard_check(ord("S")) { y = y + 10...
  19. D

    Asset - Scripts Free Easy GUI Creator Script

    Hello, guys! I've just released my Easy GUI Creator script. The idea behind this script was to make it easy to create and customize the GUI for my projects. I made it for myself, but since I really enjoyed it, I'm now releasing it for free. Marketplace link...
  20. Geeholla

    Problem with starting up

    Building a physics sandbox project to test out the manual physics I want to implement in my first game. Literally copied and pasted code from a tutoriall to get a basic projectile path tool working. When I try to run the code, I get the attached error. Could be a version thing since this is...
Top