• Welcome to SC4 Devotion Forum Archives.

RHW (RealHighway) - Development and Support

Started by Tarkus, April 13, 2007, 09:10:49 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

GDO29Anagram

Quote from: Indiana Joe on September 17, 2013, 08:24:54 PM
This is glorious...except it doesn't maintain transparency.

Yeah, I typically restore the transparency myself using Paint.NET and a grid generator plugin for Paint.NET...
<INACTIVE>
-----
Simtropolis | YouTube | MLP Forums

MandelSoft

Well, there's also the Colour/Alpha blender on that same page. Images generated by that tool will keep their transparency when cutted down to size.

Or you could just cut both colour and alpha maps separately. Don't forget to add an "_a" suffix to it (it also help to add a "0x" prefix. This will make the PNG to FSH Batch Tool automatically recognise the right IIDs)
Lurk mode: ACTIVE

Indiana Joe

Except I'm working with a gradient...so that complicates things.

Congratulations on your success by the way Droric.

droric

Quote from: Indiana Joe on September 18, 2013, 02:09:18 PM
Except I'm working with a gradient...so that complicates things.

Congratulations on your success by the way Droric.

I take it you do not have access to Photoshop?  I used the slice tool to divide and save with transparency.

PC Specs: i2700k @ 4.9 Ghz, 16 GB @ 1600-8-9-8-16, 2X GTX 580 SLI, Gigabyte Z68XP-UD3R, 120 GB Vertex 3 SDD, 3 TB RAID1, 1200W SilentGold, Antec P180B case, Win 8 x64 Pro

Indiana Joe

That's exactly what I've been using, but you have to manually name each texture.  I'm trying to streamline the process as I work on two complete railroad texture sets.  This image cutter script Ganaram linked me to is ideal because it automatically names the textures, except that it doesn't output alpha-blended (transparent) images.

Tarkus

I've tended to use a GIMP script for slicing.  It doesn't take care of the renaming, unfortunately.

Also, things are progressing on QuickChange . . . whatever that is. ::)

-Alex


Indiana Joe


Indiana Joe

Quote from: Indiana Joe on September 18, 2013, 05:27:21 PM
Quote from: Tarkus on September 18, 2013, 04:32:44 PM
Also, things are progressing on QuickChange . . . whatever that is. ::)




...But really, if that online script would just output transparency, it would be perfect for what I need right now.  Would the creators/owners of it happen to be actively maintaining it?

Tarkus

It does output transparency.  The last update appears to have been in May 2012--the plugin is called ATG Slice and Join.  Once it's installed, it'll show up under Filters > ATG.

-Alex

metarvo

Nice work, Droric.  :thumbsup:  You've caught on to puzzle pieces so quickly.
Find my power line BAT thread here.
Check out the Noro Cooperative.  What are you waiting for?  It even has electricity.
Want more? Try here.  For even more electrical goodies, look here.
Here are some rural power lines.

droric

Thanks everyone for the positive encouragement.  And Indiana Joe I'm going to try to write you a script to rename based on autotilebaseiid width and height automatically rename files as long as they are in a single folder and ordered numerically (aka unrenamed from photoshop's slice tool).  I sort of wanted to make this earlier for my pieces.  I'll post what I come up with.

PC Specs: i2700k @ 4.9 Ghz, 16 GB @ 1600-8-9-8-16, 2X GTX 580 SLI, Gigabyte Z68XP-UD3R, 120 GB Vertex 3 SDD, 3 TB RAID1, 1200W SilentGold, Antec P180B case, Win 8 x64 Pro

Indiana Joe

Quote from: droric on September 19, 2013, 06:26:36 AM
Thanks everyone for the positive encouragement.  And Indiana Joe I'm going to try to write you a script to rename based on autotilebaseiid width and height automatically rename files as long as they are in a single folder and ordered numerically (aka unrenamed from photoshop's slice tool).  I sort of wanted to make this earlier for my pieces.  I'll post what I come up with.

You're my new favorite person.  :thumbsup:  &apls

droric

#11612
Quote from: Indiana Joe on September 19, 2013, 01:06:28 PM
Quote from: droric on September 19, 2013, 06:26:36 AM
Thanks everyone for the positive encouragement.  And Indiana Joe I'm going to try to write you a script to rename based on autotilebaseiid width and height automatically rename files as long as they are in a single folder and ordered numerically (aka unrenamed from photoshop's slice tool).  I sort of wanted to make this earlier for my pieces.  I'll post what I come up with.

You're my new favorite person.  :thumbsup:  &apls

Oookie Dookie

For anyone who hasn't been following, this script will rename PNG files based on your autotilebaseiid so it is possible to maintain transparency when exporting slices from whatever photo application you are using.  Essentially a replacement for the image cutter tool (minus the cutting part)

Make a backup first since I just wrote this and ran through it a few times with no errors but i always advise a backup when your doing a batch action.  If you get any errors please let me know so I can try to fix them.  I might give this a Windows front-end since I also want to redo the paths tool since I can't stand it.

