SC4 Devotion Forum Archives

SimCity 4 Devotion Custom Content Showcase => Independent Development Projects => Independent LOT Editor Projects => Topic started by: FrankU on March 31, 2008, 07:14:49 AM

Title: Editing LOTs and Custom Icons
Post by: FrankU on March 31, 2008, 07:14:49 AM
When I edit someone else's Lots I cannot use the Custom Icon that goes with the lot anymore. I get the ugly Lot Editor icon in my menu.

Is it possible to extract the Custom Icon that went with the Lot, edit this and put it into my own edited Lot?

Well, I am sure there is a way, but how is it done? Last night I tried (with the Reader) to extract the PNG file from Soulstealer's Container dock as to edit it in Photoshop and put it back into the edited lot I made. But I couldn't find out how.
Is there even a tutorial?
Title: Re: Editing LOTs and Custom Icons
Post by: RippleJet on March 31, 2008, 08:17:19 AM
With iLive's LEProp you can both export a custom icon to an external PNG file, and import an external PNG into a custom icon. :)
Title: Re: Editing LOTs and Custom Icons
Post by: FrankU on March 31, 2008, 11:04:21 AM
Thanks. How simple!
Title: Re: Editing LOTs and Custom Icons
Post by: dedgren on March 31, 2008, 12:52:20 PM
This is the method I use- it sticks with the Reader.  I don't go into icon editing, and assume basic familiarity with the Reader's screen and functions.

1.  EXTRACTING AND OPENING A MENU ICON FILE FOR EDITING

To extract the menu icons from an existing LOT file to edit them, open the lot you want to work with and (1) find the .PNG file that contains them.  You can easily tell because (2) the pic that appears in the edit pane will be the four small icon squares.  Highlight the .PNG file and right-mouse click on it, then navigate down the drop-down menu that appears to the "Save selected file(s)" menu choice and (3) left-click on it.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg364.imageshack.us%2Fimg364%2F5607%2F01jh6.png&hash=f61f7a33e838446dbffc5d6b00ff3a0853140ed4)

If you now (1) open your "My Documents" SimCity 4 "Plugins" subfolder, you will see (2) a new file named "file00000000.png".  This is your newly created icon file, which can be opened and edited in your graphics program.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg368.imageshack.us%2Fimg368%2F3088%2F02dx8.png&hash=3378ea2b0242f995d46640e34e39be4d06a6dfde)

* * *

2.  INSERTING A CUSTOM MENU ICON FILE

I'll presume you've edited a really nice custom menu icon file and are ready to replace the generic one in the LOT file with it.  So, here goes.

Returning to the Reader, find (1) the .PNG file you want to replace- the (2) menu squares are a dead-giveaway.  Highlight the file, then right-click on it and select (3) "Insert File" from the drop-down menu.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg360.imageshack.us%2Fimg360%2F2825%2F03ib3.png&hash=dc6353575ddf595e6b69a07d2d8183f63cb0060e)

This will bring up (1) an input window titled "Open."  Navigate to your "Plugins" folder, or wherever you have saved the edited menu icon file, and (2) select the file, then left-click (3) the "Open" button.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg185.imageshack.us%2Fimg185%2F9879%2F04nk9.png&hash=ad295081861347b67a1c59fe9b54601861efb717)

A (1) "File Type" input window will now appear.  Highlight (2) "PNG file" from the choices, then left-click (3) "OK".

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg253.imageshack.us%2Fimg253%2F9548%2F05pp9.png&hash=805b05073f558b594464379a4150807628a660bd)

Notice (1) that you now have three .PNG files.  If you highlight the newly-appeared one, you'll see (2) your newly-created custom menu icons in the edit pane.  You'll also notice (3) that the "Group" and "Instance" attributes of your new file are set to "00000000".

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg374.imageshack.us%2Fimg374%2F8246%2F06fo5.png&hash=10ee1d3835d53ae443a70d98298e87d51aa94562)

A discussion of "TGI" ("Type-Group-Instance") attributes is beyond the scope of this tutorial.  Suffice it to say that the TGI attributes are collectively like GPS coordinates or a street address- they tell the game engine where to look for a particular file among the hundreds of thousands that are in use during an SC4 session.

Making sure (1) the new .PNG file continues to be highlighted, left-click (2) on the "File Info" selection from the menubar at the top of the Reader window.  This opens (3) a "File Info" input window, and you'll select (4) "Edit" by left-clicking on the button when it appears.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg144.imageshack.us%2Fimg144%2F3180%2F07lm2.png&hash=2722ec3513a65aafd18d6fe5d4e9beb5dc8455d7)

A (1) "Header - Edit" input window replaces the "File Info" window.  Note (2) that the "Group" and "Instance" entry fields each contain "00000000".

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg108.imageshack.us%2Fimg108%2F6852%2F08mn8.png&hash=9784a038ccafa89dad4bfb9518038fb1f835ccfd)

