script calling

  1. H

    SOLVED Script being mistaken as a variable (?) and its code not appearing in the debugger, possibly because of states

    I'm new to GameMaker so I likely don't know much of the terminology, sorry! In the game I'm making, furniture flies across a room (up, down, left or right) and if it hits the player, they lose health. There's a brief window of time before a piece of furniture flies across the room, during which...
  2. David Lorenz

    GML How to deal with ID variable used in a script, that is called from a script and not an object?

    Hello, everyone! I made various custom scripts to build a cutscene system, and they all work perfectly. The problem is that some of these scripts use the id variable, and therefore give an error when called from another script instead of an object. When calling the cutscene scripts from another...
  3. David Lorenz

    SOLVED Executing a Script passing variables that could be not-set

    Hello, everyone! I have a script that creates a textbox object that uses the variables contained in the instances the player interacts with. /// Player's Step Event if press_spacebar = true { var speaker = collision_circle(x,y,radius,false,false) if speaker = parent_npc {...
  4. 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...
  5. B

    Error Message when attempting room fade transitions

    Hi everyone. I've read the manual and am as yet unable to figure out the issue. I have also tried defining the script as a function to no avail. I'm attempting to set up screen transitions via an object controller that uses a script. The script I'm using is called 'fade1'. I'm a first time...
  6. E

    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.
  7. C

    SOLVED I cant get the choose function to work?

    When i press the mouse button it uses both of my choose values and not just one. I am trying to call scripts step event: if mouse_check_button_pressed(mb_left) { choose(scrattack1(),scrattack2()); }
  8. M

    GML Script Return don't work

    I've try to make a simple script that simply increment a number that we pass in the argument. In my object i call this script function every step and the variable is crate in the create section and not in the step section. this is my code, the resoult in the console isn't increment and simply...
  9. Akhos

    Question regarding Object Order and script_execute in GMS 2.3

    (I'm not currently in the beta so I thought I'd pose the question here, hopefully someone can help me before the official release!) So in my current project (a fighting game), I have the ability to save replays and play them back. I have a fast forward feature that lets you play through the...
  10. Daniel Mallett

    GameMaker Send variable 'link' to script

    Is it possible to send a variable to a script for direct writing? I don't mean send the value, modify the value, return the value. I mean send the script something so it knows what variable to update. In other words I want a script to do something based on the values it has been given and...
  11. E

    Legacy GM issue calling script

    hey yall, i don't know if im doing this right but when i want to call my script it gives me a malformed if statement. heres the code below. Whats suppose to happen is when i press enter i want the script to open and replace the other one. SCR_BMENU ///placeholder switch (mpos) { case 0: {//...
  12. P

    Script executes for a couple of seconds and then stops [SOLVED]

    This code is the idle animation of my character when he isn't moving it wil execute this code but after a while the arm_move_down script wont be executed anymore. if (xmove == 0 && vsp == 0) { sprite_index = player_idle_sp; image_speed = 0.05; if (floor(image_index)+1 ==...
  13. P

    GameMaker Phantom Step Event or Script Trigger - help! [SOLVED]

    Hello! It's pleasure to be a part of the GMC. I'm new to GMS2 but am familiar with game design and programming in general. I'm running into a strange problem I was hoping to get some help on from some of the GMS vets out there. TL;DR Basically the issue is there is a specific script that is...
  14. Erik Leppen

    GML vertex_begin and vertex_end: how are they best used?

    I want to create a set of scripts to draw vertex primitives more easily. So, I want to create a vertex buffer and then call some scripts to put shapes in them. So the idea is: Event code: //create vertex buffer //call script to add positions, colours etc. //call script to add positions, colours...
  15. D

    Legacy GM trying to index a variable which is not an array error

    Hi guys, i'm trying to make a script which stes the tiles of a block of wall based on the sprites stored in its array, but somehow when i call this function on the object the compiler tells me that i' m "trying to index a variable which is not an array". Each block of wall is built at the...
  16. C

    [SOLVED]Wander behavior script

    Hi all! I got a little problem, I got a wander behavior script that if I call it in the step event of my monster doesn't work. If i do the same code (the whole script) in the step event of my monster it's work fine! The timer var doesnt go down in my script one know why ? Here' is my script...
  17. P

    GML Emulating function wrappers/generators or context managers.

    draw_set_alpha(...); ... draw_set_alpha(1); ini_open(...); ... ini_close(); surface_set_target(...); ... surface_reset_target(); I find myself repeating patterns like those above quite often and find it odd that GML does not provide some utility to prevent this sort of repetition when plenty...
  18. B

    How to advance from one script to the next?

    Hello, I'm working on a visual novel engine. The game has an array of strings that display one at a time for the first scene. What I want to do next is, when the text in one array has all been read, advance the script containing the strings to the next script. The purpose for this is to better...
  19. C

    Legacy GM Strange Script Argument Error

    Hey guys, I added a script to my project and called it in my player object. It gives the oddest error when I try to run the game. I haven't seen this error before and I'm wondering if anyone knows what's causing it. The Error Message: In Object obj_player, in Event StepEndEvent action number...
  20. D

    GML Calling variables from script caller

    In a script, is it possible to get the values of local variables of the instance that called the script?
Top