Re: [tsc-devel] Switch directory name change impacts level scripts...

Luiji Maryo | Thu, 01 Sep 2016 23:46:06 UTC

Maybe it'd be better to put the compatibility code in the texture
manager instead of the level loader? That way anything that calls for
pixmaps will get the same functionality

On Thu, Aug 25, 2016 at 3:36 AM, Marvin Gülker <…r@p…> wrote:
> On Thu, Aug 25, 2016 at 04:19:07AM +0000, datahead wrote:
>> Post via forum by datahead <…9@x…>:
>> The full path for switches is TSC/tsc/data/pixmaps/ground/underground/switch
>> Apparently, at some point the directory name was changed from pow to switch.
>> Levels that used the old directory name in their scripts need to
>> change.
>
> This shouldn't be necessary. I thought I added compatibility code to
> level_loader.cpp that automatically replaces the pathes. Maybe there's
> an error in that code?
>
>> desert_break_in.tsclvl:        UIDS[4291].image = "ground/underground/pow/blue_active.png"
>> desert_break_in.tsclvl:        UIDS[4291].image =
>> "ground/underground/pow/blue_active.png"
>> quintus_3.tsclvl:    switch.image =
>> "ground/underground/pow/blue_active.png"
>
> However, *these* are not affected by the compatibility code as the
> compatibility code is only run when loading level objects from the level
> XML. Scripting functionality is not covered. For this particular case,
> however, using the Switch class from the SSL would have prevented that
> error as its internals were changed as well, with the API remaining the
> same.
>
> Vale,
> Quintus
>
> --
> Blog: http://www.guelkerdev.de
> PGP/GPG ID: F1D8799FBCC8BC4F
>