I read the manual thiny, and I dont get this buffer text thingy
Author | Topic: I read the manual thiny, and I dont get this buffer text thingy |
---|---|
Shock Trooper
Member # 3276
|
written Thursday, July 22 2004 16:42
Profile
whats the use of buffer text when I have print_str_color code? Can someone explain to me how to use this please. Posts: 249 | Registered: Saturday, July 26 2003 07:00 |
Agent
Member # 2820
|
written Thursday, July 22 2004 17:09
Profile
What kind of code can you put into print_str_color()? You can either put a single literal ("Hi everybody!"), or a string CONSTANT, but not both. You can't append anything to the constant, and the literal must be given in its entirety. There is no flexibility in this regard, but the buffer calls can at least allow you to append a mix of strings and numbers together, and then you can dump the buffer into a string, which is the only time when you can change the string constant. [ Thursday, July 22, 2004 17:10: Message edited by: Keep ] -------------------- Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are. ==== Alorael: War and violence would end if we all had each other's babies! ==== Drakefyre: Those are hideous mangos. Posts: 1415 | Registered: Thursday, March 27 2003 08:00 |
Shock Trooper
Member # 3276
|
written Thursday, July 22 2004 17:13
Profile
quote:Okay, HOW do I do that? I don't understand how to use the buffer. Posts: 249 | Registered: Saturday, July 26 2003 07:00 |
Apprentice
Member # 4656
|
written Thursday, July 22 2004 18:50
Profile
Did you read the section in the appendix on string manipulation? It's pretty self-explanatory. Basically the text buffer just gives you a way to do some really nifty things with string variables to customize text output. For instance, you could do something like this: So the final result is, if the player has a slith named Ssschah in his party, the text the player sees in the dialog will now read: "I don't deal with sliths." Bob frowns at Ssschah. "And that includes you." In this example, we've used the text buffer to "build" a custom chunk of text using a literal and a constant, which is something that would be impossible to do without the string manipulation calls and the text buffer. [ Thursday, July 22, 2004 18:58: Message edited by: 20eyes ] -------------------- I ain't no ******* son of a *****. You better think about it, baby. Posts: 29 | Registered: Saturday, July 3 2004 07:00 |
Shock Trooper
Member # 3276
|
written Friday, July 23 2004 06:05
Profile
Okay, I get it now. Thanks. EDIT: I think. EDIT: The variables were short char_number; string char_addressed; Can I uas any string variable or any interger variable or does it have to be those [ Friday, July 23, 2004 06:07: Message edited by: GIFTSare2cudly ] Posts: 249 | Registered: Saturday, July 26 2003 07:00 |
Agent
Member # 2820
|
written Friday, July 23 2004 06:27
Profile
Any declared string variable is fine. -------------------- Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are. ==== Alorael: War and violence would end if we all had each other's babies! ==== Drakefyre: Those are hideous mangos. Posts: 1415 | Registered: Thursday, March 27 2003 08:00 |
Apprentice
Member # 4656
|
written Friday, July 23 2004 08:06
Profile
Right, short char_number = 0; string char_addressed; are just the ones I chose for the example. You can call them anything you like. -------------------- I ain't no ******* son of a *****. You better think about it, baby. Posts: 29 | Registered: Saturday, July 3 2004 07:00 |