Fglayer help

AlexDC22

Well-known member
So am trying to use fglayer but it crashes..log days fglayer command not understood..so i imagine it needs a script? Ive looked but cant find a script...thanks
 
bglayer is similar to fglayer, but the only difference is that fglayer has a z parameter.

fglayer {path} {z} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio} {quake} {neon}

  • This is for setting custom foreground layer in current level.
  • {path} is the location relative to data folder where the graphic is
  • Just like any image used by OpenBoR, fglayers must use paletted images. In 8 bit colourdepth (default), it must use same palette as ‘background’ (see above). In 16/32 bit, it can use different palette
  • Beware though, if bglayers use different palette than background, ‘palette’ command (see below) won’t work
  • {z} sets location of the layer. Give positive value to make it closer to screen or negative value to make it farther from screen.
  • Other parameters ( {xratio}, {zratio}, {xposition}, {zposition}, {xspacing}, {zspacing}, {xrepeat}, {zrepeat}, {transparency}, {alpha} and {bgspeedratio} ) have same effect like in ‘bglayer’ above.
  • {quake} is a boolean setting. 0 (default) will make the layer to not shake when the screen a quake happens. 1 will make it to shake.
  • {neon}, unlike panel, IS NOT the path to the file we will use as neon, it is a boolean value:
    • 0 disabled (default)
    • 1 enabled
  • Neon uses ‘pallete cycling’: certain colors slowy change to different colors. To be more specific, colors 128 through 135 in the pallete will be cycled by two steps three times each second. Note: It must be using the global palette (as in, using same palette as background) for Neon to work.
  • {watermode}, {amplitude}, {wavelength} and {wavespeed} also works for bglayer and background (but not for frontpanel) – 6391+

Example:
Code:
#### PLEASE USE BOTH THESE IMAGES AS HUD FOR YOUR PLAYER(S) UNLESS IT'S BONUS STAGE #######
fglayer data/sprites/hud_base.png -1 1 0 3 3 1 1 1 1 1 0 0 0 0 0 0
fglayer data/sprites/hud.png -1 1 0 3 3 1 1 1 1 1 0 0 0 0 0 0
###########################################################################################

#### MAIN BG #########
bglayer        data/bgs/ryu/0-0.png 0.4365 0 0 -26 1 1 1 1 1 0 0 0 0 0 0
bglayer        data/bgs/ryu/0-1.png 0 0 0 -10 0 0 -1 1 1 0 0 0 0 0 0.83
bglayer        data/bgs/ryu/0-2.png 0 0 0 -30 0 0 -1 1 1 0 0 0 0 0 0.653
bglayer        data/bgs/ryu/0-3.png 0.17 0 0 73 1 1 1 1 1 0 0 0 0 0 0
panel        data/bgs/ryu/0-4-ryu.png
bgspeed 7
order a
direction both
settime 0
notime 1
type 1

My Mod - 0827.png

Here's a guide for both bglayer and fglayer.

BGLAYER


# xratio/zratio - 0.5 same scroll like background; 1 same scroll like panel
# panel type entity - 10 times xratio or zratio speed for background if speed is 5; e.g. speed 5 type panel - move like background

#bglayer 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# 0 - path
# 1 - xratio
# 2 - zratio
# 3 - xposition
# 4 - zposition
# 5 - xspacing
# 6 - zspacing
# 7 - xrepeat
# 8 - zrepeat
# 9 - transparency
# 10 - alpha
# 11 - watermode (if set to 3, next 3 parameters become beginsize, endsize and perspective; if set to 1, water effect will play)
# 12 - amplitude (if watermode set to 1, not 3) / beginsize (if watermode set to 3, not 1)
# 13 - wavelength (if watermode set to 1, not 3) / endsize (if watermode set to 3, not 1)
# 14 - wavespeed (if watermode set to 1, not 3) / perspective (if watermode set to 3, not 1)
# 15 - bgspeedratio
# 16 - quake
# 17 - neon

