Problem with tile

Started by DeCeballos, June 08, 2022, 07:13:40 PM

Previous topic - Next topic

DeCeballos

Hello, I want to create a tiled image of smoke from behind an image of a car, but the problem is that the image always appears from the bottom of the screen. How can I get the smoke image to be generated from its own coordinate position to What is coming out from behind the car?

Charles_2011

Hello DeCeballos.

This is just an example:

Move the smoke in the start secction, change the numbers until you achive what you want:

[BG 3] ; SMOKE
type  = normal
spriteno = 3,0
start = 0,-90
delta =  .653035,0.38
tile=1,0
tilespacing=-3,0
scalestart=0.45,0.45
zoomdelta= 0.38
mask = 1

I hope this example help you.

DeCeballos

I already have the position of the image. The problem is that the smoke rises and disappears. I want to create an infinite loop effect of smoke.

Charles_2011

Use this "loopstart":

[Begin Action 7] ; SMOKE animation
loopstart
12,0, 0, 0, 4
12,1, 0, 0, 4
12,2, 0, 0, 4
12,3, 0, 0, 4
12,4, 0, 0, 4
12,5, 0, 0, 4

DeCeballos

Could you explain it to me better? I don't quite understand the animation

This is my line of smoke

[BG smoke]
type = anim
actionno = 99
start = 145, 210
delta = .6,.79
mask = 1
layerno = 0
velocity = 0, -0.1
tilespacing = -1,-1
tile = 0,1
trans = addalpha
alpha = 15,210

Charles_2011

[BG smoke]
type = anim
actionno = 99
start = 145, 210
delta = .6,.79
mask = 1
layerno = 0
velocity = 0, -0.1
tilespacing = -1,-1
tile = 0,1
trans = addalpha
alpha = 15,210

I can see that you have "actionno = 99", so, you have to search "[Begin Action 99]", that´s the animation of the smoke.

DeCeballos

This is

[Begin Action 99]
20,1, 0,0, 10

Charles_2011

Correct, but, is there only one line? Animations like a smoke effect should have more lines of code.

Use something like this:

[Begin Action 99]
loopstart
20,1, 0,0, 10
20,2, 0,0, 10
20,3, 0,0, 10
20,4, 0,0, 10

DeCeballos

I don't know if it's what I need. What I want is for the tiled image to go up and when the image is finished it reappears right where it starts instead of at the bottom of the screen

Amanojaku

I believe the effect you're wanting can be accomplished with the "window" parameter, which specifies which area of the screen an element can appear in.

Quotewindow = x1(screen left), y1(screen top), x2 (screen right), y2 (screen bottom)

The part in bold is the one which will do the trick. The x1,y1 coordinates start at the top-right (0,0), while the x2,y2 is the bottom left. What numbers these will be is determined by what the native resolution (localcoord) of your stage is. So for example, if your stage is LR 320x240, then the default would be:

Quotewindow = 0, 0, 320, 240

Since you want don't want the animation to appear below a certain point on the screen, then subtract how far up the screen you want the smoke to start appearing from the y2 value. So for example, if the point is 40 pixels above the bottom of the screen, then it would be (240 - 40)--

Quotewindow = 0, 0, 320, 200

--and the animation won't be drawn outside those points. You'll need to adjust the numbers based on what your localcoord and where you want the start point to be, but it should do the trick. Note that if you're using Mugen 1.1, then you might want to opt for the updated "maskwindow" parameter, which uses coordinates based on the CENTER, rather than the far right (consult the "bgs" file in the "docs" folder for more info).

Hope this helps!

DeCeballos