![]() |
Strings
Ok I have been working diligently to create a Mailbox system for the Bravo Online playerhouses. I have EVERYTHING working great. But there is one thing I have come across which I knew would be a problem. So heres what I have come up with:
Suppose I have a message 30 characters long. Now lets say graal can only hold 10 per line in a say2. I can get how many lines I need by dividing 30 by 10. I get 3. Right? Right. Now this paragraph is in a string. How am I going to get a #b after every 10 characters for every line until maxlines (3) - 1. The last part is to keep an extra #b after the last line in a message. If this were a variable I could do it, but I do not operate well with strings. Anyone have an idea? |
Just loop through and insert them in before say2-ing it. I'm pretty sure that works now.
|
Quote:
|
so I gotta work with the strings before hand.
so NPC Code: I think this is how it should go but the problem is getting the #b into the string. I've been looking around and trying several different things but I can only think of setting a new string for every 10 chars. Inefficient I think. |
all in one string? use #e(startindex,length,string) for the previous part of the string being examined, and another for the end, then setstring string,#s(partstr1) #b #s(partstr2)
Ah, the power of strings... [Edit] Note: my syntax is probably wrong :\ |
v3 provides a few new options for this kind of thing, but currently #e is probably your best bet.
|
couldn't he use wraptext?
or am I missing something. |
Quote:
|
Ok so I'll just #e the token and add #b where needed. Thx!
|
Quote:
NPC Code: What he is looking for? This way it won't break up words? |
Wow thats working but its not breaking it up. That #b causes every word to be on a new line. I dunno if its something faulty withe code or what but perhaps because I am running the script serverside? Its a class.
|
Quote:
|
he copy and pasted, that's bad
|
Well since my other post disappeared. -.-
NPC Code:for (i=0;i<tokenscount;i++)setstring temp,#s(temp)#t(i)#b; That #b is causing each word to be on a new line. :/ I don't think the wraptext is working. Maybe because it's serverside or does that not matter with wraptext? |
Maybe there would be an easier way if we knew how this script was made. Maybe you should try to use string lists in some sort of way...
|
All times are GMT +2. The time now is 04:12 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.