GM:S 1.4 Changing value of ds_grid's (help me)

Discussion in 'Programming' started by kerim, Jun 9, 2019.

  1. kerim

    kerim Member

    Joined:
    Aug 10, 2018
    Posts:
    28
    Create event;
    tiled = ds_grid_create(100, 50);

    tiled[# 1, 2] = 2;
    this only works in create event, when i put it like mouse button events or networking event it doesn't work and cell's value stays at 0.
     
  2. NightFrost

    NightFrost Member

    Joined:
    Jun 24, 2016
    Posts:
    1,785
    That's not much to go on. The problem could be A) your event is not executing properly for some reason, B) event runs but due to incorrectly written code (ie conditionals) the event is not setting the grid, C) event code works but your test is written wrong, D) test works but is looking at wrong target, E) other code is interfering and setting the value back to zero before you test it, or F) something else.
     
  3. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,118
    The mouse button event only runs when the mouse coordinates are overlapping the instance's mask coordinates.
    The networking event only runs if a network message is received.
     
  4. kerim

    kerim Member

    Joined:
    Aug 10, 2018
    Posts:
    28
    then prob the "E", because everything else looks fine.
    gonna try in a new project
     

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