# In perspective mode
#~{perspective} defines z depth effect it should have

# 0 = No effect (default)
# 1 = Perspective & tile
# 2 = Perspective & stretch

#~{bgspeedratio} determines the moving ratio of this bglayer relative to main background. Defaults to 0 (no movement).


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

FGLAYER



# xratio/zratio - 0.5 same scroll like background; 1 same scroll like panel
# panel type entity - 10 times xratio or zratio speed for background if speed is 5; e.g. speed 5 type panel - move like background

#fglayer {path} 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# 0 - z
# 1 - xratio
# 2 - zratio
# 3 - xposition
# 4 - zposition
# 5 - xspacing
# 6 - zspacing
# 7 - xrepeat
# 8 - zrepeat
# 9 - transparency
# 10 - alpha
# 11 - watermode (if set to 3, next 3 parameters become beginsize, endsize and perspective; if set to 1, water effect will play)
# 12 - amplitude (if watermode set to 1, not 3) / beginsize (if watermode set to 3, not 1)
# 13 - wavelength (if watermode set to 1, not 3) / endsize (if watermode set to 3, not 1)
# 14 - wavespeed (if watermode set to 1, not 3) / perspective (if watermode set to 3, not 1)
# 15 - bgspeedratio
# 16 - quake
# 17 - neon

# In perspective mode
#~{perspective} defines z depth effect it should have

# 0 = No effect (default)
# 1 = Perspective & tile
# 2 = Perspective & stretch

#~{bgspeedratio} determines the moving ratio of this bglayer relative to main background. Defaults to 0 (no movement).

# In perspective mode
#~{perspective} defines z depth effect it should have

# 0 = No effect (default)
# 1 = Perspective & tile
# 2 = Perspective & stretch

#~{bgspeedratio} determines the moving ratio of this bglayer relative to main background. Defaults to 0 (no movement).
 
Last edited:
i am having these issues now...not sure why... apologies thanks

Code:
background     data/BGS/level1/road.gif
panel          data/BGS/level1/fense.gif
frontpanel     data/bgs/level1/front.png
#fglayer | path | z-1 | xratio-2 | zratio-3 | xposition-4 | zposition-5 | xspacing-6 | zspacing-7 | xrepeat-8 | zrepeat-9 | transparency-10 | alpha-11 | watermode-12 | amplitude-13 | wavelength-14 | wavespeed-15 | bgspeedratio-16 | quake-17 | neon-18
fglayer data/BGS/level1/swalk.gif        -1   0   0   0   1   0   0   1   1   0   1  0  0  0  0  0  0  0 
fglayer data/BGS/level1/house1.gif       -1   0   0   0   1   0   0   1   1   0   1  0  0  0  0  0  0  0 
fglayer data/BGS/level1/house2.gif       -1   0   0   0   1   0   0   1   1   0   1  0  0  0  0  0  0  0 
fglayer data/BGS/level1/garage.gif       -1   0   0   0   1   0   0   1   1   0   1  0  0  0  0  0  0  0 
fglayer data/BGS/level1/gdoor.gif        -1   0   0   0   1   0   0   1   1   0   1  0  0  0  0  0  0  0 
fglayer data/BGS/level1/brickwall1.gif   -1   0   0   0   1   0   0   1   1   0   1  0  0  0  0  0  0  0 
fglayer data/BGS/level1/brickwall2.gif   -1   0   0   0   1   0   0   1   1   0   1  0  0  0  0  0  0  0
 

Attachments

  • paxplode - 0000.png
    paxplode - 0000.png
    50.1 KB · Views: 2
