GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Random text and tables

imjustmikeimjustmike Posts: 450Member
edited August 2012 in Working with GS (Mac)
Hi all,

I've been playing with tables and displaying text recently and wondered if someone could answer a question I haven't been able to answer my self.

Essentially, I want to be able display stock phrases (saved in a table) that include a saved attribute (potentially in a different table).

A simple use case would be a character in a game giving a dialogue box that had the player's name. That's simple enough. BUT what I want to do is have the ability to select a random phrase from the table, and then input the attribute (to add a bit of variety to the game, I don't want the exact same dialogue showing with each interaction). Because each phrase will be structured differently, the attribute won't be in the same place each time so I'm struggling to work out if this is possible with the expression editor + tables + display text.

Example use case:

Player reaches a character in game which could prompt (randomly selected) one of 3 phrases:

1. Hello PLAYERNAME, welcome to the city.
2. PLAYERNAME, you've reached the city.
3. Welcome the the city, PLAYERNAME.

The attribute is the same in every example, but it's position in the phrase is different each time.

Is there any simple way to set this up?

Ideally the solution would be to able to place the attribute in the table - literally having the above phrases in the table, but from what I can gather this isn't possible.

Does anyone have any pointers?

Best Answer

Answers

Sign In or Register to comment.