Now I am working on it, and it is working fine. However, I realized I can not use this zangief.c for another level unless this level has the same number of sprites and using the same delay.
Does this mean I have to create another ones of zangief.c and modify them to work for other levels?
Of course. You have to create one updatescript file per level. I think you can use branch with the if-else condition ONLY if you use branch, though I've never done it like that before. I already did one for Zangief's stage and another one for another level. I have no idea why you are using one particular script for many levels you want.
I guess I could use if-else for branch name or current level index in the zangief.c instead.
I guess you figured out. I think using current level index is okay, but you have to label the notes what level you are using because from what I saw and had done,
the custom select screen level is counted as a level (if skipselect is used). It would be better to use branch for this.
You mentioned that you have both the lamp and the waterfall cycling at the same time, but I have no clue how you did it.
For my situation, I want to animate the same set of sprites 2 times (for the left and the right of the screen).
You can do that easily but let me ask you this. Is each of your sprites separately cropped/trimmed? I recommend you make images with equal size dimensions, multiples of 4, as noted in the tutorial.
This can be background, bglayer, or fglayer, for general use.
bglayer {path} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio} {quake} {neon}
background {path} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {quake} {neon}
- These 2 command have same effect which is create a background layer with the image at {path}.
- The image used must have a width which is a multiple of 4 (ex. 4, 200, 128, not 3, 202, 130).
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 # 0
fglayer data/sprites/hud.png -1 1 0 3 3 1 1 1 1 1 0 0 0 0 0 0 # 1
###########################################
fglayer data/bgs/zangief/zangief.pcx00010000.png -63 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 # 2
bglayer data/bgs/zangief/zangief.pcx00000000.png 0.365 0 0 0 1 1 1 1 1 0 0 0 0 0 0 # BG layer not counted as animated background layer
################ ANIMATED TOP CROWD ################
fglayer data/bgs/zangief/zangief.pcx00020000.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 3
fglayer data/bgs/zangief/zangief.pcx00020001.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 4
fglayer data/bgs/zangief/zangief.pcx00020002.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 5
fglayer data/bgs/zangief/zangief.pcx00020000.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 6
fglayer data/bgs/zangief/zangief.pcx00020001.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 7
fglayer data/bgs/zangief/zangief.pcx00020002.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 8
fglayer data/bgs/zangief/zangief.pcx00020000.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 9
fglayer data/bgs/zangief/zangief.pcx00020001.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 10
fglayer data/bgs/zangief/zangief.pcx00020002.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 11
fglayer data/bgs/zangief/zangief.pcx00020000.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 12
fglayer data/bgs/zangief/zangief.pcx00020001.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 13
fglayer data/bgs/zangief/zangief.pcx00020002.png -63 0 0 64 14 1 1 1 1 1 0 0 0 0 0 0 # 14
####################################################
############## ANIMATED BOTTOM CROWD ###############
fglayer data/bgs/zangief/zangief.pcx00030000.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 15
fglayer data/bgs/zangief/zangief.pcx00030001.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 16
fglayer data/bgs/zangief/zangief.pcx00030002.png -63 0 0 50 82 1 1 1 1 1 0 0 0 0 0 0 # 17
fglayer data/bgs/zangief/zangief.pcx00030000.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 18
fglayer data/bgs/zangief/zangief.pcx00030001.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 19
fglayer data/bgs/zangief/zangief.pcx00030002.png -63 0 0 50 82 1 1 1 1 1 0 0 0 0 0 0 # 20
fglayer data/bgs/zangief/zangief.pcx00030000.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 21
fglayer data/bgs/zangief/zangief.pcx00030001.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 22
fglayer data/bgs/zangief/zangief.pcx00030002.png -63 0 0 50 82 1 1 1 1 1 0 0 0 0 0 0 # 23
fglayer data/bgs/zangief/zangief.pcx00030000.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 24
fglayer data/bgs/zangief/zangief.pcx00030001.png -63 0 0 51 82 1 1 1 1 1 0 0 0 0 0 0 # 25
fglayer data/bgs/zangief/zangief.pcx00030002.png -63 0 0 50 82 1 1 1 1 1 0 0 0 0 0 0 # 26
#######################################################
bglayer data/bgs/zangief/zangief.pcx00040000.png 0.2441 0 -213 181 1 1 1 1 1 0 3 0.9 1 0 0
fglayer data/bgs/zangief/zangief.pcx00050000.png -63 0 0 330 151 1 1 1 1 1 0 0 0 0 0 0 # 27 - Hydrant
panel data/bgs/zangief/panel.gif
direction both
notime 1
settime 0
order a
type 1
updatescript data/bgs/zangief/zangief.c
C:
#import "data/scripts/dc_layer_animation.c"
void main(){
dc_layer_animation(3,14,45); // Top crowd
dc_layer_animation(15,26,38); // Bottom crowd
}
Do you know what this mean?
Note: To avoid any issues with special effects or repetition, ensure source image dimensions are multiples of 4.
The reason I put 12 lines in my Zangief level is that the sprites only have 3. What you have is 2 so you can put 4 lines. Use a multiplication of 4 to get that working. Don't overcomplicate yourself with how many numbers of lines you'll have. Calculate what you have, and you'll be fine.
level.txt
Code:
music data/music/NinjaGaiden_4_2.ogg
bglayer data/bgs/Factory/Building_bg.png 1 0 0 -30 0 0 1 1 0 0 0 0 0 0 0
#=============== SPRITES ANIMATION with updatescript ==========================================
# ==== ANIMATE SPRITES from index 1 - 15 =======
bglayer data/bgs/Factory/FX/FactoryFX01.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX03.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX05.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX07.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX09.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX11.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX13.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX15.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX17.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX19.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX21.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX23.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX25.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX27.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX30.png 0.9 0.9 -200 -1000 0 0 1 1 1 1
# ==== ANIMATE SPRITES from index 16 - 30 =====
bglayer data/bgs/Factory/FX/FactoryFX01.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX03.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX05.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX07.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX09.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX11.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX13.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX15.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX17.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX19.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX21.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX23.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX25.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX27.png 0.9 0.9 700 -1000 0 0 1 1 1 1
bglayer data/bgs/Factory/FX/FactoryFX30.png 0.9 0.9 700 -1000 0 0 1 1 1 1
updatescript data/scripts/LevelScripts/AnimateSprites.c
#=============================================================================================
Code:
#import "data/scripts/LevelScripts/LevelScripts.c"
void main()
{
Animate_LevelSprites(1, 15, 13, "bglayer");
Animate_LevelSprites(16, 30, 12, "bglayer");
}
Why are you using bglayer instead of fglayer? Did you modify the source for the animated background layer by changing from fglayer to bglayer? (I don't understand why you are using it, but it got me wondering.) There's a reason to use fglayer instead of bglayer. bglayer always acts as the most behind layer in levels, but fglayer is all about changing Z number as if it were to be in Z. Are you quite confused with using the Z part? The first parameter of fglayer is Z, which you can change it to cover or become behind anything, but at the same time, the layer stays without moving in Z axis. It's not a Z axis at all, though. zposition is Z axis as part of fglayer and bglayer.
From looking at your code now, do you know what you are doing? What are you trying to do?
Unless I'm wrong,
@DCurrent or anyone who has better knowledge of this can correct me on this.