| Mirage Source http://miragesource.net/forums/ |
|
| Name Length in Binary http://miragesource.net/forums/viewtopic.php?f=201&t=2834 |
Page 1 of 1 |
| Author: | William [ Sat Oct 13, 2007 12:09 pm ] |
| Post subject: | Name Length in Binary |
So, I've got all my items setup and finished through the item editor. But, I noticed before that the name length was set to 20 so I couldn't get all the full names written out. So I just thought, I'll fix that later. But now when I tried to set it to 30, basicly the binary file doesn't know what to load really. Since its set as a fixed lentgh in the file. So I can't change that without remaking all my items. Do anybody have an idea how to fix this, without remaking all the 100 items? |
|
| Author: | Robin [ Sat Oct 13, 2007 12:37 pm ] |
| Post subject: | Re: Name Length in Binary |
Load them into a type with 20 set length, then re-save them to a different type with 30 set length, and save them. Basically just a converter. |
|
| Author: | William [ Sat Oct 13, 2007 12:38 pm ] |
| Post subject: | Re: Name Length in Binary |
Ah I see, good point |
|
| Author: | Lea [ Sat Oct 13, 2007 2:40 pm ] |
| Post subject: | Re: Name Length in Binary |
If you saved them as null-terminated strings, you can read in one byte at a time until you reach the null termination C++ ftw |
|
| Author: | William [ Sat Oct 13, 2007 2:54 pm ] |
| Post subject: | Re: Name Length in Binary |
Dave wrote: If you saved them as null-terminated strings, you can read in one byte at a time until you reach the null termination C++ ftw You don't mean ftw, you mean WTF |
|
| Author: | Lea [ Sat Oct 13, 2007 3:08 pm ] |
| Post subject: | Re: Name Length in Binary |
lol, maybe |
|
| Author: | Spodi [ Sat Oct 13, 2007 7:01 pm ] |
| Post subject: | Re: Name Length in Binary |
Most any language that can perform file I/O can create null-terminated strings. Put #x,, MyTypeWithMyString or Put #x,, MyString |
|
| Author: | William [ Sat Oct 13, 2007 8:13 pm ] |
| Post subject: | Re: Name Length in Binary |
In my case Im just using Code: Put Item(num) So Im not saving each part on their own. |
|
| Author: | Spodi [ Sat Oct 13, 2007 8:18 pm ] |
| Post subject: | Re: Name Length in Binary |
Yeah, so that should work fine with variable-length strings. |
|
| Author: | Robin [ Sat Oct 13, 2007 8:32 pm ] |
| Post subject: | Re: Name Length in Binary |
Don't variable length strings have the length stored in them anyway? And just for your information, you only really need to use set length strings if you're saving all the maps to the same file or something and you're setting the start byte. But that's only if you don't bother to dynamically change the start byte depending on the stored data for the different maps instead of working the "set" length of the map data manually. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|