YesNoOk
avatar

Problem with tile (Read 2033 times)

Started by DeCeballos, June 08, 2022, 07:13:40 pm
Share this topic:
Problem with tile
#1  June 08, 2022, 07:13:40 pm
  • **
    • Spain
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?
Last Edit: June 16, 2022, 07:37:45 am by DeCeballos
Re: Problem with tile
#2  June 08, 2022, 07:19:31 pm
  • ***
    • Peru
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.
Re: Problem with tile
#3  June 08, 2022, 07:24:31 pm
  • **
    • Spain
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.
Re: Problem with tile
#4  June 08, 2022, 07:28:04 pm
  • ***
    • Peru
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
Re: Problem with tile
#5  June 08, 2022, 07:36:54 pm
  • **
    • Spain
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
Re: Problem with tile
#6  June 08, 2022, 07:44:58 pm
  • ***
    • Peru
[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.
Re: Problem with tile
#7  June 08, 2022, 07:50:23 pm
  • **
    • Spain
This is

 [Begin Action 99]
20,1, 0,0, 10
Re: Problem with tile
#8  June 08, 2022, 07:53:41 pm
  • ***
    • Peru
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
Re: Problem with tile
#9  June 08, 2022, 07:59:17 pm
  • **
    • Spain
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
Re: Problem with tile
#10  June 09, 2022, 06:25:30 pm
  • **
    • USA
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.

Quote
window = 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:

Quote
window = 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)--

Quote
window = 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!
Re: Problem with tile
#11  June 16, 2022, 07:37:20 am
  • **
    • Spain
Thanks, solved!