In Game Text

Game Editor comments and discussion.

In Game Text

Postby GuybrushThreepwood » Tue May 11, 2010 3:15 am

Is there a way to change the text of a text actor without making a new actor? And also, how can you make the game choose a certain line of text at random from a whole list of pre-made texts every time you press a button? If anyone could help, it would be greatly appreciated :mrgreen:
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: In Game Text

Postby Hblade » Tue May 11, 2010 11:47 am

There's many ways ^.^

1, is to use the set text command (without coding) 2 is coding You can use t he following :3
Code: Select all
sprintf(text, "Text here");

In sprintf you can also call the ammounts of variables by doing this
Code: Select all
sprintf(text, "Hello %d %s %i", x, text_variable, integer);

Replace x, text_var, and integer with the names of the variables your using. %d calls uh... just like %i really, it gives you the value of the variable.

%s gives you the value of a text variable so if you hav e your player customizable name, %s will call his name after the word "Hello" according to the sprintf command :D



The other commands you can use are:
    strcpy
    strcat
strcpy is used just like sprintf, but I'm not sure if strcpy can use the %d, s, and i and stuff like that.
strcat appends text to the current text you already have. For example if your text says "Hello", use
Code: Select all
strcat(text, "My name is bob");

And then it'll say "Hello my name is bob".

Hope this helped :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: In Game Text

Postby GuybrushThreepwood » Tue May 11, 2010 9:23 pm

I'm uh... not really good at scripting, so I barely know what your talking about :oops:
I get the changing the text with the set text thing, but I don't get the picking the random line of text from like 40 different ones part. And also, I should have mentioned earlier, I want the used line of text to be destroyed after it's use. How would I do that?
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: In Game Text

Postby Hblade » Tue May 11, 2010 9:32 pm

Not sure thats even possible, sorry :o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: In Game Text

Postby GuybrushThreepwood » Wed May 12, 2010 5:41 am

Well then how about just picking one of 5 texts at random>
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: In Game Text

Postby Hblade » Wed May 12, 2010 11:30 am

I dont think GE supports selecting characters from a text actor yet. Perhaps in the new version, sorry :o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: In Game Text

Postby GuybrushThreepwood » Wed May 12, 2010 10:13 pm

Thats OK, thanks anyway :mrgreen:

EDIT: I maybe need to reword my question, I don't mean making up its own text, but randomly selecting a couple of text actor's I've already made and bringing them to a certain spot or something like that
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: In Game Text

Postby Hblade » Thu May 13, 2010 1:21 pm

Oh I think I know what you mean :D Yeah use the MoveTo function for that ^.^
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest