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

GML Display a lot of different strings using only one obj

Discussion in 'Programming' started by ArtCode, Sep 14, 2017.

Tags:
  1. ArtCode

    ArtCode Member

    Joined:
    Aug 10, 2017
    Posts:
    20
    Hello!
    I'm making a little survival/adventure game and I think I will need to display a lot of different phrases... they will be displayed when the player TRIGGERS a certain position or moment. But I dont want to create a lot of objects for evey string I need to display.
    What is easiest and efficient way to do that?
    I thought something like to create a SCRIPT with one ARGUMENT, and everytime when the player does something I will pass different arguments to the script to display the STRING with the right ID...
    Thanks in advance! :)
     
  2. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,470
    Create a single object, that displays text as you trigger it.
    Give it a variable "text" which holds the strong to display.

    In the room editor, place thwart object everywhere you need a trigger, and change the text variables using the creation code.

    That way you can have multiple different text instances, each with their own text, but with only one object
     
    ArtCode likes this.

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