1. EvanSki

    SOLVED (Solved in 2.3.1) Need help on how to unpack an array to use as arguments in a function

    This is a job for big brains, mine is smooth so that is why me is ask for the big helps. Heres the walkthrough I get a script name and arguments for that script like so [scr_scriptname] [argument_array_here] The first set of brackets hold the script name in a string that is converted to the...
  2. Artist Guru Entertainment

    A question regarding a Syntax Error

    Hello, YoYo community i am brand new to the community and at the moment i am having an issue with a line of code from my custom script called addItem as it stands the syntax error i keep getting is Obj_PickUp Collision Event With Obj_Test_Plyr at line 4, 95 : number of arguments for function...
  3. 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...
  4. 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...
  5. G

    GMS 2 Using argument[0] Instead Of argument0 Causing Problems In Scripts

    For some reason when I use arguments with [] in this GML script, I get a an error message saying "Script: scr_check_proper_keywords at line 1 : no references to argument 0 but references arguments 1,2,3,4,5,6,7,8" However, when I use argument0 (the built-in constant) it works. Here is my...
  6. D

    GMS 2 [Solved] Optional arguments not working correctly

    [GameMaker Studio 2 version] I have made a script that uses optional arguments and it keeps giving me an error, Four arguments are supposed to be required, and two more optional. This is really baffling me because I have made other scripts with optional arguments that work perfectly...
  7. Fixer90

    GMS 2 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?
  8. C

    Menu system

    I am trying to create a system in which there are multiple scripts and an object that, when the object comes in contact with the player, a menu appears. I want the scripts arguments to be things like the number of things in the menu, the strings to be displayed, the font, etc. but I don't even...
  9. Pfap

    variable argument scripts

    I have been over the manual sections about scripts and passing arrays to scripts. Maybe I missed something, but I'm making this posting not because I'm having trouble finding a solution I already know of several work arounds. I'm making this posting, because I want to finally figure out how to...
  10. DarklinkFighter

    Question - D&D Custom Drag & Drop Functions with named Parameters possible?

    Hi, I currently try to create an easy to use RPG Framework for GMS2. For that I would like to make some scripts that I would be compatible with the Drag & Drop System so that beginners could also use it even if I am a programmer and would not use it myself... I noticed that calling GML/DND...
  11. Ido-f

    GML Getting number of arguments outside of a script?

    Is there a way to get the number of arguments a script expects without entering it and using argument_count? I'm working on a stack machine (mainly to execute scripts through different game steps without using alarms) and getting that information would help with handling the scripts arguments...
  12. S

    GMS 2 [SOLVED] Using 1D Array as an Argument in a Script

    How would I obtain values in a 1D Array provided to the script through an argument? like: argument[0][0] ? Or, would I assign argument[0] to a variable before reading the information in that array? like: var arrayArg = argument[0]; arrayArg[0] ?
  13. Cloaked Games

    GML [SOLVED] Passing Scripts/Macros Through as Arguments

    I am working on some scripts for terrain generation, and I have some functions which include arguments for a random chance of one instance changing into another instance. For example: "jen_change_change(obj_dirt, obj_sand, 50)" would turn 50% (about) of the dirt into sand. I was considering the...
  14. zendraw

    Legacy GM Q:Script & Arguments

    Hi, is it possible to use a various amount of arguments in a customly created script, like it is now in the instance_destroy(); function? i have a script i want to use for various situations but the number of arguments vary. usually when i put more or less arguments it gives an error, but i...
  15. L

    [SOLVED] Script Arguments Issue

    So you know when you use scripts and you might put in "argument0" to pass an argument through when you call the script. Well I tried doing something like this... //Normal code example = false; if (keyboard_check_pressed(vk_space)) { script_example(example) } //Code inside the script...
  16. A

    [SOLVED] Problem with argument_count

    Hi, Like what's written in the title, I have problem the function argument_count, I do not know how the argument_count function really works, when I put optional args I get this error message: So I need help to find the error: I have the script "scr_textbox": ///scr_text(str, speed, x, y...
  17. csanyk

    16 arguments limitation

    I am developing a script, and inside that script I am calling draw_sprite_ext(), which has a 9-arguments long parameter list. I need to pass these args into my script when I call it, and I also need to pass in some additional arguments as well. So I am going to need to be able to pass in >16...
  18. Shadowblitz16

    GMS 2 function to handle optional arguments?

    does anybody know if its possible to make a function call argument() that can be used with script mandatory arguments? maybe just a function for both? parameters could go like.. -argument index -optional?
  19. jana

    [SOLVED] Can function argument be compared to array element?

    I have a 2D array that I'm searching using a function. The array: global.list_rooms_bot_bomp[0,0] = rm_Level4; global.list_rooms_bot_bomp[0,1] = 1; global.list_rooms_bot_bomp[1,0] = rm_Level5; global.list_rooms_bot_bomp[1,1] = 2; etc. ... The function takes room and returns the corresponding...
  20. Alice

     script_execute_array and other callback improvements

    Generally, it's a bunch of suggestions that are supposed to enhance the callback functionality in GM. I don't know how feasible they are given the GML engine, but I think they're still worth mentioning. Probably the most important of these is script_execute_array(script,array) function, or...