GML Display a lot of different strings using only one obj

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

  1. ArtCode

    ArtCode Member

    Aug 10, 2017
    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

    Jun 21, 2016
    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