Edit (1) the "Group" attribute first by typing the characters "6a386d26" into the entry field.  This number, when you are dealing with custom menu icons, will always be the same.  Next, check (2) the "Instance" of the first "Exemplar" file that appears- you'll see this same number repeated as the instance for several other files.  Copy it exactly by typing (3) it into the "Instance" entry field in the "Header - Edit" window.  When you have done this, left-click (4) "OK" to save your changes.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg132.imageshack.us%2Fimg132%2F7719%2F09sz8.png&hash=9e861fa3a1e8c0b488369aa4a9f8380528288f08)

When you refer back (1) to your new .PNG file, you'll see (2) the changed "Group" and "Instance" attributes reflected.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg144.imageshack.us%2Fimg144%2F8829%2F10qr3.png&hash=6fd0388466d8b4bfb38c53eab508b665bca19568)

Next, highlight once again (1) the .PNG file containing the old menu icons, confirming (2) you have the right one by looking at the edit pane.  Right-click on the selected file and, from the drop-down menu that appears, (3) select "Remove File" by left-clicking on that menu choice.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg381.imageshack.us%2Fimg381%2F9585%2F11kp4.png&hash=bc336f2a2cb1657d1e05566784adb61166735869)

You're almost done.  The following steps, though, are very important, as failing to do them can lead to a scrambled LOT file, and the possibility it will lock-up your game when you try to use it.

Note (1) that you now have two .PNG files.  When you look (2) at the "Num" category, though, you'll see that the list goes "1-2-3-5-6", skipping the number: 4, assigned to the .PNG file you removed.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg360.imageshack.us%2Fimg360%2F3059%2F12bk5.png&hash=3df3400d14a036875147298602a44db42e24bf1e)

This is corrected by right-clicking (1) anywhere in the Reader's file list window white space just below the file names.  A drop-down menu will appear; from it, choose (2) "ReIndex" by left-clicking on that menu choice.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg209.imageshack.us%2Fimg209%2F1319%2F13xa9.png&hash=e2ddb678e9e1819c877bdb41a01ce108028c5a70)

Now, right-click (1) in the same place on the screen again.  The same drop-down menu reappears.  This time, choose (2) "Rebuild Directory File" by left clicking on that choice.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg215.imageshack.us%2Fimg215%2F4272%2F14ks6.png&hash=6188f18889c28367224d4ead987ca70de96f611e)

Confirm (1) after pressing the [F5] key that the "Num" column is now sequential.  Save (2) your updated LOT file, and the next time you open the game your new custom menu icon should appear.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg132.imageshack.us%2Fimg132%2F2448%2F15oy1.png&hash=2de78db7837a906d8bd97e394d98d4f01b51fb5e)

If I can be of any help if you get stuck, don't hesitate to PM me.


David
Title: Re: Editing LOTs and Custom Icons
Post by: Andreas on March 31, 2008, 02:00:18 PM
Nice tutorial, David, although you can save some work by selecting the original icon, right-click and then click on "Copy Entry ID". Then right-click on the new PNG file and select "Paste Entry ID". Once you ReIndex the files, the copied ID should show up. :)

As an alternative, if you exported the LE default icon anyway, just delete it in Windows Explorer and rename a copy of your custom icon to the name of the file that you just deleted. Then go back to the Reader and import it - if you didn't delete the TGI file that was created when exporting the icon, the IDs that are stored there will be used for the new icon (this will also skip the step of manually selecting a filetype).

EDITWow, my friend- that's what I get for teaching myself how to use the Reader then trying to pass myself off as an expert.  Either of those methods will certainly save anyone a bit of time, although I'm so set in my ways I can now do it the way I described in my sleep.  Thanks! -DE
Title: Re: Editing LOTs and Custom Icons
Post by: TheTeaCat on March 31, 2008, 02:06:05 PM
Very Handy tutorial David &apls &apls
Thanks for sharing this

And Andreas too for the additional hints  :thumbsup: &apls

:satisfied:
TTC
Title: Re: Editing LOTs and Custom Icons
Post by: Pat on March 31, 2008, 03:20:37 PM
Very good tut David and I think you spent your free day well at that...
Title: Re: Editing LOTs and Custom Icons
Post by: FrankU on April 01, 2008, 06:50:19 AM
Wow David,
That's complicated. I think I'll stick to the tip given by RippleJet.
For me, I don't see what the advantages are of using the Reader. In LEprop it was just some mouseclicks. I did seven files within ten minutes, including editing the icons!
Thanks aal of you for the information.  &apls
Title: Re: Editing LOTs and Custom Icons
Post by: bat on April 03, 2008, 06:56:47 AM
Very great tutorial there, dedgren! Nice work! ;)