var

  1. Christopher A. Orestis

    How do I find a particular object that contains a particular value

    something like this... if (obj.var < 3) { with (obj.var < 3) { obj.var += 1; } } //========================================================================== I want to make it so: if (a particular obj with the smallest value of var && that are less then a value of 3) { // code }...
  2. 2

    Is It Bug/Error: 2 Vars Same Name One Script Scope, Other Object Scope?

    If you use var to designate a variable is only being used in that script, but someone adds a variable with the same name to the same object (or a child object) that's visible to the rest of the object will there be any bugs? eg. possibly the script wrongly using the variable that's visible...
  3. NovemberTender

    SOLVED Adding to Y coordinates after row limit.

    So the intention that i have is: adding -100 to y value, every time the row limit is reached, currently i have var nmb = 3; var rowbonus = 0; if menu[p,i] < menu[p,nmb] { var nmb = +3; var rowbonus = -100; var...
  4. FrostyCat

    GMS 2.3+ IMPORTANT!!! GM 2.3 Users Please Read! Improper script usage generates undefined variable errors

    Symptoms to Look For Expand for screenshot: The error is in the Create Event for object <undefined>. The subject is <unknown object> with a variable name that's either built-in or known to be already declared. The stack trace shows the source as something starting with gml_GlobalScript. For...
  5. sinigrimi

    GMS 2 [solved]One more question

    This is a create event and when I run the compiler it says that room_type is not set. also if I directly insert a digit into the argument field, the code works. var room_type =5;//irandom(559); case"fixed": // if (up == true) and (bottom == false) and (left ==false) and...
  6. T

    Why var created in create event not being found in draw??

    I really searched and found no solution for this simple problem, i must be missing something simple... In the create event of my object im doing this: var hp = 10; Then in the draw event im trying to draw a bar with that var like draw_rectangle( -50, -40, 100/global.slime_max_hp*hp-50, -30...
  7. N

    Need Code Help

    Hello GMC, could anybody please help me with something. How do you create an object with variable set to that object say for example if the code below existed: key press Z instance_create_var(x,y,item,var1 = 0 | var2 = 0 | var3= 0) This is the best way I can think to explain it sorry :) Please...
  8. Atbit

    GML Stopwatch final result

    (In advance I apologize for mistakes in the text) I have a simple stopwatch for game, which is visible in game. The main problem is, that I can't understand how numbers of sec,min,hrs should be shown in another room with results after game completed. There are two stopwatch objects: one for in...
  9. jobjorgos

    Legacy GM is there a difference between 'var i = 0;' and 'i = 0;'

    Hey I have a very simple basic question. Is there a difference between var i = 0; and i = 0;
  10. F

    How to check if variable = to 1[SOLVED]

    i have a variable called havekey if this var is set to 1 then i want it to destroy an instance here is the code //open if havekey = 1; with (obj_door) { instance_destroy(); }
  11. F

    Legacy GM How to add to ds_list instance variable if variable exists?

    Hello I'm trying to save instance information to ds_list, and everything works well, but some problems with variables. I want to add variable only if exists and trying something like this: if !is_undefined(inst.hp) ds_list_add(list, inst.hp); I'm sure I'm wrong, but how to...
  12. balmut

    Legacy GM Partial Array name with variable

    Hi guys sorry to bother you all, I've been googling round for a solution to this but without any luck. What I'm trying to do is reduce the amount of code needed by using an array of values instead of several if statements. I have a couple different arrays with similar names (aType, bType...
  13. C

    Variable score issue ( with )

    Hi again. Coming from Ruby, Java, C#, C++, etc. I'm having a really hard time adapting to GMZ. I like the language for It's simplicity, but I can't get around some scoping problems. Here's the problem I've been having: local variable tower_hp(100003, -2147483648) not set before reading it...
  14. ZeDuval

    Asset - Extension Pointer *free*

    Pointer is highly conceptual - please only download and use it for testing- and playing-around-purposes in it's current state. However, I'm happy about feedback, bug reports and suggestions! Please use this thread in the GM:S Forum. Create pointer_vars for a whole new level of dynamic coding...
Top