Scripts / Confirmation on T e x t?

Author
Message
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 19th Jun 2019 22:37
Hey there... so I've never yet used a text call in GG yet.
Well, except to show text on screen with TextCenterOnX... etc.
Any pointers on assigning variables to text-- what would really
come in handy is if this where possible text(a) = "Label A"
text(b) = "Label B", etc, etc where a and b represent numbers,
that change throughout the script. So is this possible...
TextCenterOnX (Variable[e]) ...? I am not trying to print a number,
but a text string that is held by a number variable... Thanks.

Let's simplify this question... Can I assign a number (Roomd[e]) = "Room D"
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Jun 2019 23:01
Yes, you can assign anything you like to a list.

So:

Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 20th Jun 2019 03:42
I think I broke GG, it froze up when trying to do this.
Since I'm using a local number variable to reference a text field,
would this be valid...?

This number changes in the script according to players location.
So I guess I need an array, is that the same as a list?

In one location, num[e] = 1, in another num[e] = 2, etc
So how to use room[e,num[e]] to relate to multiple text names without
doing the "If room[e] == 1 then... text= "..."/ If room[e] == 2 then text= "..."?

I used this exact technique....
local a = {}
a[e] = 3
room[3] = "Parlor"
Text ("You are the "..room[a[e]]..)

But not thinking that's valid??
or must they remain global; room[num]?

No reference to locals used in lua arrays online that I could find.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Jun 2019 10:00
You need to put position data for the text and also no .. at the end, that's to join data together
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 20th Jun 2019 10:31 Edited at: 20th Jun 2019 10:31
If you want a list of text strings:



And if you want them available to all scripts you could add a global function:

( note the protective coding!)
Then you can do:
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 20th Jun 2019 17:18
Thanks. That's good info, and will be placed in my notes!!

But, hmmm... that's kinda hard because it's imperative (at least
for my inexperienced knowledge) that I keep this number local.
I think though that I have a work- around. It probably won't be
too hard to come up with a segment localized line to show text.
IE I'll move it from the main area to an independent ... ? I hope!

PM

Login to post a reply

Server time is: 2024-04-27 02:20:32
Your offset time is: 2024-04-27 02:20:32