Game Development Community

Random Tip Changer

by Orion the Hunter · in Torque Game Builder · 08/24/2012 (2:46 pm) · 8 replies

Hello,

I was wondering if I could have a random tip changer like what in my two threads "Multiple imageMaps within a single animation" and "Sprites in a GUI."

However, the whole sprite thing seems like a real space hogger, so I would like to know if it could be done using a GuiMLTextCtrl, using the set text function. Thanks!

~AJPCEO

#1
08/29/2012 (10:46 am)
Zilch? Nothing? Never been attempted at all?
#2
08/29/2012 (6:38 pm)
Have you tried it yet yourself? I hate to be a boob but most people don't like helping unless you have already given a good stab at it. I can't help you simply because I have no/very little experience with the gui functionality yet.
#3
08/30/2012 (6:40 am)
Believe me, if I had physicaly stabbed the script file for it as many times as I attempted it, my computer would be riddled with holes. I've tried it many times, but I'm stumped on the random part.
#4
08/30/2012 (8:20 am)
Alpha-Kand you have an email? I'd like to talk to you. :)
#5
08/30/2012 (9:23 am)
@ Anonymous
So you got text to appear and that all working but you just don't know how to get that random thing to work? What I would do is have a script file set a bunch of global variable arrays with text in each one. To pick a random tip just select a random number and input the proper variable, something like this maybe:
%tips.setText($TIPLIST[getRandom(0,10)]);
I tested it myself and it worked pretty good.

@ Vlad
huntersmeadow@gmail.com should work.
#6
09/01/2012 (10:13 am)
Alright, good.

Now to get it to work would I just make multiple variables withe the name Tiplist? Wouldn't that confuse the game?
#7
09/01/2012 (4:57 pm)
$TIPLIST[0] = "I'm a little Teapot";
$TIPLIST[1] = "Short and Stout";
$TIPLIST[2] = "Here is my handle";
...
...
$TIPLIST[9] = "Tip me over and pour me out";
#8
09/01/2012 (8:24 pm)
Thanks! Nice choice of tips! ;)