Post by vyckstjudas on Jul 31, 2013 0:06:58 GMT -5
BY NickyP
So here we are. Your OpenBOR hopes, dreams, and ambitions have grown so much, you're ready to make a world map or stage select screen. Maybe you want to make a game with a world map that's bigger and better than Knights & Dragons - Endless Quest or ClaFan? That's great!... except it's not easy. At least, not for newbies. In order to pull this off, you'll need to have an intermediate-to-advanced level of OpenBOR commands and workings. This tutorial will use very little script if at all; for the most part, we'll be using normal OpenBOR commands.
Note: This tutorial assumes you already know how to make basic player characters, enemies, and stages; as well as the code and palettes involved.
Step 1: Setting it all up
The very first thing you'll need to do is create the actual map image. Based on the resources you're using, or your graphical skills, this will either be the easiest part or the hardest part. Either way, you'll need to make the actual map first. When I made ClaFan, I had a distinct classic JRPG aesthetic and feel in mind; so I used RPGMaker 2000 to create my maps. An alternative program could be Tiled. Or, you can check out vgmaps.com/ to see if a map from a game you want has been ripped. There's many ways to go about creating your map, use what you deem best. This likewise applies to creating a stage select screen.
Once you've created your map, you'll need to set up the z coordinates in Levels.txt. From the manual,
You can set up the top and bottom coordinates however you want, but I suggest you use my little trick: Regardless of how big the map image is, I always make the {xmin} 20 and the {xmax} whatever the height of your image file is, minus 11. I do this because it usually prevents the cursor entity from visually leaving the map, making for a more polished look. But we'll get to cursors in due time, don't worry.
So let's say your map's image file is 600x600. I would personally make the z coordinates in Levels.txt like so...
Note the 160 is the default setting for {BGHeight} in the z command. You can leave it blank, but I have it there just in case. And with that, step 1 is done.
Step 2: The cursor (Optional)
You can skip this step if you really want. But having a cursor for your world map/stage select makes your game look and feel much more polished. In order to do this, we're going to look a few commands and settings. First, check out weapons and weaploss.
Our map cursor character is simply going to be a "weapon," or an alternate version of, our playable character. You can make an individual cursor for every character, or you could use one global cursor for all characters. First, here's how we declare the cursor and set the weaploss:
The above code comes from the character Fighter in my game, ClaFan. You'll note that "mapfi" is the world map version of the Fighter. "mapfi" is declared with weapons, and weaploss is set to 3; you can set it to 1 or 2 if you want, but 3 is probably the better option. This will ensure that at no point in the world map/stage select, your character will revert from his/her cursor form. If you're wondering why there's a load mapfi in the Fighter's text instead of Models.txt, please refer to this tutorial. Now, this is what the cursor text file looks like:
Note that unlike Fighter, mapfi is a type none instead of type player. If we made mapfi a type player, then it would show up on the character select screen; since it's just a weapon model, type none is perfect. Also look at the commands modelflag 1 and weapnum 1; these are very important settings. From the manual,
Now that we set up the cursor model for our character, let's use it. In your world map/stage select text file, put setweap 1. Here's an example from ClaFan:
You'll notice that I marked arrows on a bunch of other settings as well. These are equally important in setting up a world map/stage select, especially if your map is very wide. I could explain what they all do, but they really are self-explanatory. Otherwise, look them up in the manual. Moving on~!
Step 3: Endlevels and branches
This is where your work in Step 1-2 really come to fruition. First, we need to create entities that will be placed on the world map/stage select. Moving your cursor onto them will lead to the corresponding stage, which we will accomplish via branches. First, let's see how they work.
For the endlevel markers on the map/stage select,
Notice we have two entity header settings here: type endlevel, and branch. Once we give a name to branch, then the player will be warped to the corresponding level branch once they touch the marker entity. Here's an example from ClaFan:
Notice that I also have another setting, offscreenkill 8000. This means that the marker entity won't automatically "die" unless it goes 8000 pixels off-screen. I used this big of a number as an assurance; as I doubt you and I will ever make a map that's bigger than 8000 pixels wide. Anyways, note now that the branch is set to 01. Now, let's look at the branch command for Levels.txt:
Branch in Levels.txt is used in the exact same way that you use set. Here's an example from ClaFan:
See how it's exactly like a set? Now all you have to do is spawn the endlevel marker entities in your world map/stage select, and you'll be good to go!
Step 4: The endless loop (Optional)
This last step only applies if you want to make a game like ClaFan or Knights & Dragons - Endless Quest. Basically, this step will show you what to do if you want the player to return back to the world map/stage select screen.
First, you'll need two dummy branches. These won't lead anywhere, nor will they ever be used, but they are extremely important: otherwise, the OpenBOR will end the game regardless of what you do. You must set a dummy branch at the beginning and end of the list of branches. Here's an example from ClaFan:
Notice also at the end of every branch, I lead back to the world map? You will have to do that as well.
Alright, that's it! I hope this helps. Happy modding! ;D
This post was submitted to Chronocrash.com by User NickyP. If you'd like to check out the original post, click the link below. ~Vyck
www.chronocrash.com/forum/index.php?topic=952.msg8972;topicseen#new
Thanks for stopping by.
So here we are. Your OpenBOR hopes, dreams, and ambitions have grown so much, you're ready to make a world map or stage select screen. Maybe you want to make a game with a world map that's bigger and better than Knights & Dragons - Endless Quest or ClaFan? That's great!... except it's not easy. At least, not for newbies. In order to pull this off, you'll need to have an intermediate-to-advanced level of OpenBOR commands and workings. This tutorial will use very little script if at all; for the most part, we'll be using normal OpenBOR commands.
Note: This tutorial assumes you already know how to make basic player characters, enemies, and stages; as well as the code and palettes involved.
Step 1: Setting it all up
The very first thing you'll need to do is create the actual map image. Based on the resources you're using, or your graphical skills, this will either be the easiest part or the hardest part. Either way, you'll need to make the actual map first. When I made ClaFan, I had a distinct classic JRPG aesthetic and feel in mind; so I used RPGMaker 2000 to create my maps. An alternative program could be Tiled. Or, you can check out vgmaps.com/ to see if a map from a game you want has been ripped. There's many ways to go about creating your map, use what you deem best. This likewise applies to creating a stage select screen.
Once you've created your map, you'll need to set up the z coordinates in Levels.txt. From the manual,
z {zmin} {zmax} {BGheight}
~Changes the location of stage boundaries.
~{xmin} is how high up entities can walk. It starts at the top and works down, so larger numbers mean less room. Defaults to 160.
~{xmax} is how far down the character can walk. It also goes down from the top. Defaults to 232.
~{BGheight} changes where the bottom of the background is drawn. Defaults to 160. By changing this value, you can make the background match an altered {xmin}.
~This can be set once per level. You can change it between two stages. If you need to change it during a stage, you should combine it with the "wall" command in the stage itself.
~You can spawn entities outside of this range, but once they enter the playing field they can't escape again.
~Changes the location of stage boundaries.
~{xmin} is how high up entities can walk. It starts at the top and works down, so larger numbers mean less room. Defaults to 160.
~{xmax} is how far down the character can walk. It also goes down from the top. Defaults to 232.
~{BGheight} changes where the bottom of the background is drawn. Defaults to 160. By changing this value, you can make the background match an altered {xmin}.
~This can be set once per level. You can change it between two stages. If you need to change it during a stage, you should combine it with the "wall" command in the stage itself.
~You can spawn entities outside of this range, but once they enter the playing field they can't escape again.
So let's say your map's image file is 600x600. I would personally make the z coordinates in Levels.txt like so...
z 20 589 160
file data/levels/map.txt
file data/levels/map.txt
Step 2: The cursor (Optional)
You can skip this step if you really want. But having a cursor for your world map/stage select makes your game look and feel much more polished. In order to do this, we're going to look a few commands and settings. First, check out weapons and weaploss.
weapons {name1} {name2} {name3} {name4} {name5} {original name}
~This command sets other model which will be used to replace this entity when a weapon is picked up.
~{name#} is the name of the model which this character becomes when they pick up weapon #. # is weapon's number. Don't forget to load the model in models.txt.
~{original name} is the name of the character when it doesn't have any weapons equipped.
~If {name#} is filled with none, this entity can't pick respective weapon.
weaploss {flag}
~Determines how weapon could be lost when the character is wielding a weapon.
0 (default) = weapon is lost and dropped on any hit.
1 = weapon is lost only on knockdown hit.
2 = weapon is lost only on death.
3 = weapon is lost only when level ends or character is changed during continue. This depends on the level settings and whether players had weapons on start or not.
~This setting can also be declared in weapon text. If you do so, the setting will override similar setting in character's text and it will only be used for that weapon.
~This command sets other model which will be used to replace this entity when a weapon is picked up.
~{name#} is the name of the model which this character becomes when they pick up weapon #. # is weapon's number. Don't forget to load the model in models.txt.
~{original name} is the name of the character when it doesn't have any weapons equipped.
~If {name#} is filled with none, this entity can't pick respective weapon.
weaploss {flag}
~Determines how weapon could be lost when the character is wielding a weapon.
0 (default) = weapon is lost and dropped on any hit.
1 = weapon is lost only on knockdown hit.
2 = weapon is lost only on death.
3 = weapon is lost only when level ends or character is changed during continue. This depends on the level settings and whether players had weapons on start or not.
~This setting can also be declared in weapon text. If you do so, the setting will override similar setting in character's text and it will only be used for that weapon.
name Fighter
type player
health 190
speed 10
running 15 3 2 1 1
gfxshadow 1
icon data/chars/fighter/icon2.png
jumpheight 3
jumpmove 3 3
makeinv 3 0
weapons mapfi #<----
weaploss 3 #<----
load mapfi #<----
type player
health 190
speed 10
running 15 3 2 1 1
gfxshadow 1
icon data/chars/fighter/icon2.png
jumpheight 3
jumpmove 3 3
makeinv 3 0
weapons mapfi #<----
weaploss 3 #<----
load mapfi #<----
name mapfi
type none #<----
speed 10
icon data/chars/fighter/a.png
modelflag 1 #<----
weaploss 3
weapnum 1 #<----
grabdistance 15
type none #<----
speed 10
icon data/chars/fighter/a.png
modelflag 1 #<----
weaploss 3
weapnum 1 #<----
grabdistance 15
modelflag {int}
~Determines how weapon model copies animation and weaponlist from original model.
0 = Animation and weaponlist are copied
1 = Animation aren't copied but weaponlist are still copied
3 = Animation and weaponlost aren't copied
~Use this with weapon models of course.
weapnum {int}
~Used to give number to weapons. {int} is the number.
~Declaring this command is important so other command such as 'setweap' (see Level Designs below) could work properly.
~Determines how weapon model copies animation and weaponlist from original model.
0 = Animation and weaponlist are copied
1 = Animation aren't copied but weaponlist are still copied
3 = Animation and weaponlost aren't copied
~Use this with weapon models of course.
weapnum {int}
~Used to give number to weapons. {int} is the number.
~Declaring this command is important so other command such as 'setweap' (see Level Designs below) could work properly.
#
music data/music/map.bor
settime 0 #<----
notime 1 #<----
setweap 1 #<----
cameratype 1 #<----
direction both #<----
scrollspeed 20 #<----
# Load images
background data/bgs/map/map.png
panel data/bgs/map/map.png
order a
music data/music/map.bor
settime 0 #<----
notime 1 #<----
setweap 1 #<----
cameratype 1 #<----
direction both #<----
scrollspeed 20 #<----
# Load images
background data/bgs/map/map.png
panel data/bgs/map/map.png
order a
Step 3: Endlevels and branches
This is where your work in Step 1-2 really come to fruition. First, we need to create entities that will be placed on the world map/stage select. Moving your cursor onto them will lead to the corresponding stage, which we will accomplish via branches. First, let's see how they work.
For the endlevel markers on the map/stage select,
~{type}:
endlevel: The entity is an item which, when touched by a player, will end the stage. It can be given a score value to be awarded for level completion.
branch {name}
~This is used to make endlevel entity warps players to certain level instead of the next level in a level set if player touch it.
~{name} is name of the destination in a level set.
~In case you haven't figure it out, this feature is to make branch for multiple paths.
endlevel: The entity is an item which, when touched by a player, will end the stage. It can be given a score value to be awarded for level completion.
branch {name}
~This is used to make endlevel entity warps players to certain level instead of the next level in a level set if player touch it.
~{name} is name of the destination in a level set.
~In case you haven't figure it out, this feature is to make branch for multiple paths.
name m01
type endlevel #<----
branch 01 #<----
offscreenkill 8000 #<----
shadow 0
type endlevel #<----
branch 01 #<----
offscreenkill 8000 #<----
shadow 0
branch {name}
~Used to give name to warp destination for endlevel entities which uses 'branch'.
~{name} is the name of the destination.
~Used together with 'branch' feature (see below)
~Used to give name to warp destination for endlevel entities which uses 'branch'.
~{name} is the name of the destination.
~Used together with 'branch' feature (see below)
branch 01 #<----
z 116 132 160
file data/levels/01.txt
file data/levels/01b.txt
z 20 613 160
file data/levels/mapx.txt
z 116 132 160
file data/levels/01.txt
file data/levels/01b.txt
z 20 613 160
file data/levels/mapx.txt
Step 4: The endless loop (Optional)
This last step only applies if you want to make a game like ClaFan or Knights & Dragons - Endless Quest. Basically, this step will show you what to do if you want the player to return back to the world map/stage select screen.
First, you'll need two dummy branches. These won't lead anywhere, nor will they ever be used, but they are extremely important: otherwise, the OpenBOR will end the game regardless of what you do. You must set a dummy branch at the beginning and end of the list of branches. Here's an example from ClaFan:
#--------------------------------------------------------# BEGINNING
branch 00_00
z 145 210 160
file data/levels/test.txt
#--------------------------------------------------------# BEGINNING
branch 00
z 84 132 160
file data/levels/00.txt
file data/levels/00b.txt
z 20 613 160
file data/levels/mapx.txt
branch 01
z 116 132 160
file data/levels/01.txt
file data/levels/01b.txt
z 20 613 160
file data/levels/mapx.txt
#--------------------------------------------------------# END
branch 99_99
z 145 210 160
file data/levels/test.txt
#--------------------------------------------------------# END
branch 00_00
z 145 210 160
file data/levels/test.txt
#--------------------------------------------------------# BEGINNING
branch 00
z 84 132 160
file data/levels/00.txt
file data/levels/00b.txt
z 20 613 160
file data/levels/mapx.txt
branch 01
z 116 132 160
file data/levels/01.txt
file data/levels/01b.txt
z 20 613 160
file data/levels/mapx.txt
#--------------------------------------------------------# END
branch 99_99
z 145 210 160
file data/levels/test.txt
#--------------------------------------------------------# END
Alright, that's it! I hope this helps. Happy modding! ;D
This post was submitted to Chronocrash.com by User NickyP. If you'd like to check out the original post, click the link below. ~Vyck
www.chronocrash.com/forum/index.php?topic=952.msg8972;topicseen#new
Thanks for stopping by.