1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. NOTICE: We will be applying a Xenforo update on Tuesday 25th of February. This means that from approximately 10:00 to 14:00 BST the forums will be offline (or possibly longer). Sorry for the inconvenience! Official Announcement here.

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,523
    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