Mass controlling instances

Discussion in 'Programming' started by 66Gramms, Aug 23, 2017.

  1. 66Gramms

    66Gramms Member

    Feb 2, 2017
    So i'm making a level select screen where will be 90 levels but always 30 of them on display... (actually there are 30 instances) So i make the instances in a cycle and there i do it like this:
    instance = instance_create(x, y, obj_level_select);
    instance.level += rise //Level is a variable inside the object that is used to display the lvl number
    So this way i have levels from 1 to 30 lined up perfectly. but when i want to "change page" in the game i actually just want to change the instances' level variable by +1/-1
    to do this all the instances should have different id. I know it could be done with an array but they told me there is a better way to do that. can you please help me about how to give all of them a different id and not all of them are going to be "instance" without using arrays?

    if i don't do this just type like obj_level_select.level++ then all the instances will change to the same value (2) then increase together. Thanks in advance

    Attached Files:

  2. TheouAegis

    TheouAegis Member

    Jul 3, 2016
    The reason this doesn't work


    is it counts as a read operation. It basically means


    So all instances are set based on the value of one.

    with obj_level_select level++

    Do that.
    66Gramms likes this.
  3. 66Gramms

    66Gramms Member

    Feb 2, 2017
    This is working, thank you ^^ I know why it didn't work i just didn't know how to make it work :D Also i realized i need to add 30 to them :D

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice