Individual start level for each characters

  • Thread starter Thread starter brunovisk3
  • Start date Start date
B

brunovisk3

Guest
Hello, My name is Bruno, and I'm new on OpenBor, I always wanted to make a beat em' up game, and when I found OpenBor, I've been very optimistic to make my own.

Anyway, my question is, is it possible to make individual start levels for characters?
for example, I choose Maxima as character and it start on a level named Maxima level1, and if I choose Mary she'd start on Mary level1, but in the middle of the game, they'lll go to the same set of levels, like phase 2, phase 3 etc...

that's it, thank you guys 
 
Sure. It will require a bit of script tedium, but it is certainly doable. I think Bloodbane already has, so maybe he can offer some input.

DC
 
^^ thanks, I sent him a pm, 'cause I'm looking for it in everywhere, let's see if he can help me!

Thanks Damon
 
Strange, I haven't received any PM in the last couple days. Anyways, since I'm here I'll just answer the question directly :)

Before I start, please read this tutorial:

http://www.chronocrash.com/forum/index.php?topic=20.0

This tutorial will explain how to set branches in OpenBoR. Branches will also be used to achieve what you want

Oh yes, I suggest you to use latest build of OpenBoR cause the script won't work in old builds

[some time later]

I just remembered something and need to clarify this

When you say Maxima will start in his own level, Mary will do in her own etc, for single player game this is simple but in 2,3 or 4 players game, it's not that simple anymore.
So the question is : who has right to define the first level?
 
I just remembered something and need to clarify this

When you say Maxima will start in his own level, Mary will do in her own etc, for single player game this is simple but in 2,3 or 4 players game, it's not that simple anymore.
So the question is : who has right to define the first level?

It's supposed to be the  player 1, but if I'll make it multiplayer, I might to set different campaigns for set of characters, like Maxima and Kula sharing the same 1 stage, and Mary and Terry has their own main stages for example.

I read the topic you showed, it realy clarified my mind, but how can I check which actor player one has picked?
 
Glad you have read that thread
Now that you understand how branch works, this is levels.txt I proposed:

Set  Single_Player
file    data/levels/select.txt
branch MaxStart
file    data/levels/stage1Max.txt
branch KulaStart
file    data/levels/stage1Kula.txt
branch MaryStart
file    data/levels/stage1Mary.txt
branch Main
file    data/levels/stage2.txt
...

select.txt level is quick simple level which will do the level select based on character chosen by player 1.

You can use any background for it cause it will be run very quick. However you need to set this:

nofadeout 1

in its header

Then spawn an enemy with this script at 0

spawn Yashiro
@script
  void main()
  {
    void P1 = getplayerproperty(0, "entity");

    if(P1){
      void Model = getentityproperty(P1, "model");

      if(Model == "Maxima"){
        jumptobranch("MaxStart",1);
      } else if(Model == "Kula"){
        jumptobranch("KulaStart",1);
      } else if(Model == "Mary"){
        jumptobranch("MaryStart",1);
      }
    }
  }
@end_script
coords 500 190
at 0

The idea is when you choose single player level set, you will enter select.txt level. Since this enemy is spawned at 0, the script will be run right away checking name of character player 1 is using. If the name is Maxima, player 1 will jump to stage1Max.txt, and so on with other characters.

Now how do we bring Maxima and Kula back to main path? branch Main is the branch point for main path.
To bring player 1 to main path, set this script in any entity spawn:

spawn (something)
@script
  void main()
  {
    jumptobranch("Main",0);
  }
@end_script
coords ...
at ...

in stage1Max.txt and stage1Kula.txt.
After you cleared any of those 2 level, you will be taken to stage2

HTH

This script is hardcoded to Maxima, Kula and Mary so if you have more or less characters, you need to update the script. Don't worry I'll help you :)
 
Thank you Blood, I think I understand the logic, it's exactly what I want =D

But I have a doubt for multiplayers, I read some topics about how to block some characters in set of stages by using command skipselect, and I wonder if it works for each set of stages or it's general? for example

Maxima Campaign = only maxima and kula allowed
skipselect {Mary} {Terry} {secret1} {Secret2}
Mary campaign = only Mary and Terry allowed
skipselect {Kula} {Maxima} {secret1} {secret2}
after beat the game a new set of stages is available  for multiplayers with new characters with their own history.

 
Back
Top Bottom