This is probably an old request, but I can't imagine it'd be that difficult to add and it'd add a lot of additional uses for BYOND programming. The ability to add specific byte values to files (insert or modify) and the ability to retreive byte values from a specific offset within a file. It'd make it possible to use BYOND to create editors and such for non-BYOND programs.
This is "almost" possible using text2file/file2text along with ascii2text/text2ascii, but there's some issues there with certain values making it (as far as I can tell) impossible.
ID:135113
![]() Feb 10 2005, 12:26 pm
|
|
Foomer wrote:
This is probably an old request, but I can't imagine it'd be that difficult to add and it'd add a lot of additional uses for BYOND programming. The ability to add specific byte values to files (insert or modify) and the ability to retreive byte values from a specific offset within a file. It'd make it possible to use BYOND to create editors and such for non-BYOND programs. Agreed. In fact, it could be used with BYOND file formats! For example, if this were implemented, then it would be possible for one to make his own GetPixelColor() proc. |
Foomer wrote:
I honestly think you have no idea what I'm talking about. I concur. If anyone wishes to attempt to explain it to the guy... |
Actually, I think he does know what he's talking about (this time) - it sounds like you want the ability to read the contents of binary files. If this was possible, you could parse a DMI file to determine, say, the colour of a given pixel in the icon.
|
Crispy wrote:
Actually, I think he does know what he's talking about (this time) - it sounds like you want the ability to read the contents of binary files. If this was possible, you could parse a DMI file to determine, say, the colour of a given pixel in the icon. and thats the problem with viewing all posts in the thread =P |
OneFishDown wrote:
Crispy wrote: Well that explains whats going on in this conversation. :P |
Wizkidd0123 wrote:
Foomer wrote: Uhh can't you all ready do that? |
No, it is something we have been wanting and waiting for. It is supposed to be added in some future update.
|
Loduwijk wrote:
No, it is something we have been wanting and waiting for. It is supposed to be added in some future update. hmm O.o so If I made a GetPixelColor() function you would download and use it? I just dont want to do somthing like that and no one use it. Ps what would you want this function to do exactly? Like GetPixelColor(x,y) and it would output what RRGGBB? |
Green Lime wrote:
hmm O.o so If I made a GetPixelColor() function you would download and use it? I just dont want to do somthing like that and no one use it. If you made a GetPixelColor() proc, then yes, we would download it. However, at the moment, as far as I can tell, it's completely impossible. The only efficient way to do it is to binarily read the icon. Although we know the .dmi format, to binarily read a file, as Foomer is requesting, ascii2text() would have to be used. Unfortunately, since BYOND can't doesn't handle certain ASCII characters very well, the most notable one being 0, it isn't possible, at the moment, for BYOND to read a file binarily. Ps what would you want this function to do exactly? Like GetPixelColor(x,y) and it would output what RRGGBB? Yup: GetPixelColor(px,py). However, preferably, it would output a hexidecimal RGB value: all of the other rgb-related procs do. rgb() itself, is, in fact, just a dec2hex() proc: it converts its three numerical arguments and returns them as a hexidecimal value. The return value of rgb() is a text value. |
Crispy wrote:
Actually, I think he does know what he's talking about (this time) - it sounds like you want the ability to read the contents of binary files. If this was possible, you could parse a DMI file to determine, say, the colour of a given pixel in the icon. Crispy, Hell Ramen wrote: "Download today! BYONDhex: Now complete with src_code2files()!" I think you replied to the wrong post =P. |
Yes, I would very much like that as well. It will allow for some very neat applications to be made :)
|
Whoops! My bad. Normally I check to make sure people are replying to who I think they're replying to; must've forgot this time. =)
Typical - the one time I don't check...! |
I feel so...insulted. :(
Plus, with Byte Manipulation, couldn't you also use it to the point where you could make a file editor like function? |
Hell Ramen wrote:
with Byte Manipulation, couldn't you also use it to the point where you could make a file editor like function? Yeah, thats the point. |
Yes, I see this as a great use to BYOND then...
_>What? It's not like I'll make something to use on Gunbound or something, geez. |
I honestly don't see it happening, but, meh, it's their choice and not mine.