maxman
Well-known member
Here are two issues I need help with: One is the certain returning level switch after continue and select screens, and the other one is with rushing the countdown by tapping any button.
I'm trying to go back to the level where I left off after losing. I have a continue screen and if I press start, I will go back to the select screen. I'm trying to go back instead of reverting back to the very beginning. For instance, if you are in stage B (level 3) and lose there, you can continue and go back to the select screen which is level 1. After selecting a character, you wanna go back to Stage B instead of stage A. However, you go to Stage A which means you are going back to the very beginning after the select screen. I need to revert back to Stage B after the select screen.
I have the continue script working well but the continue entity is not type text. It's a none type entity but I already got a pause script for it. Also, I have an invisible player entity which is fake as a player, and it really helps me to move back to the select screen when I press start as a none type since it's not text type. But the problem is I can't press any button to change frame or rush to countdown. How can I have the keys access to rush the countdown? Do I need keyscript or animationscript (though I have it, I don't know which to use)?
For type text, I can press attack or jump (or any?) button to skip, but I cannot press start to skip or cancel as I understand you can pause it. Also, if I press start, I can't go back to the select screen because it's "paused".
Continue screen entity:
I use type none because it works for the fake player entity.
Challenger.txt:
ArcSpawn.c (it's actually in arcSpawn_actual.c):
EDIT:
I forgot to show that I put an entity spawn in the level here. It still cannot work and it seems empty.
I'm trying to go back to the level where I left off after losing. I have a continue screen and if I press start, I will go back to the select screen. I'm trying to go back instead of reverting back to the very beginning. For instance, if you are in stage B (level 3) and lose there, you can continue and go back to the select screen which is level 1. After selecting a character, you wanna go back to Stage B instead of stage A. However, you go to Stage A which means you are going back to the very beginning after the select screen. I need to revert back to Stage B after the select screen.
Code:
set Arcade
branch Select
z 160 230
file data/levels/select.txt # level 1
branch StageA
z 200 200
file data/levels/stageA.txt # level 2
branch StageB
z 200 200
file data/levels/stageB.txt # level 3
branch StageC
z 200 200
file data/levels/stageC.txt # level 4
branch StageD
z 200 200
file data/levels/stageD.txt # level 5
branch Ended
z 230 230 230
file data/levels/emptyspace.txt # level 6
end
branch Return
z 160 230
file data/levels/select.txt # level 7
I have the continue script working well but the continue entity is not type text. It's a none type entity but I already got a pause script for it. Also, I have an invisible player entity which is fake as a player, and it really helps me to move back to the select screen when I press start as a none type since it's not text type. But the problem is I can't press any button to change frame or rush to countdown. How can I have the keys access to rush the countdown? Do I need keyscript or animationscript (though I have it, I don't know which to use)?
For type text, I can press attack or jump (or any?) button to skip, but I cannot press start to skip or cancel as I understand you can pause it. Also, if I press start, I can't go back to the select screen because it's "paused".
Code:
name EnemyWin
health 2
type text
#type none
shadow 0
nolife 1
palette none
speed 10 #speed {value} # Used for panel type entity
nomove 1 1
nodrop 1
nopain 1
load CountD
load black
#setlayer 345000000
#setlayer 400000000
setlayer 100
animationscript data/scripts/script.c
#onspawnscript data/scripts/winSpawn.c
#ondrawscript data/scripts/winText.c
anim idle # Ryu
offset 40 1
delay 650
custentity CountD
spawnframe 1 200 60 0 1
@cmd changeopenborvariant "nojoin" 1
@cmd changeopenborvariant "nopause" 1
@cmd playmusic "data/music/fightend.ogg"
#@cmd spawn06 "Black" 0 0 660
frame data/sprites/portraits/ryu.png
delay 90
@cmd changeopenborvariant "nojoin" 0
@cmd changeopenborvariant "nopause" 0
@cmd killentity getlocalvar("self")
@cmd playmusic "data/music/continue.bor" 1 528400.25
frame data/sprites/portraits/ryu.png
anim freespecial # Ken
offset 40 1
delay 650
custentity CountD
spawnframe 1 200 60 0 1
@cmd changeopenborvariant "nojoin" 1
@cmd changeopenborvariant "nopause" 1
@cmd playmusic "data/music/fightend.ogg"
frame data/sprites/portraits/ken.png
@cmd changeopenborvariant "nojoin" 0
@cmd changeopenborvariant "nopause" 0
@cmd killentity getlocalvar("self")
@cmd playmusic "data/music/continue.bor" 1 528400.25
frame data/sprites/portraits/ken.png
anim freespecial2 # Chun-Li
offset 40 1
delay 650
custentity CountD
spawnframe 1 200 60 0 1
@cmd changeopenborvariant "nojoin" 1
@cmd changeopenborvariant "nopause" 1
@cmd playmusic "data/music/fightend.ogg"
frame data/sprites/portraits/chun-li.png
@cmd changeopenborvariant "nojoin" 0
@cmd changeopenborvariant "nopause" 0
@cmd killentity getlocalvar("self")
@cmd playmusic "data/music/continue.bor" 1 528400.25
frame data/sprites/portraits/chun-li.png
anim freespecial3 # Zangief
offset 40 1
delay 650
custentity CountD
spawnframe 1 200 60 0 1
@cmd changeopenborvariant "nojoin" 1
@cmd changeopenborvariant "nopause" 1
@cmd playmusic "data/music/fightend.ogg"
frame data/sprites/portraits/zangief.png
@cmd changeopenborvariant "nojoin" 0
@cmd changeopenborvariant "nopause" 0
@cmd killentity getlocalvar("self")
@cmd playmusic "data/music/continue.bor" 1 528400.25
frame data/sprites/portraits/zangief.png
Continue screen entity:
Code:
name CountD
type none
#type text
#health 10
speed 10
#falldie 1
subject_to_minz 0
subject_to_maxz 0
setlayer 410000000
facing 1
load black-fade-in
load black-fade-out
load black
#animationscript data/scripts/paus0001.c
animationscript data/scripts/script.c
anim idle
offset 1 1
delay 9
custentity black-fade-out
@cmd changeopenborvariant "nopause" 1
@cmd paus0001 1 1000000000 #paus0001 {toggle} {time}
@cmd changelevelproperty "bgspeed" 0 # changelevelproperty {bgspeed} {value} # Stop background from speeding
spawnframe 56 0 240 0 0 # spawnframe {frame} {x} {z} {y} {relative}
@cmd spawn06 "Black" 0 0 660
frame data/chars/misc/continueanim/counbase.png # 0
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/counbase.png # 1
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count091.png # 2
delay 2 #160
sound data/sounds/nine.wav
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count09.png # 3
delay 78
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count09.png # 4
delay 40
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count09.png # 5
delay 40
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count09.png # 6
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count091.png # 7
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/counbase.png # 8
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/counbase.png # 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count081.png # 10
delay 160
sound data/sounds/eight.wav
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count08.png # 11
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count081.png # 12
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/counbase.png # 13
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/counbase.png # 14
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count071.png # 15
delay 160
@cmd paus0001 1 1000000000
sound data/sounds/seven.wav
frame data/chars/misc/continueanim/count07.png # 16
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count071.png # 17
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/counbase.png # 18
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/counbase.png # 19
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count061.png # 20
delay 260
sound data/sounds/six.wav
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count06.png # 21
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count061.png # 22
frame data/chars/misc/continueanim/counbase.png # 23
frame data/chars/misc/continueanim/counbase.png # 24
frame data/chars/misc/continueanim/count051.png # 25
delay 260
@cmd paus0001 1 1000000000
sound data/sounds/five.wav
frame data/chars/misc/continueanim/count05.png # 26
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count051.png # 27
frame data/chars/misc/continueanim/counbase.png # 28
frame data/chars/misc/continueanim/counbase.png # 29
frame data/chars/misc/continueanim/count041.png # 30
delay 260
@cmd paus0001 1 1000000000
sound data/sounds/four.wav
frame data/chars/misc/continueanim/count04.png # 31
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count041.png # 32
frame data/chars/misc/continueanim/counbase.png # 33
frame data/chars/misc/continueanim/counbase.png # 34
frame data/chars/misc/continueanim/count031.png # 35
delay 260
@cmd paus0001 1 1000000000
sound data/sounds/three.wav
frame data/chars/misc/continueanim/count03.png # 36
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count031.png # 37
frame data/chars/misc/continueanim/counbase.png # 38
frame data/chars/misc/continueanim/counbase.png # 39
frame data/chars/misc/continueanim/count021.png # 40
delay 260
@cmd paus0001 1 1000000000
sound data/sounds/two.wav
frame data/chars/misc/continueanim/count02.png # 41
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count021.png # 42
frame data/chars/misc/continueanim/counbase.png # 43
frame data/chars/misc/continueanim/counbase.png # 44
frame data/chars/misc/continueanim/count011.png # 45
delay 260
@cmd paus0001 1 1000000000
sound data/sounds/one.wav
frame data/chars/misc/continueanim/count01.png # 46
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count011.png # 47
frame data/chars/misc/continueanim/counbase.png # 48
frame data/chars/misc/continueanim/counbase.png # 49
frame data/chars/misc/continueanim/count001.png # 50
delay 260
@cmd paus0001 1 1000000000
sound data/sounds/timeover.wav
frame data/chars/misc/continueanim/count00.png # 51
delay 9
@cmd paus0001 1 1000000000
frame data/chars/misc/continueanim/count001.png # 52
frame data/chars/misc/continueanim/counbase.png # 53
#delay 180
frame data/chars/misc/continueanim/counbase.png # 54
delay 210
@cmd playmusic "data/music/gameover.bor"
#@cmd settextobj 0 138 60 3 145000000 "Game_Over" # settextobj {index} {x} {y} {font} {text}
@cmd settextobj 1 138 60 3 145000000 "Game_Over"
frame data/chars/misc/continueanim/counbase.png # 55
delay 112
frame data/chars/misc/continueanim/counbase.png # 56
@cmd jumptobranch "end" 1
frame data/chars/misc/continueanim/counbase.png # 57
anim follow1
flipframe 0
loop 0
offset 0 0
delay 10
@script
changeopenborvariant("nopause", 0);
@end_script
frame data/chars/misc/continueanim/counbase.png
delay 1
@cmd killentity getlocalvar("self")
frame data/chars/misc/continueanim/counbase.png
I use type none because it works for the fake player entity.
Code:
name player1
type player
health 1 #100
speed 10
turndelay 9999999999999999999999
#facing 1
#antigravity 100
subject_to_gravity 0
subject_to_obstacle 0
subject_to_wall 1
subject_to_platform 0
subject_to_hole 1
no_adjust_base 0
shadow 0
#candamage enemy obstacle
atchain 1
load Challenger
load black-fade-out
animationscript data/scripts/script.c
ondrawscript data/scripts/dumdraw.c
onspawnscript data/scripts/arcSpawn.c
#onspawnscript data/chars/misc/opselect/p1join.c
script @script
void main(){
changeentityproperty(getlocalvar("self"), "name", "_");
}
@end_script
anim waiting
delay 4
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim select
delay 4
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim spawn
delay 9
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim respawn
delay 9
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim idle
loop 1
delay 6
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim walk
loop 1
delay 6
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim backwalk
loop 1
delay 6
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim pain
delay 4
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim attack
delay 4
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim fall
delay 4
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim rise
delay 4
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim follow1 # Return to Character Select Screen after Continue
delay 120
offset 1 1
subentity black-fade-out
spawnframe 0 0 240 0 0
frame data/chars/misc/empty.gif
delay 6
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
@cmd jumptobranch "Arcade_Select" 1
frame data/chars/misc/empty.gif
anim follow2 # Here comes a new challenger
delay 9
offset 1 1
custentity Challenger
spawnframe 0 0 0 0 0
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim follow3 # First player returns to select screen or second player joins after first player loses completely
delay 1
offset 1 1
@cmd clearglobalvar
frame data/chars/misc/empty.gif
delay 6
@cmd jumptobranch "Arcade_Select" 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
Challenger.txt:
Code:
name Challenger
type text
subtype noskip
anim idle
offset 1 1
delay 100
@cmd playmusic "data/music/charenja.ogg"
frame data/chars/misc/empty.gif
delay 5
@cmd clearglobalvar
frame data/chars/misc/empty.gif
@cmd jumptobranch "Arcade_Select" 1
#@cmd clearglobalvar
frame data/chars/misc/empty.gif
delay 5
@cmd killentity getlocalvar("self")
frame data/chars/misc/empty.gif
ArcSpawn.c (it's actually in arcSpawn_actual.c):
Code:
#define RESPAWN openborconstant("ANI_RESPAWN") //#define {any_name_for_the_value} {value}
#define SPAWN openborconstant("ANI_SPAWN")
void actual_main(){ // This function is #imported from its main file in the main scripts folder
arcade_spawn();
}
void arcade_spawn(){
void self = getlocalvar("self"); // Get entity
void aniID = getentityproperty(self, "animationid"); // Get entity's animation ID
int set = openborvariant("current_set"); // Calling on the current set or mode of the game
int level = openborvariant("current_level"); // Calling on the current level
//void in_level = openborvariant("in_level");
void branch = openborvariant("current_branch"); // Calling on current branch
changeentityproperty(self, "name", "_"); // Change entity's name
int PLAY = openborvariant("count_players");
// This goes back to the select screen from the continue screen
if(set == 0 && branch == "Continue"){ // During Continue screen in the first set?
if(aniID == RESPAWN || aniID == SPAWN){ // Take a look at #define above and see why the value is like this
performattack(self, openborconstant("ANI_FOLLOW1")); // Confirming to return to the select screen
}
}
// This calls upon a new challenger
if((level == 2 || level == 3 || level == 4 || level == 5) && PLAY == 2 && set == 0){ // Second player joins the fray in certain levels under one mode!
if(aniID == RESPAWN || aniID == SPAWN){
performattack(self, openborconstant("ANI_FOLLOW2")); // Confirms a new challenger and returns to select screen
}
}
// Continue to battle
if((level == 2 || level == 3 || level == 4) && PLAY == 1 && set == 0){ // First (either 1P or 2P) player returns to battle!
if(aniID == RESPAWN){
performattack(self, openborconstant("ANI_FOLLOW3")); //Jump to select screen
}if(aniID == SPAWN){
performattack(self, openborconstant("ANI_FOLLOW3"));
}
}
}
EDIT:
I forgot to show that I put an entity spawn in the level here. It still cannot work and it seems empty.
Code:
spawn Empty
@script
void main()
{
setglobalvar("Return", "StageB");
}
@end_script
coords 320 400
at 0
Last edited: