1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

can i ref this in script?

Discussion in 'Programming' started by tonywarriner, Dec 4, 2019.

  1. tonywarriner

    tonywarriner Member

    Joined:
    Nov 2, 2019
    Posts:
    10
    :)
     

    Attached Files:

  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,699
    Yes, like this:
    Code:
    inst_2056D1A7.x = room_width/2;
    Or more generally, anywhere that takes an instance ID.

    In actual practice, you'd probably want to rename that to something more intelligible before doing this.
     
  3. Gizmo199

    Gizmo199 Member

    Joined:
    Jul 3, 2016
    Posts:
    45
    yes and you can also re name it per room if you wanted to reference it for a specific room. Just remember if you rename the instance-id to "player" in say room0 it won't let you also rename the instance-id of it to "player" in room1
     
  4. tonywarriner

    tonywarriner Member

    Joined:
    Nov 2, 2019
    Posts:
    10
    Thanks. And can I read it? For example, if I wanted, for any given object, to read that name and render it out on screen for debug purposes, for example...?
     
  5. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,133
    No. They're essentially just macros you create for instances added to the room. Unlike resource names, GM doesn't save instance names to the code.
     
  6. tonywarriner

    tonywarriner Member

    Joined:
    Nov 2, 2019
    Posts:
    10
    Ok, understood. Thanks for the replies... :)
     

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