• 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.

Lowkee33

QuoteAnd I still think if Reader is going to display these as if they were part of the building exemplar for whatever mysterious reason it should label them and not cause a crash.  But I know it's there now and will work around it.

Looking at the entries list for the picture you posted I am not seeing any Cohorts in that file.  I can only guess that the Cohorts (there are 2) are in SimCity_1.dat, and thus not only is deleting it a bad idea, but could cause a crash.  This might relate to Shadow Assassin's crash, which I get most every time I use 1.4.

The way to "remove" these properties is to change the "Parent Cohort" Property to 0,0,0.  If you copy/pasted the properties from the cohorts into the exemplar (making sure not to take the duplicate properties) then you could have something that is separate from SimCity_1.dat.

Cohorts are used when you have many exemplars that share the same properties (such as Building: Civic).  It saves space, and also makes it easier to mod all of the exemplars at once.  

QuoteBut it's probably all very much simpler than that.  If you see a problem with my options, please enlighten me!  

I checked this out and I also have two of each property listed.  I did what I told you to do, but the problem persists. &mmm  I don't know...

In the SimCity 4 Apps folder (where the .exe is) there is a file called ingred.ini.  Open this with notepad, and you will see where Reader got much of the exemplar info.  Understanding this file will also enlighten you as to how to make a proper exemplar.

Also, I believe SC4PIM (and PIMX) use a different type of XML.  These programs are made to create .descs.  The XMLs say things like "give a building these properties" where the Reader XML says things like "This property is this hex and is that entry type".  Could be wrong, but I don't think they translate

jondor

Another bug I found concerns ATC animations.

In game, ATC files can share a source image (animation link in the reader) without issues, and cannot share common AVP files (brown boxes occur).

However, in the Reader, ATCs with common AVPs and different images play correctly (which is not a huge issue, but it's something that people have to keep in mind), and ATCs with unique AVPs but sharing a common image source (animation link) all display the same animation (corresponding to whichever ATC is first in the file).

It would be nice to see at least the second inconsistency resolved as well as adding the ability to edit ATC/AVP files in the table view without resorting to the hex editor.

Thanks!
All new animated railroad crossing props for networks of all sizes! (Phase 1 complete)--> http://sc4devotion.com/forums/index.php?topic=13209

Mostly writing pony stories on FimFiction.net, but Cities: Skylines is my new best friend.  Anything and everything I made for SimCity 4 is fair game for use and distribution.

Lowkee33

I was about to ask what all of these "trace" files were, but then I see this is what you were asking RebaLynnTS to give you, and what I was trying to make when I turned De-Bug on.  Do you still want one, I can make a lot.  :P

Lowkee33

The scripting command "entry_SetTGI(entry,T,G,I)" sets the TGI as "IGT".

Working with the scripts made me forget the trouble I have been having with Exemplars.  For me, changing a property in an exemplar causes PIMX to come up with a series of errors (mostly pertaining to properties with multiple reps).  This didn't happen with any of the flora I made, and wondered why.  I happen to have had the flora in a cohort tree, and various basic properties were untouched by Reader.  I believe Exemplar Type is the issue.  I replicated the problem with a building .desc, opened it in the LEX reader, removed the ET property, and added back in.  This seems to have solved the problem (at least, PIMX didn't come up with anything).

Last night I had a building grow even with the PIMX errors, so still not really sure.

Kergelen

I'm having problems with Ilive Reader. :(
The program does not open. I'm using Reader for some month and this evening I was using them and works perfectly. The problems started when I try to copy and paste some properties and the program stopped. Get a window from Microsoft Windows that said: Application MFC Reader stopped worked.
Then I open it again and run well but every time I wanted to copy propeties the program stopped. I uninstall Reader and instal again. Finally the program don't open and said again: Application MFC Reader stopped worked.

Maybe someone knows what could be the problem.

Thanks in advance

I'm using version 1.4


                                    Links to SC4 websites

tamorr

I have a different problem with this 1.4 version that does not give any windows error.

