scripts

  1. P

    Accurate future location shot finder

    I was trying to buid something that predicts where it should shoot to hit the enemy, i have tried using a simple script that looked like this var i = instance_nearest; var di = point_direction(x,y,i.x,i.y); var dist = point_distance(x,y,i.x,i.y); time = dist/bulletspeed; alpha = i.direction -...
  2. josyanf1

    GMS 2.3+ [SOLVED] Error in arguments for scripts

    Hello! I have noticed argument errors on some of my scripts. Is it possible that it is because of the way the parameters are commented? What is the right way? A greeting and thanks in advance! *This is a example script *And this the argument error:
  3. Z

    GMS 2.3+ Script function not defined before object create event

    Hi all. The documentation and looking up on the forums suggest that if using the new style functions and structs etc within scripts they should be available before the create method of an object., but I am finding after many tests the scripts are always too late to the party. To re-create, make...
  4. M

    GMS 2.3+ Animation end on a script?

    Hello im making a 2D platformer game (a Mario clone to be exact) and use scripts to make the player move, change sprite etc. I have a variable named powerUp that changes from 0 to 1 when i pick up a power up item/entity. When powerUp variable is set to 1 and the player hasn't got a power up...
  5. B

    GMS 2 Scripts drawing surfaces, memory leak.

    So originally I've got 16 sets of this code block messily creating a surface each all within a single draw event; since they're all similar blocks I decided to figure out scripts and tidy it up since the variables are easy enough. I translated it directly into a script with no changes in logic...
  6. M

    Question - D&D Scripts keep disappearing

    Hello everyone, Huge newbie here, literally just started today so please, talk to me like I'm stupid so I understand :D I've been following Slyddar's tutorials on Youtube to make a game on GameMaker and, at some point, it is recommended to cut/paste your lines of code you've written in your...
  7. D

    Is it possible to use scripts in a way that they are not scoped to the object that calls them?

    Hey, it's my understanding that scripts are more or less scoped to the objects that call them, meaning that you can directly use instance variables in the scripts which are assigned in the calling object. Is it possible to use scripts in a way where this isn't the case? I'm fairly new to GMS...
  8. 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...
  9. P

    GMS 2.3+ Arguments aren't shown in the Constructor Function

    I don't know if it should be this way, but if it does than it's just really bad and disgusting. I've tried to develop attacks for AI mobs in my game using new Structs, and this is the code I've ended up with(please let me know if there are any other problems except for the one I will explain...
  10. ZacKow264

    SOLVED Variables no longer coloured or showing up in Code Completion

    There should be an image attached to show what I mean. Instance variables, local variables, and custom scripts no longer show up for me in their assigned colours. And yes, I checked my preferences, and nothing has changed there. Additionally, none of those show up in Code Completion either...
  11. William Garrison

    GMS 2 Cleaning up my Dialog to a script

    I have the dialog system working. I couldnt be more excited. I know its trivial to most, but I am awful at this. Anyways... In my step event I have this... (next is a variable that is defining what txt[] I am currently on) sc_cs_dialogStart(); txt[0] = "Im the Player"; txt[1] = "Im the second...
  12. D

    Best practice for state-based game design?

    Working on a strategy game. Right now, what I've got is only nominally state-based. There's an "initializing state" that lasts a few frames at most upon startup, and then you're thrown right into a gameplay demo (just able to move units around really). Obviously I'm gonna want menus to select...
  13. 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...
  14. G#m_Player2

    GMS 2 Problems with Melee Attack after killing enemy and enemy (2)

    Hello GameMaker Community, I recently have a problem in my melee attacks. I watched Shaun spalding's melee attack tutorial together with my other knowledge with his other videos about attacking enemies and parent objects but I may still have a lack of coding knowledge and I want to learn more...
  15. flyinian

    SOLVED Would this be 1 or more than 1 script?

    I've been learning how scripts work and was wondering if the below code can be placed into one script or i will need multiple scripts for it to work. My guess, I need multiple scripts. if (Requirements_Met == true && Allow_Leveling) { if(Current_Experience < Next_Experience) {// If...
  16. TomOmNom

    GMS 2.3+ HELP! Looping through arguments and checking them against each other

    New to GM, sorry. I'm trying to make a script that can take all arguments, put them into keyboard_check functions, and see if they are all being pressed. I'm not sure how to check if all of them are being pressed. So far I got for(i = 0; i < argument_count; i++) { if...
  17. danielpancake

    Free gmdungeon - a dungeon template creating asset for GM:S

    gmdungeon is a dungeon template creating asset that can be used in any kind of project requiring dungeon generator. It's easy to use 👆 Download and examples: github Price: Free Installation proccess For GameMaker: Studio 1.4 Drag all scripts from src/scripts folder into your open game maker...
  18. EvanSki

    SOLVED Can scripts have children?

    If a mommy and daddy script love each other very much- no. I want to know if i could make a script act as a parent and have another be a child of that parent script and inherit code. in other languages you could just call that script for a different one or like papyrus you can just have a...
  19. JapanGamer29

    GML Need help with script name as variable

    Hi guys. This is a simplified version of what I'm trying to do: var menu = "audio" var save_script = "scr_" + menu + "_set_and_save" script_execute(save_script) But I get this error because save_script is a string: (null) argument 1 incorrect type (string) expecting a Number (YYGI32)...
  20. 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...
Top