Jump to content
  • 0

Act Editor: Layer ID read/modify SpriteIndex


Gianluca280395

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  09/03/16
  • Last Seen:  

Hello everyone; some time ago I made a sprite, and for some reason, a few images weren't saving when I closed the act editor, throwing a ton of animation work into trash. Every time I tried to add these images, after saving, they would just disappear. After some time I found that converting them to index8 kept them after saving, for some reason...

So the problem now is how to fix every frame in all actions, so they use the correct image:

image.png.8ab470888c275a61b5f673fd0d99c084.png

here, in ID 2, 3 and 4, the sprite indexes need to be edited to have the original image, but I couldn't find any way to access specifically these IDs; I'm using a sample script modified from the documentation:

var layer = act.TryGetLayer(selectedActionIndex, selectedFrameIndex, 0);
 
if (layer != null) {
    layer.SpriteIndex = 39;
}

Running that script modifies the sprite on ID 0 to be the 39, but I needed that the ID 2 to be changed.

So the question is: How can I make a script that will modify any ID, and not only the ID 0?

Thanks in advance!

 

Edit: It was so damn obvious ¬¬' thanks anyway

if anyone is wondering, the ID is the last parameter in TryGetLayer

Edited by Gianluca280395
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...