My problem involves persistent value changes.

I am trying to modify a file for personal use to reduce the cost in budget, plop, and bulldoze.
Sure all those properties save correctly, however when I open the file the 2 pollution effect properties change to 0x0000000A, the Pollution Radii to 0, and the mayor rating effect to 0 values.

I did not change those values before and that is the problem. I am trying to modify a pollution reducing custom lot. Does it have something to do with the fact that 0xFFFFFF9C is used for center and 0xFFFFFFE7 for the outer in the Air value?

It is persistent even if saved as a new file or replacing old one. I never had this persistence with the .93 version, the original reader. Figured I would mention something... &mmm
  "It is wiser to think about your actions before doing them, but be warned One must act quickly before another takes action for you."
  "Knowledge may be Power, but it is how you use that Knowledge that makes One Powerful."
  "I am a Philosopher, Punnist, Poet, and Rambler so keep in mind I think ahead and backwards to point where communication is sometimes not completely understood, even if Enlish is my primary language, it doesn't mean I know it well N proper."
  "Always do your best to acheive your goals and Dreams one at a time."
"Patience is a virtue."

toja

I've to report another problem with the LUA-scripting in the reader: It uses signed integers instead of unsigned integers as return values for its functions, which could lead to unexpected behavior (in 32bit-systems?).

Imagine you write a script, that lists all the properties and their corresponding IDs (desc, descname) of a T21-exemplar. This is how the output would look like:


16 Exemplar Type
32 Exemplar Name
33 Exemplar ID
1238718801 kPropertyID_NetworkPlacementPattern
-1997682807 LotConfigPropertyVersion
-1997682797 LotConfigPropertyZoneTypes
-1997682795 LotConfigPropertyWealthTypes
-1997682432 LotConfigPropertyLotObject
-1997682431 Unknown
-1441658510 NetworkLotConfigPropertyMaxSlopeAllowed
-1441658509 NetworkLotConfigPropertyMinSlopeAllowed
-911892034 kPropertyID_LotConfigNetworkTileId
-897468204 Unknown
-868333739 kPropertyID_FlipsAllowed
-331623312 kPropertyID_RotationsAllowed


As you can see, most of the property-IDs are negative. Let's see what's happening here.

The binary representation of 0x7FFFFFFF in a 32bit-system is

0111 1111 1111 1111 1111 1111 1111 1111

Now we're going to add 1: 0x7FFFFFFF + 1 = 0x80000000 or in binary

1000 0000 0000 0000 0000 0000 0000 0000

And that is where the tricky part begins. The leftmost 1 (the most significant bit) is often used, to represent a number's sign: set that bit to 0 for a positive number, and set to 1 for a negative number. Obviously that is what happend to the prop-IDs in the example above, they are interpreted as signed integers.

The bad news is that LUA interprets the numbers above 0x7FFFFFFF as unsigned intgers. Now imagine you want to read out the LotConfigPropertyLotObject-properties (ID: 0x88EDC900) from an exemplar file. The LUA script will not find the properties - or even worther find another one...

A first workaround would be to add a small function:


function chkHex(num)
return (num < 0x7FFFFFFF) and num or (num - 0xFFFFFFFF - 1)
end

function reader.main (this) 

MyProp = chkHex(0x88EDC900)

pos = reader:entries_GetHeadPosition()   
while pos~=0 do
entry,pos = reader:entries_GetNext(pos)
      flag = reader:entry_GetFlag(entry)
if (flag == 7) then
exemplar = reader:ex_Decode(entry)
proppos = reader:exprop_GetHeadPosition(exemplar)
while proppos~=0 do
            exprop, proppos = reader:exprop_GetNext(exemplar,proppos)
            desc,descname = reader:exprop_GetDesc(exprop)
if (MyProp == desc) then
print(descname)
end   
end
end
end
end


Anyway, you should be careful and always backup your files, since we don't know what other sideeffects the signed/unsigned problem may have.

toja


P.S.: Could anyone test if 64bit-systems are affected, too? Thank you!

