create event

  1. flyinian

    SOLVED Could I just throw a script with the variables I need for an object in its create event and it'll work? Obviously?

    I'm currently using variable definitions but, it doesn't have the functionality that I'd like so, I'm looking for an alternate besides the obvious "write variable in create event per object". Any potential problems I may face doing this method? Thanks.
  2. JasrielKraftuur

    SOLVED Calling a variable in a Create Event that is initialized in a Game Start event

    Hi! I'm pretty new to gamemaker, been using it for about a month. I'm trying to make this house have it's message change depending on whether or not you have a key in your inventory. I have this in it's create event: //How close you are to the player lookRange = 100; //If you don't have the...
  3. K

    GMS 2 Access Room Editor Creation Code of Instance

    Like the title says, is there a way to access (i.e. run) an instance's room editor creation code? If I want to reset an object, I can do event_perform(ev_create, 0), but this does not take into account any code written in the room editor. Thanks!
  4. FoxyOfJungle

    GMS 2.3+ Update variable in step event without initialize it in the create event?

    It seems a little strange, but let's say I don't want to initialize a variable in the create event and just use the Draw event, is there any way to make that variable change without being started? I managed to do something like this: if !variable_instance_exists(object_index, "variable") var...
  5. A

    SOLVED Array out of bounds error

    got the error while executing my code for my card game code error: ___________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Step Event0 for object obj_deck: Push :: Execution...
  6. MartinK12

    GML What solutions do you have to sort instance creation order (initialize vars in create) for instances placed in room editor? - 6 solutions so far :)

    I know how creation/execution order works in GMS, at least I think so ;) I’m looking for how to create my own solutions to sorting - the problem is with creation code of instances placed in the room and dependent on each other variables - for example obj_tree need to setup in its create event...
  7. Lightning Gravity

    GMS 2 Most Important Multiple Step Event Per GML Object Amount

    Okay nevermind. I have just relies your own gml Scripting interface can still add onto your own gml Step Event coding part. As if you by accidentally have done your own Step Event coding part without your own gml Scripting interface coding part, you could of have done the way too much...
  8. F

    How to override parent create event

    So very simple issue thats more of a coding pet peve than anything. Basically the parent of an object has creation code that is semi long and nothing needs to be changed except for a few variables. So when the child has a create event with "event inherited" even when the code after sets the...
  9. F

    Legacy GM (SOLVED) Quick query with regards to object parents?

    Hi Everyone! I was planning out some objects in a project --and planning some parental hierarchies--and stumbled across a query I have never got to the bottom of: When it comes to parents, children, and inhereted code/events, do parents or children 'overwrite' certain blocks of code or events...
  10. J

    Error after updating

    Hi Everyone, I recently updated to v 2.2.2.413 (Desktop edition) from version 2.1.5.322 (Ultimate Edition) and I am getting this error whenever I compile my project: _________________________________________...
  11. M

    [solved]how do i make all variables return to their initial state?

    i want a script to make all vars of a single object return to what they were in the create event, but with some exceptions like HP, if there is a way to do that without making all variables go to their original state one by one pls tell me
  12. S

    Create Event launched twice

    Sooooo I have a weird bug in Game Maker 8.1 where my create event gets initiated twice (I checked, there was only one instance of said object in the room) Anyone would have any idea as to how or why would it occur? I can give additional details about this problem if needed!
  13. G

    Camera Object Won't Read Variables (SOLVED)

    (TL;DR version - I'm having trouble with the codes shown in the image. The game acts like the "view_w_half" and "view_h_half" variables don't exist on the step event page, and only uses the data they stand for if I put the data itself into that place)...
  14. Furkan Karabudak

    GMS 2 When I change the window size, I see "surface isn't found" error, or surface resets

    I'm working on a drawing program. If I create a surface in create event then I get an error about "surface not found" when I resize the window. If I create the surface in draw event, when I resize the window the surface is automatically aligned to that size and I am not getting an error, but the...
  15. Nathan Laing

    Legacy GM [SOLVED] Using alarms as alternative create events

    Greetings, In specific circumstances, I've been using alarms as alternative create events. The circumstances being that I require object A to create object B and object B must do some calculations in the create event with variables specified by object A. However, the create event for object B...
  16. S

    Legacy GM Instance variable either was never set or became unset during runtim

    I have an object that works like this: Object Name: obj_Floor Create: color = 0; Collision With obj_SomethingElse: color = 0; Collision With obj_Player: if (!global.some_global_var && color == 0) { /* do some stuff */' } My room is just a bunch of these obj_Floor objects arranged in a...
  17. S

    GMS 2 [SOLVED] Create Event Function Updates

    When I put something like this into the Create event of an object: { var j; var toughnesshp = 5.00; var toughnessiteration = 0.00; for (j = 0; j < playerToughness; j ++) { toughnessiteration = toughnessiteration + toughnesshp; if playerToughness >= 20 { if...
  18. R

    GMS 2 create event running multiple times

    hey, I have noticed that in one of my object the data is constantly being reset after some bug testing(very long and painful) and even re-writing my whole code again, I found out that the create event is run multiple times. I have no idea how this can be. I tested the other objects in my game...
  19. E

    Order of script execution with instance_create and the 'create' event

    As the title suggests, I am using a script to create an instance in my game world, and that instance places a few more instances during its 'create' event. I am now puzzled by the order of execution, and here's why. After the initial script creates the instance (obj_Pattern), it continues by...
  20. Zhanghua

    GML How to pass arguments when create instance

    As the title said, How to pass arguments when create instance. I realize that by changing the argument after object-creating, and trigger the intial method in first step. But I want to realize this much more gracefully.... Is there any way to gotcha? Thanks a lot!
Top