If you are not experienced with powershell you will need to do the following.
1. Save contents of code to a file with an extension of .PS1
2. Open powershell as an administrator and run this command 'set-executionpolicy remotesigned'
3. Place the script in the folder with the images from photoshop and right click the PS1 and hit run with powershell
4. Follow the prompts to fill in autotilebaseiid height and width
5. Profit?

For this to work the files must be .PNG and named from left to right numerically row by row, (this is the default of the photoshop slice tool).


$AutoTileBaseIID = (Read-Host "Enter the autotilebase IID (do not include the 0x prefix)")

[int]$Height = Read-Host "Please enter the height of the puzzle piece"

[int]$Width = Read-Host "Please enter the width of the puzzle piece"
$AutoTileBaseIID = [convert]::ToInt32("$AutoTileBaseIID", 16)

$Row = @()
$Row += ($AutoTileBaseIID)
$Row += ($AutoTileBaseIID + 16)
$Row += ($AutoTileBaseIID + 32)
$Row += ($AutoTileBaseIID + 48)
$Row += ($AutoTileBaseIID + 64)
$Row += ($AutoTileBaseIID + 80)
$Row += ($AutoTileBaseIID + 96)
$Row += ($AutoTileBaseIID + 112)
$Row += ($AutoTileBaseIID + 128)
$Row += ($AutoTileBaseIID + 144)
$Row += ($AutoTileBaseIID + 160)
$Row += ($AutoTileBaseIID + 176)
$Row += ($AutoTileBaseIID + 192)
$Row += ($AutoTileBaseIID + 208)
$Row += ($AutoTileBaseIID + 224)
$Row += ($AutoTileBaseIID + 240)

[int]$index = $width * $height
$files = (Get-Childitem *.png)
$i = 0

If ($i -ne ($index - 1)) {

For ($hindex = 0; $hindex -lt $Height; $hindex++) {
For ($windex = 0; $windex -lt $Width; $windex++) {
$value = ("0x" + ("{0:X0}" -f ($Row[$hindex] + ($windex * 256))) + ".png")
rename-item $files[$i] $value
# write-host $i
# write-host $windex
# write-host $hindex
$i++
}
}
}

PC Specs: i2700k @ 4.9 Ghz, 16 GB @ 1600-8-9-8-16, 2X GTX 580 SLI, Gigabyte Z68XP-UD3R, 120 GB Vertex 3 SDD, 3 TB RAID1, 1200W SilentGold, Antec P180B case, Win 8 x64 Pro

Durfsurn

Saw this somewhere:   0xBADB57F1
What Could it mean?


GDO29Anagram

#11614
Quote from: Durfsurn on September 20, 2013, 04:40:46 PM
Saw this somewhere:   0xBADB57F1
What Could it mean?

Probably just a Type ID or Group ID for something like textures or models. If it's an Instance ID, it has nothing to do with the NAM, since nearly everything is grouped in the 0x50000000 to 0x5FFFFFFF IID range. (I'd have to double-check.)

Yeah, that's the Group ID for S3D files. Full TGI is 0x5ad0e817 0xbadb57f1 0x########.
<INACTIVE>
-----
Simtropolis | YouTube | MLP Forums

droric

Is it possible for path files for puzzle pieces to exit from a corner and enter inter a corner of a tile?

Like this?

.|
|.

PC Specs: i2700k @ 4.9 Ghz, 16 GB @ 1600-8-9-8-16, 2X GTX 580 SLI, Gigabyte Z68XP-UD3R, 120 GB Vertex 3 SDD, 3 TB RAID1, 1200W SilentGold, Antec P180B case, Win 8 x64 Pro

memo

No, it's not. Also, I wouldn't recommend using a path with both entry and exit point 8,8,0 in the corners, in such a case. I may be wrong on this, but I think it causes glitches when the automata passes because the path does not have a direction. Instead, I'd recommend using entry/exit points like this
7.999,8,0
8,7.9856,0
in order to reflect the desired direction. Shifting a path by such a small amount won't make a visible difference in the game.

droric

Quote from: memo on September 20, 2013, 05:48:12 PM
No, it's not. Also, I wouldn't recommend using a path with both entry and exit point 8,8,0 in the corners, in such a case. I may be wrong on this, but I think it causes glitches when the automata passes because the path does not have a direction. Instead, I'd recommend using entry/exit points like this
7.999,8,0
8,7.9856,0
in order to reflect the desired direction. Shifting a path by such a small amount won't make a visible difference in the game.

Yeah my pieces have a pathing issue with traffic when its at an 8,8 crossing.  I'll go fix it, thanks.

PC Specs: i2700k @ 4.9 Ghz, 16 GB @ 1600-8-9-8-16, 2X GTX 580 SLI, Gigabyte Z68XP-UD3R, 120 GB Vertex 3 SDD, 3 TB RAID1, 1200W SilentGold, Antec P180B case, Win 8 x64 Pro

Geometry123

#11618
Quote from: Durfsurn on September 20, 2013, 04:40:46 PM
Saw this somewhere:   0xBADB57F1
What Could it mean?

Probably a mystery... :D
You will never know when will the next NAM be released. Only time teasing will tell. :P

"We're making SimCity, not some dopey casual game"
                                                 -Ocean Quigley