Lowkee33

Nicely done  :thumbsup:.
Also:

...
desc,descname = reader:exprop_GetDesc(exprop)
if (desc < 0) then
  desc= desc+4294967296
end
if (desc == 0x88EDC900) then
  print (descname)
end
...


I came across this with "ValueStr= reader:exprop_GetValueStr(exprop)" as well.  For this function, a Hex value will be taken literally, and not as a number.  The Lua code:
ValueStr= tonumber(ValueStr, 16)

will return an unsigned number (right?), in base 16, so you would have to do the process in reverse to get an integer that is significant to Reader finding that Hex value.

Can't speak on the 64-bit issue.

Btw, this property is a tough one for me.  Is there a way to only get the 13th (or any other) rep, and not the entire string?

toja

#128
Quote from: Lowkee33 on September 09, 2011, 09:55:43 AM
The Lua code:
ValueStr= tonumber(ValueStr, 16)

will return an unsigned number (right?), in base 16, so you would have to do the process in reverse to get an integer that is significant to Reader finding that Hex value.

Technically spoken LUA will interpret ValueStr as an unsigned integer and return a number...  ::)

Quote
Btw, this property is a tough one for me.  Is there a way to only get the 13th (or any other) rep, and not the entire string?

I think something like this should work:


....
str = reader:exprop_GetValueStr(exprop)
if (MyProp == desc) then
PropValues ={}
for val in string.gmatch(str, "0x%x+") do
             table.insert(PropValues, val)
      end
print(PropValues[13])
print(tonumber(PropValues[13], 16))
end
...


Hope that helps!

toja

Lowkee33

Quote from: toja on September 09, 2011, 12:10:04 PM
Hope that helps!

Sure does, thanks.  :thumbsup:

I have another issue for you. :) I'm having a toubles with the Vert section of an S3D (in a script).  I don't have enough specifics on hand to get into it.  I can say that I have a hard time reading all of the verts, as well as setting the ones that I can read (u0 just doesn't seem to work).  Have you experienced anything like this?  Should I copy my script over?

toja

#130
Quote from: Lowkee33 on September 20, 2011, 03:18:09 PM
Have you experienced anything like this? Should I copy my script over?

No, I haven't tried to manipulate S3Ds until now, so I can't give any advice on that issue. But when I take a look at the function list I can imagine that it might be tricky to change vertex or UV-coordinates. And yes, please copy your script over and I'll see if I can give some advice. But maybe we should continue our conversation in the Script in Reader-topic?


To come back to the signed/unsigned-integer-problem once again: I think the best solution is to use the BitOp-module, that adds bitwise operations and other useful functions to the LUA core. Just read a little bit about the API functions and semantics and you'll see what I mean.

If you don't know (like me) how to compile source code you could take the following steps:

1. Download an install luaforwindows

2. In the program directory you'll find a folder clibs and inside this folder a file called bit.dll. Copy the file to your reader installation directory

3. Change the variable dir in the following code to your reader installation directory and run it in reader.


--template.lua

dir = "path/to/ILives/ILives Reader/" -- change this to your reader installation dir

package.cpath = dir.."?.dll"
require("bit")

function reader.main (this)

-- simple filter example with bitwise AND
    local t = {0x045ABACD, 0x5cafe04, 0x5EBCA4B0}
    local search = bit.tobit(0x5EB00000)
    for i, val in ipairs(t) do
        print (search == bit.band(val, 0xFFF00000))
    end
end


If everything went well you should get the following output:

false
false
true

... very useful when you search for IDs etc.  ;)

toja






Lior

Well, after a fast look at the new reader I really enjoyed it. It's more organized and simple. But I didn't like one thing at first. I can't access the navigator unless I have an exemplar selcted at the main list.

Lowkee33

Back to an earlier issue of CTDs:

If I try to copy/paste a fair amount of entries I get a CTD.  Reader will then CTD upon re-opening.  Until today, my fix was to restart the computer.

