Lots of text

You must understand the Game Editor concepts, before post here.

Lots of text

Postby MonteyPython » Sat May 30, 2009 9:57 pm

Im my game, there is a lot of talking with text, and i was wondering if there was a way to make the same actor change text instead of having a bunch of actors saying every different thing.
Anyone's help would be appreciated :mrgreen:
MonteyPython
 
Posts: 24
Joined: Tue Apr 21, 2009 6:15 pm
Score: 0 Give a positive score

Re: Lots of text

Postby skydereign » Sun May 31, 2009 12:12 am

Yes, you can change the text with strcpy. The actor name for actor, and you can either use a char* which is a string, or you can insert directly what you want, needs to be within double quotes if you do.
Code: Select all
strcpy(actor.text, "text goes here or a char*");
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Lots of text

Postby MonteyPython » Sun May 31, 2009 12:48 am

two questions. 1. Where does this script go and 2. Can i pick which font to use?
MonteyPython
 
Posts: 24
Joined: Tue Apr 21, 2009 6:15 pm
Score: 0 Give a positive score

Re: Lots of text

Postby skydereign » Sun May 31, 2009 12:52 am

No, I think the only font you can have is the font of the text actor. I could be wrong, but I don't think so... That script would go in the event that changes the text, if a keydown would do so, you might have a conditional, and inside would be the strcpy, because what it is doing is copying whatever is in the latter part to the text of your actor.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Lots of text

Postby MonteyPython » Sun May 31, 2009 6:05 am

well, i'm putting the code into the keydown event, but it doesn't let me add the event.
MonteyPython
 
Posts: 24
Joined: Tue Apr 21, 2009 6:15 pm
Score: 0 Give a positive score

Re: Lots of text

Postby skydereign » Sun May 31, 2009 8:13 am

Works fine for me. Here is a .ged of it working.
Attachments
strcpy.zip
(17.26 KiB) Downloaded 120 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Lots of text

Postby MonteyPython » Mon Jun 01, 2009 4:57 am

Ok cool. it works now. Thanks :mrgreen:
MonteyPython
 
Posts: 24
Joined: Tue Apr 21, 2009 6:15 pm
Score: 0 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest