• Welcome to SC4 Devotion Forum Archives.

iLives Reader 1.x Official support thread

Started by ilive, March 16, 2010, 08:37:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dlo§rhuj

I tried editing the SimCity_1.dat in the latest iLive Reader (1.54) and I think it corrupted it. At least, SimCity 4 now doesn't start up anymore and just fails silently. I think it's got nothing to do with the edit itself, it must be a bug in the iLive Reader.

Andreas

The Reader was never designed to edit the SimCity_1.dat itself, but it was always advised to copy the modified data into a new *.dat file. You can "collect" the properties that you want to change with the "Add to patch" feature, and then save them into a new file in one go. This is basically the way how all mods for SC4 were created.
Andreas

fafalone

So if anyone is updating things still, would it be possible to take a look at the LUA script exprop_SetValue function? Still has the bug where only strings are properly set.

Would start in ReaderLua.cpp,

i've been trying to set UInt32 (type 0x300) properties, so it appears it's done here,

                case (0x700):
        case (0x300):
                case (0xB00):
        case (0x100):
dwVal  = (int)lua_tonumber  (state, 2);
iPos   = (int)lua_tonumber  (state, 3);
if (iPos < pProp->dwValue.GetSize())
pProp->dwValue.SetAt(iPos,dwVal);

                    break;   


Now the exprop_SetDesc is able to set its UInt32 value with
unsigned int exprop_SetDesc (lua_State *state)
   {    
_examplar_prop* pProp = (_examplar_prop*)(int) lua_tonumber (state, -2);
if (pProp)
{
pProp->dwDesc = (int) lua_tonumber (state, -1);                
}   
        return 0;
   }


So maybe that way?

I'd try it myself but after installing a couple different VS versions and 3 different SDKs, my VS2008 compiler is so thoroughly messed up I can't even compile hello world after countless hours trying to fix paths (no, running vcvarsall.bat didn't help), much less something as complex as reader.                 

Tropod

Quote from: fafalone on January 02, 2017, 06:54:46 PM
So if anyone is updating things still, would it be possible to take a look at the LUA script exprop_SetValue function? Still has the bug where only strings are properly set.
...

Not sure I properly understand this issue &mmm. So if you (or anyone?) would care to elaborate on this issue including providing a sample that highlights the issue, & possible fix, I'd be more than happy to take a look & see about fixing source code & updating it  :thumbsup:.

fafalone

#244
When you're adding/setting a property, there's name value, data type, rep, and value...
         exprop = reader:exprop_Add(exemplar)
         reader:exprop_SetType(exprop,0x300)
         reader:exprop_SetDesc(exprop,0x8A2602B9)
         reader:exprop_SetRep(exprop,1)
         reader:exprop_SetValue(exprop,"0x0000097A")

That SHOULD add an item order, which is type UInt32, set to 97A. Instead it sets it to a random value, or 0 (random if value quoted like above, zero if unquoted, have tried rep=0 also)

But when it's used on a string value. e.g.
         exprop = reader:exprop_Add(exemplar)
         reader:exprop_SetType(exprop,0xC00)
         reader:exprop_SetDesc(exprop,0xEA296F8F)
         reader:exprop_SetRep(exprop,0)
         reader:exprop_SetValue(exprop,"Test3")


It works fine.

this is the LUA scripting feature, the above is part of a script I wrote myself to automate editing lots. the code in my last post is from the reader source code that is behind that script's function call.

Any fix would really be a guess on my part.. can't really be more specific beyond looking at how the strings and other things like the UInt3 Desc are set without the ability to run the compiler. I did recently install VS2013, maybe I'll try compiling with that if it can load VS2010 projects..

Tropod

Quote from: fafalone on April 22, 2017, 11:17:40 PM
...
this is the LUA scripting feature, the above is part of a script I wrote myself to automate editing lots. the code in my last post is from the reader source code that is behind that script's function call.

Any fix would really be a guess on my part.. can't really be more specific beyond looking at how the strings and other things like the UInt3 Desc are set without the ability to run the compiler. I did recently install VS2013, maybe I'll try compiling with that if it can load VS2010 projects..

I've never actually used script functionality myself to be honest. You able to upload copy of the script?
VS2013 you'll probably have to disable/surpress unicode warnings otherwise it won't compile, or alternatively change all code multi-byte->unicode.

jeffryfisher

Request to moderators: Tarkus's warning helps, but... If you have access to the OP on page 1, please nullify obsolete links and add (near the top) a "Find most recent download here" link that points to the latest version (or post in this thread that does so). This thread is now long enough that hunting for the latest is both tedious and prone to error.

Also, for anyone who hadn't already cottoned to the fact: There's an SC4 Reader out there that is NOT the iLives Reader! It should have been obvious except that they are (or were recently) simultaneously and unfortunately both most-current at v1.54. Adding to the confusion, there's at least one not-quite-helpful forum post out there on a site that shall remain nameless that touted iLives v1.54 but linked to the download for SC4 Reader v1.54 (the one I followed a few months ago but can no longer find).

I have now downloaded iLives v1.54 from Dropbox and can now use your superior app. Please alert me if I missed a more recent version.

Modding PC games since 1993 (back when we needed hex-editors)

tomvsotis

wait, really? Where's the Fries? (next time we'll wash your mouth out with soap) is SC4 Reader?

Tarkus

Thanks for the heads up on the need for further clarification, Jeff--I've gone ahead and made an addendum to my initial edit, with a link to ilive's Reader 1.5.4 and its source code.

Quote from: tomvsotis on December 18, 2017, 07:13:59 PM
wait, really? Where's the Fries? (next time we'll wash your mouth out with soap) is SC4 Reader?