However, if after Reader crashes, I copy a whole bunch of stuff, (my plugin folder works) I can then re-open Reader.  No need to paste anything, just clear out the RAM I guess...

Hope this helps others with the same issue :) 

jondor

Now that more is known about the format of FSH images (specifically those with embedded mipmaps), it would be nice to see them decoded correctly, at least the main image, if not the mipmaps as well.

There seems to be partial support for transit sized textures (128x128) with 6 embedded mipmaps, though whether that is by accident or design is unknown.  Updated FSH format information can be found here: http://www.wiki.sc4devotion.com/index.php?title=FSH/format
All new animated railroad crossing props for networks of all sizes! (Phase 1 complete)--> http://sc4devotion.com/forums/index.php?topic=13209

Mostly writing pony stories on FimFiction.net, but Cities: Skylines is my new best friend.  Anything and everything I made for SimCity 4 is fair game for use and distribution.

null45

The FSH files from the Need For Speed series use embedded mipmaps, so it would make sense if the game could read them. 

Do any of Maxis's files use embedded mipmaps?

cronodevir

I am Using Reader 1.4 and I am trying to modify the text in game by editing LText files, but it seems I am unable to search for in game text in Reader, is there another alternative to manually clicking 5,900+ LText files looking for that one or two entries I want to change?

jondor

Quote from: null45 on November 09, 2011, 12:48:10 AM
The FSH files from the Need For Speed series use embedded mipmaps, so it would make sense if the game could read them. 

Do any of Maxis's files use embedded mipmaps?

I can confirm that the zoom 5 and zoom 4 ELR concrete textures (0x2B855E44 and 0x2B855E43) contain embedded mipmaps, and that there are S3D texture settings that can utilize them.

This may also help: Toja posted a link to one of EA's FSH tools that can read and write FSH files and contains some useful data that we did not previously have.
All new animated railroad crossing props for networks of all sizes! (Phase 1 complete)--> http://sc4devotion.com/forums/index.php?topic=13209

Mostly writing pony stories on FimFiction.net, but Cities: Skylines is my new best friend.  Anything and everything I made for SimCity 4 is fair game for use and distribution.

null45

#137
The Reader's fsh decoding code is based on the code from FSHTool which contains code to read the embedded mipmaps so it should be relatively easy to allow the Reader to decode them.

Unlike reading the DXT1 alpha channel which FSHTool and other tools based on it's DXT decompression code such as FSHLib cannot decode (I use the Squish library to decode the DXT1 and DXT3 data with the proper alpha instead).

I have used FSHEd in the past to test the code in my Photoshop FSH plugin that throws an error message if QFS compression or embedded mipmaps are used, and have also used both FSHEd's documentation and FSHTool's source code as a guide to many of the details of the fsh format. 

Now that it is known that SC4 uses embedded mipmaps I may have to rewrite that code to preserve that data for recreation on save, which still should be easier than trying to write code for decompressing the QFS compression which the Reader can do for me anyway.  :D 

jondor

What I find particularly odd is that it works in some cases, but not in others right now.  If I had much in the way of C++ skills, I'd take a look at the source code myself, but I got on the Java bandwagon instead.

In any case, here's a test case you may find useful.  It's one of my test textures from the Java FSH tool I'm working on.  The dat contains the FSH file as generated straight from my tool with 4 embedded mipmaps (which the Reader chokes on), and the same file with 20 bytes of padding (equivalent to two more mips) which the Reader parses just fine.  FSHEd can read both of them with no problems and they both work correctly in game.
All new animated railroad crossing props for networks of all sizes! (Phase 1 complete)--> http://sc4devotion.com/forums/index.php?topic=13209

Mostly writing pony stories on FimFiction.net, but Cities: Skylines is my new best friend.  Anything and everything I made for SimCity 4 is fair game for use and distribution.

Silur

Well, I can work only with ILive Reader 0.9.3 2007-04  today ...
Another versions give me tremendous problems...
We can work with Windows XP or Windows 7 - my favorite is XP ..
Sorry ...