so the pink issue is fixed, it was one of the images for whatever reason but i fixed that... now i am still behind everything... now i have the Z at -1 and that should send the panels to the back right? thats what the Z is for or am i wrong?
i dont need the ratio things on this level so why theyre all empty. sorry i know i keep buggin but i am trying for hours and i think i understand the logic better now but still stuck
Code:
background     data/BGS/level1/road.gif
panel          data/BGS/level1/fense.gif
frontpanel     data/bgs/level1/front.png

fglayer data/BGS/level1/swalk.gif       -1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0
fglayer data/BGS/level1/brickwall1.gif  -1.5 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0
fglayer data/BGS/level1/road.gif        -1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0

so theyre still over characters... now for Z stacking... so if i want to display swalk over brickwall1, those Z numbers should be correct right? i reversed them as well and still same result with brickwall1 still over swalk...
i know am using road twice, is cus it keeps scrolling and it looks weird and having an empty gif there will not display the character shadows for some reason
also the transparency set to one dont seem to matter what setting as it changes nothing... am sorry this is kicking my ass badly.
thanks
 
You have to experiment with the Z, because it's tied to a lot of things, including the Z boundaries for stage. I could dig up the exact math, but honestly it's quicker and easier to just play with it until you find a working value.

You might have to move it a few hundred or more pixels to find the sweet spot and then adjust.

DC
 
You have to experiment with the Z, because it's tied to a lot of things, including the Z boundaries for stage. I could dig up the exact math, but honestly it's quicker and easier to just play with it until you find a working value.

You might have to move it a few hundred or more pixels to find the sweet spot and then adjust.

DC
yeah hommie dont play that game lol
and i think i moved them over that amount already... i wanted to do things without workaround and do things the correct way per say... but screw it am am gonna do it non types and spawn them.. it works fine like that but i like i said wanted to do things the correct way... ill just have to add a lot more of know items to models.. thanks for the reply tho i do appreciate it :)
 
I suggest that you use fglayer instead of none type cause it is easier to set up than the latter.
Try these for now:
Code:
fglayer data/BGS/level1/brickwall1.gif  -150 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/swalk.gif       -100 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/road.gif        -100 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
 
I suggest that you use fglayer instead of none type cause it is easier to set up than the latter.
Try these for now:
Code:
fglayer data/BGS/level1/brickwall1.gif  -150 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/swalk.gif       -100 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/road.gif        -100 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
thats an extremely high - number... i only went up to 25 cus i dont have that many layers so that didnt seem logical... but yeah maxman also suggested the higer numbers.. will test in a bit... in the hospital with my son atm. thanks
 
I suggest that you use fglayer instead of none type cause it is easier to set up than the latter.
Try these for now:
Code:
fglayer data/BGS/level1/brickwall1.gif  -150 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/swalk.gif       -100 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/road.gif        -100 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
ok fixed thanks again brother...
so basically i was doing it right and or had the right idea.... just the Z - had to be way higher that what i thought was logical as for panel types ive only gone to -3 and they display as they should... so that makes no sense to me smfh... the other was the alpha but when ever i turn it off you get blocked completely cus i didnt have a super high Z- number so there was no way to tell without fixing that first. And for the record anything under -140 it would still be in front for whatever reason.
didnt need more settings since i made all the panels the same size since well ive been gone forever and all these are new to me.. but this is a step in the right direction and i appreciate all of your responses.
thanks again to all of you for your patience with this old man xD

Code:
panel          data/BGS/level1/fense.gif
frontpanel     data/bgs/level1/front.png
fglayer        data/BGS/level1/road.gif            -230 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/swalk.gif           -240 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/house1.gif        -244 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/house2.gif        -245 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/garage.gif         -242 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/gdoor.gif           -243 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/brickwall1.gif     -241 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/brickwall2.gif     -246 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
fglayer        data/BGS/level1/post.gif             -239 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0
order           a
settime        0
notime         1
shadowcolor    1
 
Why can you not change xposition and zposition after z for each layer? I only see you change z, xrepeat, zrepeat, and transparency there.

fglayer {path} {z} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio} {quake} {neon}

