script

  1. Cofefe

    GMS 2.3+ 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 =...
  2. F

    GMS 2.3+ Hard times with scripts...

    Hello there (and please forgive me for asking something in the wrong thread, if someone can fix that mistake), I hope everyone's doing great these days. I am currently following a Youtube tutorial (you can skip the first half part): Yes, this is the part 2 but I have no issue with the part...
  3. Osoy

    Question - IDE Code Formatting

    Hi, I have searched through keybindings looking for a key combination that would auto format code similar to CTRL+K + CTRL+D in Visual Studio. Is there such an option and if not is it on the road map for a future enhancement? Thanks.
  4. Epicrex

    GML How does the updated SCRIPT sytsem work?

    I was doing this thing from an older video and noticed that since then scripts have been reworked. How would I do this with the new(2 months old) script system?
  5. D

    SOLVED Text when creating a script

    When creating any new script, this text always appears. // Script assets have changed for v2.3.0 see // "yoyo link" for more information How to remove it so that it does not appear when creating a script? It's very annoying every time
  6. Kyrieru

    GMS 2.3+ Script changes in latest build?

    I'm getting errors in the latest build (that did not occur yesterday in the last 2.3 version). If I start the game with an empty room, an object throws an error saying that a script is referring to an object that doesn't exist. Did something about scripts change? For example if the script says...
  7. KakuniProject

    Please help, no able to create scripts

    Hello everyone, I'm quite new to game maker and into programming. I recently started a game and I'm on the first steps creating the collisions and movements, the collisions it was working fine when I inserted into step/Object, however now I tried to add into a script . I simply copied and pasted...
  8. UberhenriK

    SOLVED ds_grid_height argument 1 incorrect type (undefined) expecting a Number (YYGI32)

    Hello, I've created an inventory ds_grid for my game and a script that must get ds_grid as an argument, but it gives me an error: ds_grid_height argument 1 incorrect type (undefined) expecting a Number (YYGI32) at gml_GlobalScript_AddItem (line 18) - for (i = 0; i <...
  9. Arilyn

    Variable <unknown_object>.instance_create() not set before reading it.

    Hello, I'm pretty new to game maker but I've messed around with Unity a lot in the past. I've hit a roadblock and haven't been able to figure out why I'm getting errors despite researching and reading the documentation, but it's probably because I don't quite understand how GML and scripts...
  10. DevilKap

    SOLVED ScriptExecuteArray new errors?

    /// @function ScriptExecuteArray(_func, _args); /// @returns any /// @param {function} _func The function to run /// @param {arguments} _args[] The arguments needed function ScriptExecuteArray(_func, _args) { var _func = argument0; var _args = argument1; switch...
  11. G

    what's wrong with my daily reward system?

    hello everyone!! so, i tried to make a daily reward system where if the gets 1000000 points daily once a day when the game starts and notice the day changed here is my code in load game script: function scr_loadgame(){ if (file_exists("User.sav")) { ini_open("User.sav") global.date =...
  12. Epicrex

    Windows Script suggestions don't work.

    The red bar at the bottom should say "ScreenShake(Magnitude,Frames)" as a suggestion. I closed and reopend the script and GML, but that didn't help.
  13. W

    Can't assign a return to a variable

    I made (borrowed) a script for drawing buttons to gui and it works perfectly, except I cannot seem to assign a variable to the returned value. Here is the script: /// @function draw_gui_button_sprite(sprite, index, x, y, width, height, main_view); /// @param {index} sprite The sprite to...
  14. erayzesen

    Simple Raycast Script

    Hi all. I released a raycast code to use your any projects; Note: It support Game Maker Studio v2.3 and new versions; Check it out: (with online demo): https://erayzesen.itch.io/simple-raycast The method; var...
  15. FrostyCat

    GMS 2.3+ IMPORTANT!!! GM 2.3 Users Please Read! Improper script usage generates undefined variable errors

    Symptoms to Look For Expand for screenshot: The error is in the Create Event for object <undefined>. The subject is <unknown object> with a variable name that's either built-in or known to be already declared. The stack trace shows the source as something starting with gml_GlobalScript. For...
  16. O

    Enemies are not working

    I'm watching Heartbeast's tutorial on eme,y states and I type in the code he typed, but the game keeps crashing every time I get near an enemy Code for the enemy wander state ///scr_enemy_wander_state() scr_check_for_player(); phy_position_x += sign(targetx - x) * spd; phy_position_y +=...
  17. W

    Can I draw_sprite from a script?

    Can I draw a sprite from within a script? I can't seem to get it to work. I know the script is running because I can get the messagebox to pop up. e.g ///@description Makes sprite hover on cursor for placement ///@arg sprite var sprite = argument0; var xx = mouse_x; var yy = mouse_y...
  18. gkri

    GML Advanced resolution manager (very mobile friendly)

    I wrote this (hopefully) handy script and I would love to share it with this wonderful community. The scripts has two primary uses: To help developers handling multi-resolution easier. To offer to mobile developers a couple of quality of life features. This script is heavily based on the...
  19. chabi

    GMS 2.3+ Convert script to GMS 2.3+ script

    How can i write and convert old script to gms 2.3+
  20. E

    GMS 2 GMS2 acceleration_to_point

    Alright, here's something I thought could be extremely useful IF I could ever figure out how to make it. A piece of code where an object moves from one point to another smoothly without just jumping to the co-ordinates. This is the base I'm working with. Any ideas on how to continue this? (I'm...
Top