Jump to content

how to compile for AnimState:Hide


Mobbstar

Recommended Posts

I've made a spriter animation (bookcase.zip), and tried to use AnimState:Hide() in order to hide a texture (using the directory name, ofc). However, after letting the autocompiler do its work, it won't hide.

 

To test whether code/animation are faulty, I decompiled and recompiled the banana tree. Result: there's some weird thing you need to do to your texture or animation for Hide/Show to work.

 

Does anybody have a clue to what sensible witchery is required here? @DeathDisciple?

Link to comment
Share on other sites

AnimState:Hide AnimState:Show are taking layer name as argument, not symbol name. SCML compiler exports layer names as timeline_id which is... next to useless and highly frustrating to even try to use (it implies that a layer consists only of a single spriter object, frustrating because you cant even know the id without looking into scml file, and tying your code to the autoincrement id is beyond silly).

 

So basically you have multiple options, depending on what fits your needs

 

1. use timeline_id that it generates (you can look for it either in scml file itself or in animation.xml in intermediate files)

 

2. change layer name in intermediate animation.xml and rerun the python exporter script manually after running autocompiler - the file you want to change is e.g.animation.xml that is in bookcase.zip in bookcase folder - the actual syntax of exporter is logged in the autocompiler log if you want to go that route but it's, again, highly annoying thing to do

 

3. change the pipeline or change scml compiler to do something saner. What I did is change compiler to use spriter object name and either parse for LAYER_something and use that something as a layer name or use object name directly. That was the sanest way I could come up with to make custom player animations possible. The longest path but the only one actually fixing the issue for good imo. If you go that way, feel free to check the fork if it does what you want.

 

That's all I know.

Link to comment
Share on other sites

AnimState:Hide AnimState:Show are taking layer name as argument, not symbol name. SCML compiler exports layer names as timeline_id which is... next to useless and highly frustrating to even try to use (it implies that a layer consists only of a single spriter object, frustrating because you cant even know the id without looking into scml file, and tying your code to the autoincrement id in spriter is beyond silly).

 

So basically you have multiple options, depending on what fits your needs

 

1. use timeline_id that it generates (you can look for it either in scml file itself or in animation.xml in intermediate files)

...

 

That's all I know.

 

That is indeed odd, not to say erroneous.

 

The autocompiler tries to keep everything up-to-date, so I assume the first method is the most solid one. The second one, as you said, sounds rather sophisticated, and the third one only works for me and not end users.

 

Other than being annoying, it works. I suppose that's why I couldn't get OverrideSymbol to work either...

 

Thank you very much for patience and toil.

Link to comment
Share on other sites

That is indeed odd, not to say erroneous.

 

The autocompiler tries to keep everything up-to-date, so I assume the first method is the most solid one. The second one, as you said, sounds rather sophisticated, and the third one only works for me and not end users.

 

Other than being annoying, it works. I suppose that's why I couldn't get OverrideSymbol to work either...

 

Thank you very much for patience and toil.

 

What do you mean 3rd method doesn't work for end users? Why would end users care about mod tools, or recompile your assets? I typically strip away exported folder + any pngs etc from the mod when uploading due to size alone.

 

EDIT: I'm not sure what would OverrideSymbol do with anything tho, since symbol names are directory names.

Link to comment
Share on other sites

What do you mean 3rd method doesn't work for end users? Why would end users care about mod tools, or recompile your assets? I typically strip away exported folder + any pngs etc from the mod when uploading due to size alone.

 

EDIT: I'm not sure what would OverrideSymbol do with anything tho, since symbol names are directory names.

 

I know a few people who have the mod tools, but you're right, I usually exclude spriter/fmod projects too.

 

But their symb.. d'oh! :wilsondisappointed: nvm

Link to comment
Share on other sites

I know a few people who have the mod tools, but you're right, I usually exclude spriter/fmod projects too.

 

But their symb.. d'oh! :wilsondisappointed: nvm

 

Sure, some do, I meant if spriter projects are removed they wouldn't get a chance to recompile (and hence break the patch). But on the other hand, the need to keep manual builds whenever klei changes mod tools and/or keep people you work with informed of it might be more of a hassle. And I suppose they could decide to go closed source at some point too, but that doesn't seem too likely.

 

Regardless, whatever works :p

Link to comment
Share on other sites

I know a few people who have the mod tools, but you're right, I usually exclude spriter/fmod projects too.

 

But their symb.. d'oh! :wilsondisappointed: nvm

Pro tip: if your mod folder has a file called NOAUTOCOMPILE (no extension suffix, contents are arbitrary, i.e. may be a blank file) then the mod tools won't autocompile it. Including that in your release zip/workshop folder should prevent other people's versions of the mod tools from recompiling your stuff.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...