Why not try this? Change layer position?

fglayer data/BGS/level1/road.gif -230 0 0 0 200 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/swalk.gif -240 0 0 300 200 0 0 1 1 1 0 0 0 0 0 0
fglayer data/BGS/level1/house1.gif -244 0 0 600 200 0 0 1 1 1 0 0 0 0 0 0

You can change the z value to be the same.

I guess you are confused with the positive and negative values on the z part. Below 0 is negative while above 0 is positive.

EDIT: The Z parameter doesn't have to be "big" numbers. Maybe -10 or 10 however you want. You play around with its position of being behind or front.
 
Last edited:
Incidentally, one quick and dirty trick for finding the Z position for a layer, is just create an entity that is stupidly tall (as in, below its offset, not just above) and not subject to Z boundary. Now go into the level, turn on Basic Properties debug and walk until the entity appears in front or behind items the same way you want the layer to appear. Mark the Z position and you're good to go.

DC
 
Why can you not change xposition and zposition after z for each layer? I only see you change z, xrepeat, zrepeat, and transparency there.



Why not try this? Change layer position?



You can change the z value to be the same.

I guess you are confused with the positive and negative values on the z part. Below 0 is negative while above 0 is positive.

EDIT: The Z parameter doesn't have to be "big" numbers. Maybe -10 or 10 however you want. You play around with its position of being behind or front.
if i dont have to change it why should i? as stated before i made that level intending to use it and or layer it differently since i didnt even know about the fglayer... and no i posted earlier that yeah i did understand the logic, i just didnt understand why the number had to be so high and hence why i was having most of my issues.... the level 1 boss level i had to use x and z and also had to use quake as some characters do shake the screen and is i didnt add that the panels would bounce and look idiotic lol...

i also have no use for spacing as theyre single images and the others so far i havent needed them... also not all levels will require me to use fglayer .
but thanks tho i completely get it now ;)
also i had to go even higher because otherwise it would block the light and kill my shadows. but yeah no reason to use all them if i dont have to, but is super nice to have it all in one line of code xD
baby steps ;)
Code:
music           data/music/boss.ogg   LOOP 1   
panel          data/bgs/level1/boss1.png
frontpanel     data/bgs/level1/frontb.png
fglayer        data/BGS/level1/road.gif          -150 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 2
fglayer        data/BGS/level1/postb.gif         -140 0 0 436 57 0 0 1 1 1 0 0 0 0 0 0 2
Code:
also thanks for your original replay... i like how you had the meaning of the settings i kind of stole it for reference xD
 
EDIT: The Z parameter doesn't have to be "big" numbers. Maybe -10 or 10 however you want. You play around with its position of being behind or front.
Not really. Numbers like -10 will make the layer to be behind the player, but in front of the panel.
Keep in mind that this value is affected by the level minz value, so it can change based on that value.

For my stages, I start at -400 for the background elements. See that I use -150 for the fglayer with neon, which will be behind the player but above the panel.
(in V3, there is a bug - which was already fixed on V4 - where if you set a panel with a Neon, the neon is drawn above the players shadow, so I use a transparent fglayer with the neon only).

1721790668837.png
 
Not really. Numbers like -10 will make the layer to be behind the player, but in front of the panel.
Keep in mind that this value is affected by the level minz value, so it can change based on that value.

For my stages, I start at -400 for the background elements. See that I use -150 for the fglayer with neon, which will be behind the player but above the panel.
(in V3, there is a bug - which was already fixed on V4 - where if you set a panel with a Neon, the neon is drawn above the players shadow, so I use a transparent fglayer with the neon only).

View attachment 8746
thas what i thought when i saw my shadows disapear... so i hadd to set them before them... i really like this was of setting up stages with lots of stuff going on.... in your avengers game when i first saw them i was like wtf lol... some crazy shit going on there with just about everything really lol...
 
Back
Top Bottom