Jump to content
  • 0

Act Editor : How do I set right position?


Nelly Snow

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  03/05/22
  • Last Seen:  

Hi, I'm newbie desinger, 
I wanna create an simple headgear like this jail,

I open new file with "headgear (female)", import an pic and copy to each frames.

and selected " Anchors -> Use body as base ", the pic still moving around.

Now I'm using the slow way : move an angle , adjustment one frame, import file, open game to check, close game for next frame...

each angle with 3 frames, so I repeat this for 3*9=27 times.

It's really slow and annoying, and it just a static pic, I can't do it if I wanna do the animation one.

How do I set right anchors for this?

Or I can set the manual file to my anchors?

1646491747340.gif

test3.gif

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  662
  • Reputation:   671
  • Joined:  11/12/12
  • Last Seen:  

Heya,

That's intended, surprisingly. When you are editing the hat sprite, you are viewing the world from the perspective of the hat. So if you set all the XY offsets the same, from... the perspective of the hat, nothing seems to be moving. That makes sense. But that doesn't work in-game because the body sprite has anchors points, which decides where the hat will be drawn. This position moves depending of the body's orientation. To "recreate" this, you'd have to use Anchors > Use body as base (this essentially attaches the current sprite to the body instead). In other words, this will set the perspective from the body.

Though, in the end, that's not really that helpful to you because you'd have to set the offsets one by one. Plus, that's not possible to fully match those offsets, it will never work. Instead, do the following:

  • Align all the hat's anchors points with the base body.
  • Set all the offsets to a fixed value.

This is not really possible by hand, so the following should do the trick (it uses the default body as reference, but it should be good enough):

// Change to ref_body_f.act for the female anchor points
var body = new Act(ApplicationManager.GetResource("ref_body_m.act"));

for (int aid = 0; aid < act.Actions.Count; aid++) {
	var action = act[aid];
	
	for (int fid = 0; fid < action.Frames.Count; fid++) {
		var frame = action[fid];
		var frameReference = body.TryGetFrame(aid, fid);
		
		if (frameReference != null) {
			frame.Anchors[0].OffsetX = frameReference.Anchors[0].OffsetX;
			frame.Anchors[0].OffsetY = frameReference.Anchors[0].OffsetY;
		}
	}
}

// Uncomment below if you want to set the same offsets for all your layers
//foreach(var action in act.Actions) {
//	foreach(var frame in action.Frames) {
//		foreach(var layer in frame.Layers) {
//			layer.OffsetY = -38;
//			layer.OffsetX = 0;
//		}
//	}
//}

This will achieve what you're looking for. And yes, anchors points are quite confusing.

Without using a script, this could also be done via Anchors > Set anchors > Set from file... > Select a base body sprite for reference.

Edited by Tokei
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   8
  • Joined:  06/29/20
  • Last Seen:  

Go try to adjust the XY position of all the frames into the same positions so that it will not move or maybe try to make just 1 frame into the same position because it was static as well.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  03/05/22
  • Last Seen:  

5 hours ago, Natsukashi said:

Go try to adjust the XY position of all the frames into the same positions so that it will not move or maybe try to make just 1 frame into the same position because it was static as well.

there is the files I've tested

this one I create new file, set all same x, y numbers

this is the end result with Act editor preview and in game

its static in Act editor, but not in game

all image same xyall image same xy in preview

============

This one is I manual adjustment frames by frames

its not static in Act editor, but static in game

hand adj verhand adj ver in preview

 

I'm really confuses at the anchors function, is the preset anchors have wrong?

I attach all my files, if someone can help me.

--

I'm not English base user, if I said something wrong, forgive me plz

 

act question.rar

Edited by Nelly Snow
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  110
  • Reputation:   56
  • Joined:  05/29/18
  • Last Seen:  

Headgears = Head as base
Weapons = Body as base.

Link to comment
Share on other sites

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...