• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

script calling

  1. 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.
  2. Coffeli

    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()); }
  3. MIkadini

    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...
  4. Akhos

    GMS 2.3+ 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...
  5. Daniel Mallett

    GMS 2 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...
  6. EZTALES

    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: {//...
  7. 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 ==...
  8. P

    GMS 2 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...
  9. 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...
  10. 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...
  11. Calyston00

    [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...
  12. 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...
  13. 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...
  14. 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...
  15. 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?
  16. P

    GMS 2 Weird script effects (SOLVED)

    Hi everyone, I have a weird effect that's happening on some of my scripts. Here's the first script: if (scr_craftingcheck(3, 5) = 1) { scr_item_drop(3); scr_item_pickup(6,1); } here's the second one: if (scr_craftingcheck(4, 1) = 1) { scr_item_drop(4); scr_item_pickup(5,1)...
  17. T

    Quick Optimization Question

    Hey, everyone! Quick question for those who are more knowledgeable/experienced. Is there a performance hit for calling a script rather than just running a given block of code in-line? I have found, in the course of working on my first game, that it is MUCH easier for me to keep code organized...
Top