PDA

View Full Version : SetFXTextureReplacement() functional in TANE?



Pencil42
June 21st, 2015, 12:44 AM
I have a small number of railcars on the DLS that use SetFXTextureReplacement() to change between a random set of textures. Unfortunately, although this works in TS12, these same cars are not working in TANE. I know this was working in an earlier version of TANE, but it appears not to be working any more (at least, not in build 76401). One example would be 124060:15044 on the DLS.

Is anyone else having problems with this? Am I just doing something wrong that accidentally worked in previous versions?

Thanks,
Curtis

pcas1986
June 21st, 2015, 03:01 AM
Hi Curtis,

My guess is that the "skins" variable is null when passed into SetFXTextureReplacment() since a null variable disables the texture replacement. The function does work for me in 76401 in a test asset based on Andi's Engine Shed tutorial in the N3V WiKi.

Perhaps you could try testing/debugging the script to determine if the texture asset is loaded correctly. I did track through your boxcar script but nothing leaped out at me.

Pencil42
June 21st, 2015, 10:06 AM
Yeah, I think adding some debugging code to see what's going on is my next step. Thank you for the confirmation that the function still works :)

Curtis

norfolksouthern37
June 21st, 2015, 10:45 AM
I can confirm that the function works when I have used it, however several other functions display behavior that makes it difficult to tell if they work or not.

Pencil42
June 22nd, 2015, 12:07 AM
OK, got it. In previous versions, the texture-group could reference the tga files directly, as in:


textures
{
0 "boxcar_clean.tga"
1 "boxcar_used.tga"
2 "boxcar_used2.tga"
3 "boxcar_used3.tga"
4 "boxcar_abused.tga"
}


That appears to no longer work. When I added .texture.txt files and referenced those, as in:


textures
{
0 "boxcar_clean.texture"
1 "boxcar_used.texture"
2 "boxcar_used2.texture"
3 "boxcar_used3.texture"
4 "boxcar_abused.texture"
}

the replacement started to work.

Interestingly, the WIKI ( http://online.ts2009.com/mediaWiki/index.php/KIND_Texture-group ) still shows the direct reference, so I don't feel bad about missing this :)

Curtis

pcas1986
June 22nd, 2015, 12:39 AM
In my asset I was calling up one of Andi's texture group assets which is built in. I wonder if this issue is related to this post (http://forums.auran.com/trainz/showthread.php?120522-Correcting-content-for-TANE&p=1412463#post1412463)?

If N3V can confirm Curtis' findings I'm happy to go and correct the quoted WiKi page

WindWalkr
June 22nd, 2015, 05:28 AM
If N3V can confirm Curtis' findings I'm happy to go and correct the quoted WiKi page

It's definitely the case that all texture references should be via "*.texture". Using image files in place of texture files has been discouraged for a long time, and emulation of this feature doesn't exist in T:ANE except for a few very specific use-cases such as coronas where the "*.tga" usage was simply to prevalent to disallow.

chris

Pencil42
June 22nd, 2015, 10:21 AM
Thanks, Chris, for the confirmation! It might be nice to flag this as an error when you get a chance; it took me a couple of weeks to figure this one out. I've also updated the WIKI page above.

Curtis

WindWalkr
June 22nd, 2015, 06:37 PM
It might be nice to flag this as an error when you get a chance; it took me a couple of weeks to figure this one out.

Will do.



I've also updated the WIKI page above.

Appreciate it. Thanks.

chris