Crazy big string size required.
#1

Ok so I have a teleport system which uses a buffer to read/write from files, I do this using arrays and what not but I have thought of an issue which may occur in the future.

I have a dialog which gets it's format in a loop which contains all the teleport names (formats into itself and adds the '\n'), this gets added to the format string and grows at whatever the size the new name is but seeing how this loop will grow each time another point gets added it could end up needing a string which is frikkin huge (16k for 512 etc (32*512)). I can't have a string which is 16k+ cells, that's just frikkin stupid so what can I do to work around this ?

I'm currently using a string of 1024 cells and I have put a limit on the teleports upto 32, but that kind of low number defeats the point of it being dynamic. I currently have only five or so teleports in the array so that's only using like 160+ cells but after five I'm already at over ten percent of my limit for the string aren't I so this is what made me think about the issue (it hasn't happend yet, just thinking ahead).

If I could come up with a solution without the need to break the list into additional dilaogs then that would be great, any ideas ?

Thankyou for reading my essay.
Reply
#2

Quote:
Originally Posted by Seif_ [adream-rp.com
]
The dialog text have a limit? But as ****** said, best option is having 31 items at the end of the list, and save the 32nd for "more".
Kye said that dialog limit is around 2048, but it will be increased in the future.
Reply
#3

Quote:
Originally Posted by Y_Leѕѕ
Why not just limit it to say 10 in the dialog and then have a "more" option at the bottom of the list. That's what I did in YSI for the weapon buying menus.
Indeed I could just reuse the current string couldn't I but start from the next slot after the 32 or however many are being displayed currently. Should be easy to do also, why didn't I think of that hehe.

Quote:
Originally Posted by Seif_ [adream-rp.com
]
The dialog text have a limit? But as ****** said, best option is having 31 items at the end of the list, and save the 32nd for "more".
Maybe, I don't know about the 0.3 limits yet but I wasn't comfortable using a huge string as like I said 512 points would require a string with over 16k characters to be able to display all the names as I have allocated 32 characters for each name so that's 32 * 512 (16k+) as apose to now which is 32 * 32 (1024).

Cheers for the help guys, my brain needed a jump start.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)