SC4 Reader is another tool that does a lot of the same things as ilive's Reader, and was also developed by Tropod--who, coincidentally enough, also did the Version 1.5.x work on ilive's Reader.  The most recent version of SC4 Reader is actually Version 1.5.6 now, after an update in September 2017.

-Alex

-Alex

tomvsotis

Huh, cool. Good to know. (And point taken on the whereabouts of the fries.)

Kitsune

#250
1.5.3 and 1.5.4 keep corrupting exemplars - as in 0'ing all but the one I'm working on out after I do 3-4 saves in a row on a file. Is there any solution to this ?

Edit: To add... its also zero-ing out all the exemplars if I delete a property in one exemplar.
~ NAM Team Member

twalsh102

Although we have all been taught that you always save after making changes, what I've found with the newer versions of Reader (specifically 1.5.3 and 1.5.4) is that if one saves more than once when a file is open, something is going to get corrupted.  I've experienced PNGs getting blanked or turned into apparent text files, LText files getting scrambled, and like you, exemplars getting corrupted.

To get around this, I've adopted the simple expedient of either waiting until after I've made all my modifications before saving, or having saved the first time and then discovering another change to make, closing the file and reopening it before making further changes.

I haven't experienced any corruption when following these guidelines.  But every once in a while, I won't pay attention to what I'm doing, save more than once, and end up with corruption.

Tyberius06

Hi!
I already explained this to Kitsume via discord. You can save as many time as you want. You can have opened even more than one file, but BEFORE you would save any of the opened and modified files, you HAVE TO  hit the "reindex" and the "rebuilding DIR file" commands. Right click in the middle panel on any of the examplars etc. and there you find in the menu the above mentioned commands.

- Tyberius
You may find updates about my ongoing projects into my development thread here at SimCity 4 Devotion: Tyberius Lotting Experiments
or over there on Simtropolis into the Tyberius (Heretic Projects) Lotting and Modding Experiments.
I'm also member of the STEX Custodian and working on different restoration projects on behalf of non-anymore-active custom content creators.
Current projects: WMP Restoration and SimCity Polska Restoration.
Member of the NAM Team and RTMT Team.

twalsh102

Thanks for the info!  Is this in any documentation anyplace where I might have missed it, or is this just one of those many things that is learned accidentally?
I'll have to remember to give this a try the next time I run into this phenomenon.  Not exactly the most intuitive process.  I knew about using those commands when adding or removing subfiles, but re-indexing when one isn't doing anything to affect the index is definitely counter-intuitive.  Rebuilding the DIR file might make sense if whatever you are doing changes a compressed file to an uncompressed file.

Kitsune

#254
Yep it is bizzare that changing a value in exempler A > then saving > will zero out exemplers b to d. Frustrating too as I've had instances that reindexing will crash the program. Also, I thought DIR's are only for compressed files? As the exemplars getting 0'ed out are not compressed, and hence not listed in the DIR.

Edit: Upon further thought.... the only files that are getting corrupted are the ones not in the DIR. That is including uncompressed PNG, LTEXT, and Exemplars. So it seems reader is doing some kind of check involving the DIR when saving and corrupting uncompressed files; its not doing the check if you reindex first.
~ NAM Team Member

mgb204

Have you tried simply moving all files into a new DAT. As you state, DIR files are necessary to index the entries of compressed content/properties. But if the file has no such compressed content, no DIR file should be present in the first place. I suspect you may have a file where compressed content did exist but was removed somehow. But if you use the Patch function of Reader, you shouldn't ever have DIR files unless you need them.

I'd try removing the DIR file from any such DATs where no compressed files reside. However, that's potentially going to go wrong (even with 0.93), if you simply remove the DIR file itself. So the best method would be to copy/paste all contents into a new reader session, then saving a new DAT and work from there.

Kitsune

Quote from: mgb204 on June 03, 2018, 03:59:20 PM
Have you tried simply moving all files into a new DAT. As you state, DIR files are necessary to index the entries of compressed content/properties. But if the file has no such compressed content, no DIR file should be present in the first place. I suspect you may have a file where compressed content did exist but was removed somehow. But if you use the Patch function of Reader, you shouldn't ever have DIR files unless you need them.

I'd try removing the DIR file from any such DATs where no compressed files reside. However, that's potentially going to go wrong (even with 0.93), if you simply remove the DIR file itself. So the best method would be to copy/paste all contents into a new reader session, then saving a new DAT and work from there.

So this particular file has 212 compressed files, and 18 uncompressed. I'm thinking the better way to go might just be to compress everything. As much I know ... I know there is still a lot unknown.
~ NAM Team Member

eagle74

Well I managed to corrupt a few files with V1.54 yesterday, & spent the afternoon getting the game working again.  I knew better from past reading of these threads & usually only use 1.54 when absolutely necessary.  0.93 works fine for most of my tweaking.

briansgenius

So I must be an uber newb cuz my issue isn't addressed here. Upon opening .exe I receive error message "Failed to open C:\Program Files(x86)\Steam\steamapps\common\Sim City 4 Deluxe\English US\SimCityLocale.DAT" Which I rectified by creating the subfolder "English US" and copying the dat file to it. In either case I was still presented with a Microsoft Visual C++ error "Program C: etc etc Reader.exe This application has requested the Runtime to terminate in an unusual way. Please contact useguys 4 halp" and that's where I'm stuck now. I already had Visual 2015 but installed 2008 and the SP1 Redistributable Package (x86) on Windows 10.

Glaive

I too must be a complete noob!  I am having the same issues as the last poster (brainsgenius)  Same original error "Failed to open C:\Program Files(x86)\Steam\steamapps\common\Sim City 4 Deluxe\English US\SimCityLocale.DAT"  I created the sub folder, but was not sure how to add the DAT file and I couldn't find it.  I am running Windows 10 and have typical installations.  Any help would be great!

Thank you!