YesNoOk
avatar

Animation Resetting [Stage Help] (Read 160 times)

Started by Sol Knight X, April 09, 2013, 01:26:51 am
Share this topic:
Animation Resetting [Stage Help]
#1  April 09, 2013, 01:26:51 am
  • ***
  • Yo I'm the best maang. I diiiiiiiiiid it.
    • Puerto Rico
    • Skype - solknightx
Alright, so I'm working on a new stage that involves moving animations of fishes. As much as I'd like to simply set a velocity to each anim and slap on a tile/tilespacing code on them, there's that little bug where the sprite disapppears when it at the right side of the screen. Is there a way to make an animation move across the screen, stop when it reaches a certain point  (Off screen or behind some rock walls i used from ecco) and start back up on the other side of the screen? I would think that you could use bgctrl to do it, but I'm not sure how to exactly.
Re: Animation Resetting [Stage Help]
#2  April 09, 2013, 01:55:30 am
  • *****
  • Most dangerous person in Mugen
    • USA
    • caddie.smeenet.org
You can use bgctrls to do that. It's a little tough to get it down because you have to use precise time triggers to get it right. You need a def for your BGctrl like this:

[BGCtrlDef Fish]

Then controllers typically look like this:

[BGCtrl floor]
type = velset
x = 1
time = 0,0, 769
ctrlid = 1

To explain this, this is saying set the velocity of the layer with the id '1' to x = 1 during the 0 tick til the 0 tick(that's what those two 0's are), and to loop this after 769 ticks. You can define a layer with the following line in your layers:

id = 1

And there you go. Have it set to go one way for a bit, then have it set to go another way for a bit. If you wanna have it switch directions visibly, you'll have to either time the loop in your air file, or have two identical animations playing, one invisible and one visible, and one of them mirrored. Switch which is visible when the directions are changed.

[BGCtrl]
type = Visible
time = 0,0, 769
value = 1
ctrlid = 1

[BGCtrl]
type = Visible
time = 0,0, 769
value = 0
ctrlid = 2

[BGCtrl]
type = Visible
time = 300,300, 769
value = 0
ctrlid = 1

[BGCtrl]
type = Visible
time = 300,300, 769
value = 1
ctrlid = 2

Something like that.
Re: Animation Resetting [Stage Help]
#3  April 09, 2013, 05:27:20 am
  • ***
  • I work at Elecbyte as a sexy janitor.
    • USA
    • tamez.smeenet.org
Alright, so I'm working on a new stage that involves moving animations of fishes. As much as I'd like to simply set a velocity to each anim and slap on a tile/tilespacing code on them, there's that little bug where the sprite disapppears when it at the right side of the screen.

There is a way to avoid that bug. 

Also, to avoid the problem of stuff disappearing when it is only partially offscreen when on the right side, it would be good to specifically recommend that tiled animation sprites be placed at 0 for the X value in the .sff. 

Use the "start = " parameter of your stage element to determine it's location in the stage instead of using the .sff to do so. 


Is there a way to make an animation move across the screen, stop when it reaches a certain point  (Off screen or behind some rock walls i used from ecco) and start back up on the other side of the screen? I would think that you could use bgctrl to do it, but I'm not sure how to exactly.

You say "stop" but do you really need it to stop?  Or just reappear off screen on the other side? 

Sounds like you only have one animation and it will be heading the same direction the entire match. 
You can set that up with background controllers like this: 

Code:
[BG Fish];---------You'll need to assign an ID number to the animation you want to control
(regular animation info here)
ID = 1;--------------ID number must match ctrlID number below. 

[BGCtrlDef Fish]
ctrlID = 1;----------ctrlID number must match ID number above. 
looptime = #;--------Set the looptime to the amount of ticks it takes for your fish to leave the screen (60 ticks is one second)

[BGCtrl 1, Fish Position]
type = PosSet;-------This PosSet resets the position of the animation back to its original position when the loop starts. 
time = 0
x = 0
y = 0

[BGCtrl 1, Fish Velocity]
type = VelSet;-------This VelSet sets your stage item in motion at the beginning of the match. 
time = 0
x = #;---------------Set this value to the horizontal speed you want the animation to move. 
y = 0

Doing it this way means you only have one global looptime to change when you are testing the stage and determining how fast you want the fish to go and how long it takes them to reappear. 

If you have multiple animations to control, and they are all going to move in the exact same motion together, you can give them ALL the ID=1 and this one set of codes will control all of them. 

If you have multiple animations to control, and they are all going to move differently then you can give them their own IDs, and give them a copy of the background controller set up and only have to change their ctrlID value, the looptime, and the x value in the VelSet.