LavaLit

OpenBoR => Help & Resources => Tricks & Tutorials => Topic started by: SX on March 05, 2007, 04:05:29 pm

Title: BoR & OpenBoR Tricks
Post by: SX on March 05, 2007, 04:05:29 pm
This thread was actually started by Mr.Q a year ago in old BoR Rev forum. I continue it after Mr.Q left it and now I'm starting similar thread here.

 First of all here's previous posted tricks:

 http://borrevolution.vg-network.com/forum/viewtopic.php?t=73

 Anyone is welcome to post tricks here but please use same format like the trick I'm posting here:

 Making Test Level

 Intro:This is a technique to make test level in OpenBoR. Test level is a level where you can test many things (not all however) without worry about time. You can use it to test enemy's attacks, background and traps. You can also use it for bug testing ;). Basicly it's a level where you can play there forever (unless you exit).
 I won't describe how to make background and other stuffs required to make a level. I only explain how to set a level to test level.
 Procedure:
 Prepare everything required to make a level (background, panels, etc) then make a level with them.
 To make it test level, you have to give this settings:
 
Code: [Select]
settime         0
notime          1
type            1 0 1
direction       both

 'type 1 0 1' is to make the level bonus level that allows special attacks but prohibits friendly attack. Only the first flag which is important, you can set the other 2 differently but use that for now.
 In case you don't know, bonus level is level where heroes are invincible and it will only end either because the timer goes to 0 or no more obstacles or items in the level.
 If that's the rule then how to set unlimited time for it? that's what 'settime 0' is for. With this setting, you can be in this level forever while the timer only show 00. Since the timer won't change at all, give 'notime 1' to hide the timer.
 'direction both' is so you can scroll back again after scrolling forward. Very useful if you are testing enemies or background.

 Is that enough? no! there's one more thing to set. Those setting won't make the test level not end on its own cause there's no obstacles or items in it. So we need an obstacle or item to prevent that.
 Make an entity like this:
 
Code: [Select]
name Empty
health 10
type obstacle
shadow 0

anim idle
delay 100
offset 1 1
frame data/chars/misc/empty.gif

anim fall
delay 100
offset 1 1
frame data/chars/misc/empty.gif

 BTW empty.gif is just 1x1 pixels gif with transparent color. BoR has it.

 Don't forget to load it in models.txt of course:
 
Code: [Select]
know Empty data/chars/misc/empty.txt
 After that entity is ready, spawn it in the test level like this:
 
Code: [Select]
spawn Empty
coords 500 195
at 0

 If your test level is long, another spawn might be required:
 
Code: [Select]
spawn Empty
coords 500 195
at 1000

 This is important so if OpenBoR 'kills' the previous 'empty' entity, another 'empty' will hold the level so it won't end on its own.

 That's the basic setting. You can add anything you want in the test level. Remember! heroes are invincible here so you can relax if enemy beats them here.

 If you're bored or simply want to end playing the level, hit 'start' or 'escape' to end it.

by BloodBane
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 05, 2007, 04:06:15 pm
I had been hard coding this trick when there was a simpler way all along

 Launchers

 Intro:This rather simple trick allows you to create moves that launch opponents in the air for juggles.
 Procedure:
 Using the "jumpframe {frame}   {height}" command within a pain animation allows you to pop entities up in the air.  The beauty of using jumpframe versus hard coding "movea" commands is that the engine does the work for you and it animates alot smoother.  Based upon your game settings it allows you to set up a solid juggle system.

Code: [Select]
jumpframe {frame} {height}

~If this command is present, the entity will perform a jump once frame {frame} is reached.

~Only one jumpframe command counts- you can't jump more than once in an animation by putting
                 more in, even if the entity lands before the next jump starts.

~The style of jump depends on the characer performing the jump and the {height} value:

Height is 0: Player: The jump is very low, but the character moves forward.
Enemy: The jump is high and vertical.

Height > 0: Player: The jump is {height} high, and vertical.
Enemy: The jump is {height} high, and moves forward.


 by Zamuel
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 05, 2007, 04:09:07 pm
Hier are my little research about counters  :twisted: 

Block+counter for characters and enemys

Intro:
First one must be state that anim follow is not independent animation
and is only as replacement of frames in orginal anim .
Some animation (as idle , walk, pain) cannot make any attack and
all attack bboxes are in this animation ignored by engine.
So if you try put counter that supose hit enemy in (egz) block you finish
with character perform his counter but not hit enemy as block cannot
make attack (you block ,couter was trigered and anim follow was playing)

Procedure:
Now a little egzample:

1. I try to set counter in anim block for fighter in my D&D:

a) counterframe 0 3 0
followanim 1
nothing - character was only blocking
b) counterframe 0 1 0
followanim 1
character only perform counter when is attack by enemy with blast but his counter (uppercut) was not hurt target
c) counterframe 0 1 0
followanim 1
(anim follow make charakter roll back/duck/jumpback desapear)
and that is one of solutions

2. I realy want to have counter in block that hits enemys:

a) counterframe 0 1 0
followanim 1

in anim follow you must make charakter to shot/throw something (shoot/knife is defrent entity and his anim idle is meam to hurt enemys)

b) do everything as in 2a but shot/knife make from empty.gif and now you can have character performing uppercut/hard blow and so on
(shoot be hitting enemy but be looks like as character)

3.If you set counter in any anim that by default hurt enemys/players
  as attack1/2/3 special1/2 (and so on) anim follow be hitting enemys   without problems as long as condition are meat
 
Code:

Quote
counterframe: The first argument is the number of the frame in which the counterattack is available. The user must be hit in this frame in order to counter.

second argument: The conditions under which the counter will be used:
1: The counter will always be used.
2: The counter will be used as long as the attacker was an enemy (Or a player if an enemy uses it).
3: The counter will be used as long as the attacker was an enemy, the attack was not unblockable, hits the user from the front, and was not a FREEZE attack.

thrid argument: This is a flag which controls damage.
0: The entity which performs the counterattack will not take any damage from the attack.
1: The entity which performs the counterattack will take damage, even if the counterattack is successful.


followanim 1 this is the follow animation to use if the counter conditions are met. This one goes to FOLLOW1.

Enjoy  :twisted:


by BonusJZ
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 05, 2007, 04:10:17 pm
This is a one of my new features that i use in upcoming mod Violent Storm  :twisted:

 Beating enemys on the ground and more


 (http://img234.imageshack.us/img234/484/violentstormfx0.gif)


Intro:
I allways loved way i use to treat punks in mighty Vendeta when they fall on the ground and i want to see this in my game - hier i presents anim of Terry but other charakters have others ground finishers

Procedure:
First make propher animation of attack for character and put it as one of freespecial ( in this egz Terry use U D A )
Second desite if you want hit enemy onese or more  - hier Terry deliver
one veeery hard punch - and set attack bbox very low ( hier only his fist in the frame that hit ground and attack is also set as KO)

Now poor boy Tom - you have to include bbox in his fall anim (last frames
is enough) . You gain also next new feature that give you option to pick him up from the ground ( his minor enemy so dont have riseattack wich can be attack/counter/dodge) and give him next lesson.

If you want use more hits when hi/her on the ground use egz. attack3(not animtion) and make propher enemy anim pain3 (as laing on the ground)

Now how you think Tom gets the lesson or hit him again :twisted:


 by BonusJZ
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 05, 2007, 04:12:41 pm
This trick can easily add some deeps to the game play of your mod: :D

Damage more enemies with grabattacks/grabfinishers

With this technique you can make all or only one of your grab attacks hit other players and is very easy to do.
First look on your grab attack and find moves that can easy blow more than one enemy (roundhouse kicks/very strong punches ...)
If you find one we can begin:

A) grabattack# txt:
1. copy all  that animation from character txt (ez.grabattack2 with bboxes /offsets/jumpframes) and put in new txt (best as copy of knife)
2. use option hitenemy 1
3. use health (not much - enough that enemy can break that - like 2)
4. set noremove to 1 or 0 (depends if you like that this attack can hit 1 or all enemy's - with out counting enemy that you hold)
5.remove first frame of animation (if jumpframe in is use take of -1)
6.replace all frames with empty.gif

B) player txt:
1. add command in this grabattack:
   custknife {name of grabattack.txt)
   throwframe 1 -1

And you are done - now tested.

There is one nice feature of this - if you don't replace all frames from grabattack.txt with empty.gif but instead put in header alpha 1/2/3/4/5/6
your grab attack be have nice shadow ala supers in Street Fighter Alpha

Also you can use this technique to add that shadow to all of yours specials/freespecials/hard attacks. :twisted:


by BonusJZ
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on March 06, 2007, 11:02:26 am
 Thanks alot SamuraiX! :)
 BTW can you please make the words inside 'code' smaller?
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 06, 2007, 11:40:56 am
Well thats about as good as its going to get.
Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on March 06, 2007, 12:08:44 pm
Since we have level branches, you can use it to create a secret bonus level.

Add an end in your level list, and put the secret level behind end.

All you need to do is let an endlevel spawn. You can make an enemy, give it a escape effect in spawn animation(e.g., move fast off the screen and suicide, of set a short lifespan, remember new command lifespan?). Let this enemy spawn this endlevel item.

In that level, just make another endlevel item, come back to the previous level if you wish, or, you can make a level just like super mario\'s warp zone, select different branches.
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on March 06, 2007, 12:34:58 pm
Ah that looks better. Thanks!

BTW uTunnels I'm very courious about branch feature but I missed how to use it. Have you posted it in this forum?
Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on March 06, 2007, 12:45:34 pm
Hah, it was your request, I think.

branch {name}

It can be add in everywhere of a level list, it works just like a label, all levels below it will use this name.

end

It can be add in everywhere of a level list, if this line reached, current set will end.

branch {name}

It is in endlevel item\'s txt file, specify which branch should be used.
Title: Re: BoR & OpenBoR Tricks
Post by: Fightn Words on March 07, 2007, 12:04:27 am
I'm curious about level branching- can you make more than two branches per level? Can these branches occur at places other than the end of the level? Cool feature by the way.
Title: Re: BoR & OpenBoR Tricks
Post by: BonusJZ on March 07, 2007, 12:14:47 am
Quote
I'm curious about level branching- can you make more than two branches per level? Can these branches occur at places other than the end of the level? Cool feature by the way.

I think for both questions - answer is yes

You put that in item (endlevel) so you can spawn it anyware in level and jump to any level/branch
Title: Re: BoR & OpenBoR Tricks
Post by: Fightn Words on March 07, 2007, 03:42:18 am
...So in theory you could make a Guardian Heroes type mod- awesome. I'm sure you've already considered the possabilities BonusJZ, and are probably already using this.
Title: Re: BoR & OpenBoR Tricks
Post by: Mr.Q® on March 09, 2007, 11:54:49 am
Hah, it was your request, I think.

branch {name}

It can be add in everywhere of a level list, it works just like a label, all levels below it will use this name.

end

It can be add in everywhere of a level list, if this line reached, current set will end.

branch {name}

It is in endlevel item\'s txt file, specify which branch should be used.

Sorry man but this still sounds kind of confusing. can you set up an small levels.txt for showing how is it done? Thanx in advance.
Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on March 09, 2007, 01:01:04 pm
Let\'s look at levels.txt of Golden Axe III.

Code: [Select]
file data/levels/vast.txt #The Vast Field
branch b1
file data/levels/mound.txt #Ancient Mound
file data/levels/jungle.txt #Dim Jungle
branch b2
file data/levels/tender.txt #Tender Hamlet
branch b3
file data/levels/cave.txt #Cave of Crystal
file data/levels/street.txt #Bloody Street
branch b4
file data/levels/sand.txt #The Scorching Sand
file data/levels/mountain.txt #Death Mountain
branch b5
file data/levels/voyage.txt #A Voyage To Castle
file data/levels/city.txt #Cursed City
branch b6
file data/levels/eagle.txt #Ride The Whirlwind
branch b7
file data/levels/gate.txt #The Gate of Fate
file data/levels/castle.txt #Castle

Now all you need are 7 endlevel item. Name their branch from b1 to b7.

An example, you spawn b1 and b2 in [The Vast Field], now your character can choose b1 to route [Ancient Mound], or choose b2 to route [Dim Jungle].

You can put none endlevel item in [Ancient Mound], so it will be a normal level, you can defeat the enemies and go to [Dim Jungle].

Now spawn b3 and b4 in [Dim Jungle], right, you can choose between [Cave of Crystal] and [The Scorching Sand].

About command end, you can put it in any place of the level list(below the level you want to make a ending), the game will end there. ( you can use branches to jump over it, though)
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 09, 2007, 09:35:29 pm
Once again props go out to you Utunnels.

We are fast approaching AOTB's feature list, and graphics aside, may well surpass it if and when it comes out.

DC
Title: Re: BoR & OpenBoR Tricks
Post by: Tails on March 23, 2007, 02:50:44 pm
i was looking the D&D video and see the water trick he do is easy one,i tell how to do it,is easy,is done whith a pshotno,one of my darkbor features,pshotno,how to use?
easy,put the pshotno like was on the old bor :
do a weapon char,put this,like on old openbor versions:
playshotno water
and put that aniamtion(can be any) but in this case was run,easy,now you can do that that weapon start at start level on palyer so it will change pshotno of palyer to this one.so you ahve now the water effect,whats happen when you do stage it loads again your char that no have that effects. i hope this help people to do these cool effects,are really easy to do but need imagination.  ;)
Title: Re: BoR & OpenBoR Tricks
Post by: BonusJZ on March 23, 2007, 03:03:16 pm
Quote
are really easy to do but need imagination. 
 

Exactly  ;)
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 23, 2007, 03:10:03 pm
While you are busy using your imagination, let me recommend you forget the shot and knife workarounds for these types of effects.

Shots and knives have the issue of not getting along well when it comes time to stack layers (Try them in a mirror background and you will see what I mean).

Use the new spawn command and you will get much better results. Spawns have more control over initial location, have no layer issues, provide more animation to work with, and unlike shots which may or may not clean themselves, spawns can be given a lifespan; at which point they are history.

DC


Title: Re: BoR & OpenBoR Tricks
Post by: BonusJZ on March 23, 2007, 03:15:38 pm
I use this in my Dungeons&Dragons from long time so there was no spawn/lifespasn command  :) - but still works great
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 23, 2007, 03:18:23 pm
I use this in my Dungeons&Dragons from long time so there was no spawn/lifespasn command  :) - but still works great

Same here, and now I'm paying the price with retro fitting everything. But for someone who never used this trick or any similar, its good advice.

DC
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 23, 2007, 03:19:31 pm
While you are busy using your imagination, let me recommend you forget the shot and knife workarounds for these types of effects.

Shots and knives have the issue of not getting along well when it comes time to stack layers (Try them in a mirror background and you will see what I mean).

Use the new spawn command and you will get much better results. Spawns have more control over initial location, have no layer issues, provide more animation to work with, and unlike shots which may or may not clean themselves, spawns can be given a lifespan; at which point they are history.

DC






So because we opened up the spawn function into a frame command you no longer need knifes and bombs and all those other types of spawns since they are hardcoded..... is that what you are saying....?  I can't wait for OpenBoR 3.0  Its cleanup Time.....  Screw Backward compatibility....    But keep this thread on track!
Title: Re: BoR & OpenBoR Tricks
Post by: KingHerb on March 23, 2007, 03:22:39 pm
Thanks for sharing Tails, i will add the feature now  ;)
Title: Re: BoR & OpenBoR Tricks
Post by: BonusJZ on March 23, 2007, 03:25:44 pm
Quote
Thanks for sharing Tails, i will add the feature now 


Good that I show it in first place in my trailer;)
Title: Re: BoR & OpenBoR Tricks
Post by: Tails on March 23, 2007, 03:27:22 pm
Lol, Looking into it.
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 23, 2007, 03:28:49 pm
No no no... I'm not saying that at all, although for reasons not listed here I don't use them anymore myself. On the other hand, if spawns could be launched with auto movement or a bomb arc...

But for trick effects like water splash, dust running, footprints, blood spats, sweat, etc, and really just about anything that doesn't involve what the projectiles were specifically designed for the spawn system is far better suited for the job. And yes, if you are so inclined, you can even make the intended function of shots/knives/bombs obsolete. By spawning traps (so attack boxes work during idle), you can create far more dynamic projectiles and bombs that circumvent the display layer issues.

I'm not saying the old stuff is bad. Remember, I'm the guy who wrote the trick on how to spawn food and weapons using bomb. But times have changed and those types of workarounds are no longer needed. No reason for new or old modders to bang their heads against the wall when there is a new and better way to get the same effect.

DC


Title: Re: BoR & OpenBoR Tricks
Post by: Mr.Q® on March 23, 2007, 03:33:03 pm
Quote
Thanks for sharing Tails, i will add the feature now 


Good that I show it in first place in my trailer;)

Thank's for being this creative.
Title: Re: BoR & OpenBoR Tricks
Post by: KingHerb on March 23, 2007, 03:37:26 pm
Quote
Thanks for sharing Tails, i will add the feature now 


Good that I show it in first place in my trailer;)

Thank's for being this creative.

Yeah real good, thanks so much for your trailer dude! but would we have this feature without Tails i seriously doubt it   ;)

Title: Re: BoR & OpenBoR Tricks
Post by: BonusJZ on March 23, 2007, 03:39:22 pm
Quote
No reason for new or old modders to bang their heads against the wall when there is a new and better way to get the same effect.

Only the problem is that to the time when they be added things like this there can be new command and they must once again redesign lots of things - that cost/wastes loots of time plus check all of them :P

Backward compability is very imphotant
Title: Re: BoR & OpenBoR Tricks
Post by: Fightn Words on March 23, 2007, 03:41:24 pm
Quote
Backward compability is very imphotant
...for the sake of stability.
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 23, 2007, 03:42:11 pm
Guys, what the heck... I can't tell who is being sarcastic or not...

First of all, splashes are not a particularly difficult or impressive trick. Being doing the same thing for the roostertail effect with my jetski for months, using a not quite, but nearly identical method. We discussed this in a chat room, its not hard at all to figure out or do.

Second, imagination is kind of an obvious statement. DUH! We all know that it takes imagination do build a mod, but I don't think tails meant his statement in a bad way, so no reason to hassle him about it.

Lastly, bonusjz and Kingherb; you guys both need to cool it. We are all on the same side. I think it's a bit childish (not to mention useless) to not reveal how you are doing something, but its also childish to get mad about it.

Come on, it's a community. We aren't out to run each other into the ground here...

DC

Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 23, 2007, 03:44:51 pm
Backwards compatibility is not important if we introduce 16 Bit-Color support, stereo sound and a scripting language.  We've decided that going forward from OpenBoR 3.0 that it will not support old mods....  But old OpenBoR < 3.0 will still receive bug fixes for a limited time.....


Trust me there is allot of junk in the engine at the moment and we are doing are best to clean it up.  While alot of the code will remain...  I would not expect 1 mod to run..... in OpenBoR 3.0 first off as it would not support the gif format.
Title: Re: BoR & OpenBoR Tricks
Post by: Tails on March 23, 2007, 03:45:41 pm
Quote
Thanks for sharing Tails, i will add the feature now 


Good that I show it in first place in my trailer;)

Thank's for being this creative.

Yeah real good, thanks so much for your trailer dude! but would we have this feature without Tails i seriously doubt it   ;)



no problem friend

i repair the file, so in this link.

http://lavalit.com:8080/forum/index.php?topic=26.45
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 23, 2007, 03:46:25 pm
Quote
No reason for new or old modders to bang their heads against the wall when there is a new and better way to get the same effect.

Only the problem is that to the time when they be added things like this there can be new command and they must once again redesign lots of things - that cost/wastes loots of time plus check all of them :P

Backward compability is very imphotant

Two sides to this. backward compatability is nice, but sooner or later you must move on.

Should we remove the old projectile commands? No. But since we now have a better way, people should be told about it. I didn't want to go back and rework my stuff, but I know it will be benificial in the end.

Whether or not you choose to refit your current tricks in D&D is personal and nothing more. But when starting a new module, sticking with the old methods would be beyond silly. That is what I'm trying to get at.

DC
Title: Re: BoR & OpenBoR Tricks
Post by: BonusJZ on March 23, 2007, 03:46:54 pm
Quote
yeah real good thanks so much for your trailer dude but would we have this feature without tails i seriously doubt it  Wink

To tell the true this effect is older than  plyshootno
Its veeeeeeeeeeeeery old  ;)

OK boys - here what i do it :

I use both knife and bomb to have every time that Argail foot touch the ground there is water splash
Now little time time/delay corections and you have this nice effect (i use same technik to make dust from foot when Argail run on hard/dusty surface)

But Tails - thanks for combo feature ;)


Title: Re: BoR & OpenBoR Tricks
Post by: Fightn Words on March 23, 2007, 03:47:56 pm
Quote
Backwards compatibility is not important if we introduce 16 Bit-Color support, stereo sound and a scripting language.
Seriously?Awesome! Ill forego some stability for those features!
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 23, 2007, 03:50:31 pm
Backwards compatibility is not important if we introduce 16 Bit-Color support, stereo sound and a scripting language.  We've decided that going forward from OpenBoR 3.0 that it will not support old mods....  But old OpenBoR < 3.0 will still receive bug fixes for a limited time.....


Trust me there is allot of junk in the engine at the moment and we are doing are best to clean it up.  While alot of the code will remain...  I would not expect 1 mod to run..... in OpenBoR 3.0 first off as it would not support the gif format.

So you decided to move forward with it? Awesome. As I mentioned before I'll be more then happy to help with the scripting aspect in any way I can.

DC
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 23, 2007, 03:55:48 pm
I believe the next release will be the last one I will be involved directly in as far as OpenBoR < 3.0  I need to start spending time with OpenBoR 3.0 and get the new skeleton up and running.
Title: Re: BoR & OpenBoR Tricks
Post by: SX on March 23, 2007, 04:06:08 pm
All I can say is well done to Tails and Bonus!  Both of you have done exactly the same thing using two different methods!  Got to love OpenBoR!  But as far as memory utilization is concerned....  I think Tails would use less memory as he would only be using 2 models.... his default and weapon model.  Unlike Bonus which uses default + bombs + knifes.  Seems like allot.....


What do you guys think?  Lets get technical... thats what its about in this thread!!!
Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on March 23, 2007, 04:25:05 pm
So you decided to move forward with it? Awesome. As I mentioned before I'll be more then happy to help with the scripting aspect in any way I can.
Bad that script runs a bit slow on other platforms.
But if on a PC, nothing is slowed down.
Yeah, thanksful it is not a script based engine, so script might not be updated like 200fps or so(have to test in a strict situation, though).
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on March 23, 2007, 04:29:27 pm
I'll add a third wrinkle. My method also used setweapon, but  I preferred bombs over shots. The splash was the bomb's impact. With this being done inside a looping idle animation, it gave me a rooster tail spray effect behind my jetski. My assumption was that unlike shots, bombs disappear after playing their impact (attack1), without having to actually hit anything and so they were defiantly gone and out of memory.

It doesn't matter anyway. I scrapped it a couple of weeks ago and replaced it with a 1 second lifespan spawn doing the same thing.

DC
Title: Re: BoR & OpenBoR Tricks
Post by: baritonomarchetto77 on March 24, 2007, 09:05:06 am
Backwards compatibility is not important if we introduce 16 Bit-Color support, stereo sound and a scripting language.  We've decided that going forward from OpenBoR 3.0 that it will not support old mods....  But old OpenBoR < 3.0 will still receive bug fixes for a limited time.....


Trust me there is allot of junk in the engine at the moment and we are doing are best to clean it up.  While alot of the code will remain...  I would not expect 1 mod to run..... in OpenBoR 3.0 first off as it would not support the gif format.

The lack of time i am experiencing is not very compatible with the loss of compatibility... it is also true that without SamX OpenBOR would be wery different from what it is now... i am egotistically suffering  :'(

uTunnels, please, can you at least implement the brilliant AI you was planning?
Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on March 24, 2007, 09:30:05 am
Well, there is still a long way to go.
So we have to work on the old engine now.
Title: Re: BoR & OpenBoR Tricks
Post by: baritonomarchetto77 on March 24, 2007, 09:43:11 am
... but SamX spoke about limited time bug fixing...  :teary_eyed:

(i know, i know... i am OT  :nervous: :teary_eyed:)
Title: Re: BoR & OpenBoR Tricks
Post by: Tails on March 26, 2007, 07:14:18 am
Well today i talk about another trick, is the one i use on Beat of Fighting mod,the night effect of stage 4-2, How to do it,the easy way is getting a screen layer (a new gif image) of 244 of tall whith a unique color (example blue,red,white,black) as a none object whith alpha,that stay at 240 when spawn to be forward all other objects,so whith this you can do a night place,a hotplace whith flames,or a extra light stage,or to do shadows on a street.so i hope this help to all people.
Title: Re: BoR & OpenBoR Tricks
Post by: Orochi_X on June 16, 2007, 03:16:35 pm
Here's a quick tip....

You can now use the new jumpframe command ( jumpframe {frame} {y} {x} {z} ) instead of move commands.

Code: [Select]
anim freespecial5
        loop    0
        delay   3
        offset  36 77
        jumpframe 0 0 2 0
        frame   data/chars/iori/qcbp02.gif
        offset  35 74
        frame   data/chars/iori/qcbp03.gif
        offset  34 81
        frame   data/chars/iori/qcbp04.gif
        offset  35 102
        frame   data/chars/iori/qcbp05.gif
        offset  26 95
        delay   6
        frame   data/chars/iori/qcbp06.gif
        offset  20 98
        delay   16
        frame   data/chars/iori/qcbp07.gif
        offset  23 99
        delay   8
        frame   data/chars/iori/qcbp08.gif



The above example has Iori sliding smoothly across the floor without repeating frames.   :cheers!:
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on June 16, 2007, 04:37:50 pm
Not bad OX, but try this on for size. Unzip the attached file and put it in "data/scripts" (make the folder if you don't have it).

Now put this in your entity header: "animationscript data/scripts/lib001.c"

Finally, add this above the frame you want movement on:

@cmd velo001 {X} {Y} {Z}

X, Y, and Z are obviously the speed settings and you can even use decimals (but if < 1 you still have to include a 0, like "0.5"). The engine will override it as soon any other animation with movement starts, but you can also use this to stop manually:

@cmd velo001 0 0 0

Like for Iroi there, you would use:

Code: [Select]
anim freespecial5
        loop    0
        delay   3
        offset  36 77
        @cmd    velo001 2 0 0
        frame   data/chars/iori/qcbp02.gif
        offset  35 74
        frame   data/chars/iori/qcbp03.gif
        ....

The effect is the same, but the advantage over jumpframe is that you can use an infinite number of @cmd in an animation (so one animation could start moving, speed up, slow down, stop, start up again, and so on as much as you wanted) and it's also simpler to work with; no counting frames and no guesswork, just put the @cmd above the frame(s) that you want to start moving on.

This script file also has a whole bunch of other functions in it including a @cmd jump Y X Z which is an exact replica of Jumpframe but with the advantages I just listed. As soon as I can, I'll be posting a tutorial on the rest of the goodies in that file and a few more. I just need a chance to sit down for more then 10 minutes in a stretch.

DC

Attachment timed out.
Title: Re: BoR & OpenBoR Tricks
Post by: Orochi_X on June 16, 2007, 06:29:39 pm
Nice , will be useful for fine tuning  ;)
Title: Re: BoR & OpenBoR Tricks
Post by: zamuel on July 17, 2007, 10:55:19 am
I had been hard coding this trick when there was a simpler way all along

 Launchers

 Intro:This rather simple trick allows you to create moves that launch opponents in the air for juggles.
 Procedure:
 Using the "jumpframe {frame}   {height}" command within a pain animation allows you to pop entities up in the air.  The beauty of using jumpframe versus hard coding "movea" commands is that the engine does the work for you and it animates alot smoother.  Based upon your game settings it allows you to set up a solid juggle system.

Code: [Select]
jumpframe {frame} {height}

~If this command is present, the entity will perform a jump once frame {frame} is reached.

~Only one jumpframe command counts- you can't jump more than once in an animation by putting
                 more in, even if the entity lands before the next jump starts.

~The style of jump depends on the characer performing the jump and the {height} value:

Height is 0: Player: The jump is very low, but the character moves forward.
Enemy: The jump is high and vertical.

Height > 0: Player: The jump is {height} high, and vertical.
Enemy: The jump is {height} high, and moves forward.


 by Zamuel

A crucial step I forgot to add to this trick is that you need a bbox in the opponent's fall animation to allow you to hit them multiple times when airborne.  Also, you need to add bbox 0 to the final falling frame so that you can't continue to combo the enemy after they hit the ground (unless you want OTG combos...).
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on July 17, 2007, 11:08:36 am
You should also note that you don't need jumpframe anymore for juggles. Try the dropv command (see Feature Archive). Dropv is a command you place in the attack that will adjust the hit character's X, Y, and Z flight path on a knockdown.

The obvious advantages are that its a lot easier to use, and the height of the "juggle" is determined by the attack; meaning you can reuse the same fall animation for juggles of all calibers. One attack might lift the vitcum a little, another might send him to Mars. Also look up and try damageonlanding (it does more then what the name implies) for even more fun. For that matter, I would advise everyone to look over the feature archive carefully. You will find that many of the tricks and complex workarounds in this thread are now fully obsolete as their effects can be done with ease using the new features.

DC
Title: Re: BoR & OpenBoR Tricks
Post by: zamuel on July 18, 2007, 09:10:30 am
You should also note that you don't need jumpframe anymore for juggles. Try the dropv command (see Feature Archive). Dropv is a command you place in the attack that will adjust the hit character's X, Y, and Z flight path on a knockdown.

The obvious advantages are that its a lot easier to use, and the height of the "juggle" is determined by the attack; meaning you can reuse the same fall animation for juggles of all calibers. One attack might lift the vitcum a little, another might send him to Mars. Also look up and try damageonlanding (it does more then what the name implies) for even more fun.

I still might use jumpframe for this very reason.  Enemies (and PCs) have different "weights" that I've been controlling with the jumpframe heights.  While dropv sounds very useful, it sounds like I'll be stuck with Wolverine high kicking Juggernaut to the moon when Juggy should barely move.
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on July 18, 2007, 09:45:21 am
I had a feeling you might say that.  ;)

It is true, dropv won't account for weight, and in this case I like to fall back to script. Yeah I know, it's my answer for everything, but really, script IS that powerful and versitle.

Point being though, if you want to account for weight (I don't, I've got enough to deal with using armor ratios vs. attack types), then go with script or jumpframe. If you don't account for weight or prefer attack power to be determining factor, go with dropv. It will save you a load of time and trouble.

DC

Title: Re: BoR & OpenBoR Tricks
Post by: bWWd on August 27, 2007, 09:56:27 am
Not really some super trick but i was wondering how to make character display in front of enemy while you throw him  and i did it by using simple "movez 5" command in first frame of throw and it works, so if anyone will had similar problems this is solution.But this doesnt work good when stage "zmin" and "zmax" are the same number.
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on August 29, 2007, 01:58:54 pm
 Well for that case, a script function in my script demo 3 name 'move' could do it. It works just like normal 'move' and 'movez' but it ignores obstacles and walls. OpenBoR however stabilize it by putting the entity back in playing area if entity moves outside of the area.
 I've tried this near min z limit and it works :).
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on September 14, 2007, 01:19:21 pm
It's been a while since I posted tricks here. OK here are 2 tricks:

 Custom Block SFX

 Intro: OpenBoR supports block ability but we can only have one kind block SFX which is block.wav inside sounds folder. This trick removes that limitation and allows various block SFX to be used in one mod.
 This trick only sets one custom block SFX for each character but it's not big problem since there's only one block animation per character.
 Procedure: 1st of all we need to disable default block SFX. For those who don't know, if block.wav is not available, OpenBoR will use default hitfx (beat1.wav) for block SFX. We don't want that SFX to be used.
 1. Make a compatible wave file with silence as the sound.
 2. Name that file block.wav and put in inside 'sounds' folder.

 If done, we won't hear anything when character blocks an attack.
 Where's the custom block SFX you ask? that's the 2nd part is all about which is about setting that file.
 1. Obviously prepare the custom block SFX. Make sure it's compatible with OpenBoR.
 2. Put that file in any folder inside data folder. Any folder will do but it's best to put it in 'sounds' folder.
 3. Open character's text whom you want the SFX for. The character must be able to block of course.
 4. Read his/her 'bflash' then open the text.
 For instance:
Code: [Select]
name  Block
type  none
toflip  1
shadow  0

anim idle
loop 0
delay 4
offset 16 16
frame data/chars/misc/block01.gif
frame data/chars/misc/block02.gif
frame data/chars/misc/block03.gif
frame data/chars/misc/block04.gif
frame data/chars/misc/block05.gif
frame data/chars/misc/block06.gif
frame data/chars/misc/block07.gif

 5. Add 'sound' to 1st frame. Sound points to the custom block SFX you have prepared. For instance, the above text would be like this:
Code: [Select]
name  Block
type  none
toflip  1
shadow  0

anim idle
loop 0
delay 4
offset 16 16
        sound data/sounds/black.wav
frame data/chars/misc/block01.gif
frame data/chars/misc/block02.gif
frame data/chars/misc/block03.gif
frame data/chars/misc/block04.gif
frame data/chars/misc/block05.gif
frame data/chars/misc/block06.gif
frame data/chars/misc/block07.gif
'black.wav' is the custom SFX here.
 
 Everything's all set here. When this character blocks, 'block.wav' will be played but since it is a silence, nothing will be heard. OTOH block flash will be played together with the custom block SFX making it as if it's the block SFX.

 For alternate block SFX, simply make another block flash like above then set different SFX to be played. After that set the flash to desired character.

 Custom Blast Effect

 Intro: This trick is about making our own blast effect. Default 'blast' uses PAIN and FALL for opponents' animation. Since both animations are default, it would also be used by other actions such as attack and throw. Modifying those 2 animations would cause more problems.
 This trick solves that problem by using new features in ver 2.0917 to make blast. This trick allows graphical effect like burnt or shocked while being blasted.
 Procedure:
 Blast have 2 properties:
 a. knocking opponents down farther than usual knockdown attack
 b. knocked opponents can hit others.

 1st property can be made with 'dropv' while the 2nd with 'damageonlanding'. Both requires knocking down attackbox so they should be set together like this:

Code: [Select]
  damageonlanding 0 1
  attack#         x y width height damage 1
  dropv           3 3 0

  'damageonlanding' has 0 damage so opponent won't be hurt after landing on ground. This feature is to replicate throw actually but since we are not throwing here so damage is set to 0.
  The 2nd variable is set to 1 to get blast's 2nd effect (b above). 2 can be used also but it's best to stick to 1 so opponents can't land after hit by this attack.

  attack# means any attackbox can be used. Well, 'attack' can also be used but that would reduce the flexibility so use other ones instead. Any settings can be used for the attackbox but it has to be knockdown attack obviously.
 Since custom attackbox is used, we can have any animations used for opponent's PAIN# and FALL# animations. Just set desired animations as those animations. Of course DEATH# is also possible.

 'dropv' sets opponent's falling arc after hit by this attack. It works just like 'jumpframe' except that it's set from attacker's side instead. 3 3 0 is sample setting to make it look like defaault 'blast'. You can change it if you want opponent to fall farther, closer, higher or lower.

 Set above settings to character's animation and you have custom blast effects with their own PAIN and FALL animation. Don't forget to add custom 'hitfx' and 'hitflash' to make it cooler!!
Title: Re: BoR & OpenBoR Tricks
Post by: Fightn Words on September 14, 2007, 07:38:34 pm
Very nice, very usefull.
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on December 17, 2007, 12:09:35 pm
 No new tricks here, just posting link for old and 1st OpenBoR Tricks:

http://www.borgeneration.com/BORRev/forum/viewtopic.php?t=73

 Some tricks there need fix like setting secret char. Most is right except for the placing part.

 BTW SumolX, what's wrong with GLOW setting? previously, it makes letters glow but now it makes big red box behind the letters instead.
Title: Re: BoR & OpenBoR Tricks
Post by: SX on December 17, 2007, 12:27:11 pm
  BTW SumolX, what's wrong with GLOW setting? previously, it makes letters glow but now it makes big red box behind the letters instead.

No Idea....  Perhaps you found a bug in SMF software?
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on December 17, 2007, 01:19:41 pm
 OMG! I'm using Firefox now! Maybe it's different if I'm using IE instead.
Title: Re: BoR & OpenBoR Tricks
Post by: kbandressen on December 17, 2007, 01:51:25 pm
Haha, I'm using Firefox and see the big red box as well!  Weird...
Title: Re: BoR & OpenBoR Tricks
Post by: Damon Caskey on December 17, 2007, 02:53:54 pm
Opera does it too. Didn't use to. Odd.

DC
Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on December 18, 2007, 02:55:53 pm
<td style="filter: Glow(color=red, strength=2); font: inherit;">GLOW</td>

Maybe FF or Opera treates that filter as a property of td tag.



Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on December 18, 2007, 03:05:15 pm
It is true, dropv won't account for weight

 ;) Perhaps we need that weight property, not just a stupid jumpheight that do many things.

Although we have antigravity property, but it will make entity float if you give it a positive value.
Title: Re: BoR & OpenBoR Tricks
Post by: kbandressen on December 18, 2007, 04:27:29 pm
Yeah, I've been using antigravity to tweak how fast entities fall.
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on December 21, 2007, 12:30:05 pm
 Where can I find info about 'antigravity'? It's not in manual and features archive yet
Title: Re: BoR & OpenBoR Tricks
Post by: utunnels on December 22, 2007, 08:01:06 am
Oh, let me check the feature list, it is old, maybe before script engine.

-------------

Posted.
http://lavalit.com:8080/index.php?topic=307.90 (http://lavalit.com:8080/index.php?topic=307.90)
Title: 2 more tricks!!
Post by: Bloodbane on May 05, 2008, 02:36:34 am
(cough cough!) Oh what a dusty thread! How has it been since last tricks were posted. Anyways, time to post 2 more tricks here.

 Bouncing Rolling Drums

 Intro:I'm sure all of you are familiar with Rolling Drums. Almost all Capcom brawlers have them although not present in all levels. Making Rolling Drums is quite easy but what I'm explaining here is how to make them bouncing after falling from certain height. FYI subtype arrow which is the type used for making Rolling Drums aren't affected by gravity, that's why they can't fall and thus can't bounce. How to solve that? Read below.
 Procedure:1st of all, here's an example of rolling drum text:

Code: [Select]
name   RollDrum
health   5
speed     9
type   enemy
subtype   arrow
shadow   0
icon   data/chars/misc/drumicon.gif
diesound  data/sounds/klunk.wav
noquake   1
candamage player enemy obstacle

anim idle
        loop    1
delay 10
offset 42 52
bbox 2 -20 77 79
        attack  2 0 77 59 10 1
        frame data/chars/misc/rldrum01.gif
        frame data/chars/misc/rldrum02.gif
        attack  0
        frame data/chars/misc/rldrum03.gif
        frame data/chars/misc/rldrum04.gif

anim fall
delay 25
offset 28 82
        frame data/chars/misc/bdrum01.gif
        frame data/chars/misc/bdrum02.gif

 For those who don't know how to make rolling drum, that's how. Quite similar to making obstacles, except that there's attackbox in IDLE animation.

 Like I said before, this rolling drum will roll normally except that it can't fall to holes or to be exact it's not affected by gravity. To solve that, add 'no_adjust_base  0' and 'subject_to_hole 1' to the header. The former enables gravity to affect this rolling drum while the latter allows it to fall to holes.
 Aside from those, there's another command to add for bounce effect. It's 'bouncefactor' in IDLE animation. This command sets how this drum bounces (read manual for more info).
 Here's how the text would be:

Code: [Select]
name         RollDrum
health         5
speed           9
type         enemy
subtype         arrow
shadow         0
icon         data/chars/misc/drumicon.gif
diesound        data/sounds/klunk.wav
noquake         1
candamage       player enemy obstacle
subject_to_hole 1
no_adjust_base  0

anim idle
        loop    1
delay 10
offset 42 52
        bouncefactor 2
bbox 2 -20 77 79
        attack  2 0 77 59 10 1
        frame data/chars/misc/rldrum01.gif
        frame data/chars/misc/rldrum02.gif
        attack  0
        frame data/chars/misc/rldrum03.gif
        frame data/chars/misc/rldrum04.gif

anim fall
delay 25
offset 28 82
        frame data/chars/misc/bdrum01.gif
        frame data/chars/misc/bdrum02.gif

 I chose 'bouncefactor 2' cause the bounce effect is higher than bigger values. The rolling drum is set.
 Wait! There's another thing to set. In order to make this drum bounce, it needs to be spawned with certain height. To do that, give starting altitude in level texts like this:

Code: [Select]
spawn Rolldrum
alias   Drum
flip    1
coords -200 195 100
at 400

spawn Rolldrum
alias   Drum
flip    1
coords -200 165 200
at 450

spawn Rolldrum
alias   Drum
flip    1
coords -200 225 300
at 500

 The 3rd value in 'coords' sets the altitude. When this rolling drum is spawned, it will fall from that height and bounce when it hits ground.
 You can set any height value you want but remember, higher value gives higher bounce.
 Limitation: Maybe some of you wonder, is there any SFX played when the drum bounce? the answer is yes. The SFX is fall.wav, same SFX you hear when any entity falls to ground.
 AFAIK there's no way to change this SFX just for this drum so metal drum would sound like fallen box when it bounces. You can't put the SFX in IDLE since we can't tell at which frame drum will land.
 The only possible solution to this is script, update script to be exact.


 Custom Throw (Pseudo Throw)

 Intro:I'm very sure every BoR player knows about throwing in BoR and OpenBoR. If you haven't, play Beats of Rage to see it. Anyways, this throw action is performed with THROW animation for players, enemies and NPCs. Although there are many commands to modify this old throw, there are some aspect which aren't modifiable such as the thrown animation. Old throw uses FALL animation as thrown animation which limits modder cause they can't change the animation without conflicting with other attacks.
 This trick solves that problem and even better it allows modifying throw better. This is for players only but it's easily modified for enemies and NPCs.
 BTW before I start, the old throw BoR use is not really a throw although the effect is similar, that's why I named it  Pseudo Throw. The trick below is Pseudo Throw also.
 Procedure:1st of all, DO NOT use THROW animation anymore. Replace it with GRABBACKWARD instead. The latter animation has same command with THROW which is back+attack while grabbing enemy. Don't worry, THROW is no longer mandatory.
 Now look at example from Athena's throw below:

Code: [Select]
anim grabbackward
offset 42 114
delay 8
        hitfx   data/sounds/silent.wav
        attack2 42 64 40 50 0 1 1 1
        forcedirection 1
        damageonlanding 26 1
        dropv   4 3 0
        sound data/chars/athena/throw.wav
frame data/chars/athena/throw01.gif
        attack  0
frame data/chars/athena/throw02.gif
        frame data/chars/athena/throw03.gif
        delay   18
        frame data/chars/athena/throw04.gif
        frame data/chars/athena/throw05.gif
This looks similar to normal grabattack but attackbox here starts throw instead of just knocking.
 The idea here is to knockdown grabbed enemy then modify enemy's fallen condition to make it like throw. Here's the details:
- attack2: This is the knockdown attack. It also sets knockdown enemy to FALL2 which is used as thrown animation. The attackbox could be anywhere but make sure it hits grabbed enemy. And this attackbox has 'noflash' set, this is so that there's no flash shown when this attackbox hits. It's also unblockable to prevent blocking enemy to block this throw. It doesn't inflict any damage since the real damage will be dealt by other command below.
- hitfx: This is the SFX for the attack. I used silent.wav so the attackbox won't make any SFX.
- forcedirection: This is to set thrown enemy's facing direction. Old BoR throw flips grabbed enemy so I used 'forcedirection 1' for that purpose. You can use -1 if you don't want flip effect (read manual for more info).
- damageonlanding: Like the name implies, this is to set damageonlanding from this throw. 1st value is for the damage while the 2nd activates the attackbox in FALL2 animation. IOW the 2nd makes thrown enemy able to hit others (it's limited to 'projectilehit' though).
- dropv: This is to set the thrown arc. 1st for thrown speed in y axis or altitude, 2nd for x axis and the 3rd is for z axis. I used values above but you can use any value you want.

 The 2nd attackbox simply turns off the previous attackbox.
 The throw in Athena's grabbackward is set and ready to use.
 Expansion:This trick above doesn't have 'throwframewait' effect meaning the throw immediately starts when GRABBACKWARD is performed. To add that effect, you need to stun the enemy 1st for some time (stun 1 second if you want to wait for 1 second or less before throwing, 2 seconds for more and so on). That means, you need another attackbox for stun effect.
 Since there are 2 attackboxes with different purpose, 'attack 0' and 'fastattack 1' are required.
 Limitation:This Pseudo Throw technique is simple and easy to use but it also has limitations:
1. Old BoR throw can throw enemies with 'nodrop' or 'knockdowncount' set but this trick can't.
2. Thrown enemy always fall in an arc so don't expect throw like Final Fight 3 Haggar's throw.
3. You might have trouble aligning properly with thrown animation.
 All of these can be solved with script however the technique will be changed to Play-Opponent Technique. This technique is heavily script & trick based and takes long explanation so I won't describe it now.
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on October 23, 2008, 05:57:06 am
 OpenBoR has grown alot, especially now with script, we can make more effects and features ourselves. This thread doesn't use script when it's started. Now since scripts are available, tricks with script could be added to this thread too. I'll post one trick:

 Local Branching

 (http://i11.photobucket.com/albums/a177/DBloodbane/Crime%20Buster/LocalBranch.gif)

 Intro: Some beat em up games have multiple paths or branches such as Final Fight 3 and Peacekeepers. The branch types varies from local branches, global branchies to action based branches. I'll give brief explanation about some of them:
 a. Local Branch = Branch that gives option to alternate path(s) in which all paths lead to same level. IOW this branch doesn't alter main path.
 b. Global Branch = Branch that gives option to alternate path(s) in which each path leads to different levels. IOW this branch alters main path.
 c. Time based Branch = Branch that gives option to alternate path(s) which is activated by time. Doesn't matter if it's local or global branch.
 d. Action based Branch = Branch that gives option to alternate path(s) which is activated by certain actions. Doesn't matter if it's local or global branch.
 Although I haven't tried it, I'm sure all mentioned above is doable in OpenBoR (possibly with script). The one I'm going to explain here is local branch.
 Procedure: Before I start, please read basic tutorial about 'setting branch' in other thread cause the basics of branching have been explained there.
 As a start, I'll post example of level set with branch set:

Quote
...
file    data/levels/level1.txt # <-- branch location
file    data/levels/level2a.txt
file    data/levels/level3a.txt
...    (It's not typed like this, it means there are more levels here)
end
branch  2b
file    data/levels/level2b.txt
file    data/levels/level3b.txt
...    (It's not typed like this, it means there are more levels here)
end

 Actually the last end is redundant but I type it to empashize that levels ends there.
 Anyways, take a look on levels. There is a 'branch' before level2b which brings to that level. There's 'end' before that 'branch' to end game.
 As you can see, taking branch in level1 brings player to level2b while finishing level1 normally brings to level2a. Simply put there are 2 main paths here, one is signed with 'a' and the other with 'b'.
 Now, what should we do if we want to change level set above so the 2 main paths converge in one level, say level3? or make local branch?
 See diagram below:

            /-> Level2a -\
 Level1 -|                 |-> Level3 - ...
            \-> Level2b -/

 One simple idea is by duplicating level sets so both paths contain same levels except for alternate ones. Unfortunately this idea is waste of levels not to mention it become more redundant if there are more local branches like above. Even worse, number of levels and scenes in a set is limited to 100 so obviously this idea is bad.

 The other idea is by forcing players to go to level after level2b (level3) when level2a is finished.
 See diagram:

file    data/levels/level1.txt # <-- branch location
file    data/levels/level2a.txt --
branch  2b                           |
file    data/levels/level2b.txt   |
file    data/levels/level3.txt  <-
...    (It's not typed like this, it means there are more levels here)
end

 From the diagram you can see that this idea is efficient not wasteful like previous one. This is what we used here.

 How are we going to do it? the answer is script. This is the script:

Quote
jumptobranch({name}, {immediately});

{name} can be any branch in current set, but you can't jump between sets because it is against current game logic.
{Immediately} can be 0 or 1. When set to 1, you will go to that level immediately, or, you will go to that level when current level is completed.

 This function is used with its flag set to 0, meaning the branchname defined in the function will be accessed after level is completed, in this case level2a. Since we want to bring players to level3, we put a branch there like this:

Quote
file    data/levels/level1.txt # <-- branch location
file    data/levels/level2a.txt
branch  2b
file    data/levels/level2b.txt
branch  3
file    data/levels/level3.txt
...    (It's not typed like this, it means there are more levels here)
end

 Branchname is 3 so the function becomes:

jumptobranch("3", 0});

 Now where to put this? since this function changes level to go to in level2a, it must be 'put' there. One way to put it is by making an invisible entity with this function like this:

Code: [Select]
name 3Br
type none
shadow 0

anim idle
@script

  jumptobranch("3", 0);
@end_script
delay 10
offset 1 1
frame data/chars/misc/empty.gif

 Don't forget to declare this entity in models.txt of course.
 After we have this entity, we must spawn in level2a. It can be placed anywhere in that level but make sure it is spawned otherwise it won't work.

 If you have set those properly, local branch is ready to use. Whichever path you choose (level2a or level2b) brings players to level3.

 Limitation: If there's another branch type in level2a, there could be conflict. To avoid it, simply spawn the entity above late in the level or before level ends normally.
 Another thing to note is this trick is best used if level2a can only be cleared normally (kill all enemies, defeat bosses or timer hits 00). If level2a can only be cleared by touching branch or other script based branch, it's recommended not to use this to avoid conflict.
 Extra: The technique above can also be used if the local branch goes to room or dead end. Example: rooms in 5th stage of Final Fight 3. The extra work you need is making clone version of the level where the branch was.
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on January 10, 2010, 11:25:17 pm
 Whoa, it's been more than a year since I posted. Alright, time for this...

 Whoooooooooooooo (sound effect of vacuum cleaner)

 Done! (cough cough). Now to the tutorials,

Custom Arrows

(http://i11.photobucket.com/albums/a177/DBloodbane/Contra/Contra16.png)

 Intro: While playing a mod, you should notice an arrow which appears everytime a 'wait' area is cleared. This arrow is unfortunately not customizable aside of its sprite. Aside of only appearing after clearing 'wait' area, it's animation is limited to blinking.
 Good news is latest OpenBoR allows modders to make their own 'arrow' and set its properties such as animation and position. Even better, this arrow can appear anywhere not just after wait. This tutorial will describe how to make such custom arrow.
 Procedure: Before we start, the custom arrow is an entity which means it must be loaded in models.txt and spawned in level. Also the default arrow must be 'disabled' to avoid conflict with this arrow.
 1. Disabling default arrow
 Simply use a blank image as arrow.gif and put it in data/sprites folder
 2. Creating custom arrow
 Let's see an example of custom arrow:
Quote
name     Arrow
speed     10
type     Panel
shadow     0
lifespan   3
setlayer  300

anim idle
   loop   1
   delay   50
   offset   12 149
   frame   data/chars/misc/arrow.gif
   frame   data/chars/misc/empty.gif

 One important trait default arrow has is that it scrolls together with player. In order to replicate that trait, panel type is used. By setting 'speed 10', the panel type entity will scroll together with player.
 Next, this arrow shouldn't cast shadow so 'shadow 0' is set. Then 'setlayer 300' is set to make arrow placed in front of other entities, just like default arrow. 'Lifespan 3' defines that this arrow will appear 3 seconds before removing itself.
 For the arrow animation, IDLE defines it. In this animation, you can set animation delay and used frames.
 3. Spawning arrow in level text
 To spawn this arrow, simply use 'spawn' command like this:
Quote
spawn   Arrow
coords   63 190
at   1000
Although this step is sufficient, you might want to modify the spawn coordinates to adjust arrow's position. Don't worry about it's z coordinate, this arrow has been set to be in front of other entities.
 Actually, the arrow should be placed after wait is cleared however since it's an entity, you can spawn it anytime and anywhere.
 Issue: Since this arrow is an entity, it's spawn location might conflict with walls, obstacles, platforms or holes. To solve that simply set these:
Quote
antigravity      100
subject_to_wall  0
subject_to_obstacle 0
subject_to_platform 0
'Antigravity 100' makes entity unaffected by gravity which also prevents it from falling to holes.
 subject_to ... 0 commands make entity unaffected by respective object.
 Extra: You can omit 'lifespan' to make the arrow live long. It's useful if you want to guide players. It's also useful to show branches so players won't need to look for the latter themselves.
 Another effect you can add is sound effect. The default SFX is go.wav in data/sounds folder. You need to remove that .wav file and declare in the arrow text above to make it synch with the animation.


Delay

 Intro: Delay is simply for delaying spawns or level objects in level text for couple seconds. Why would one want to delay them? well, would it be nice if a boss spawn is delayed until level music completely fades, for example? or enemy spawn is delayed to show some background animations? In normal levels, those are some examples of uses. In pseudo travelling levels such as bike ride and elevator levels, delay is very useful cause those level spawns are only controlled by 'group' instead of scrollposition. Of course, with creativity, more usage could be gained.
 Procedure: In order to delay spawns or level objects in level texts, 'group' command is used. However enemy type is required 'group' will count it.
 Here's an example of delay entity:
Quote
name       delay
health       10
type       enemy
shadow     0
nomove     1

anim idle
@script
    void self = getlocalvar("self");
    int  Health = getentityproperty(self, "health");

    if(frame==1){
      changeentityproperty(self, "health", Health-5);
      if (Health <= 0){
        killentity(self);
      }
    }
@end_script
   loop   1
   delay   49
   offset   1 1
   frame   data/chars/misc/empty.gif
   delay   1
   frame   data/chars/misc/empty.gif

 'Nomove 1' is set to prevent this enemy from using WALK animation forcing this entity in IDLE animation. Shadow is disabled and blank gif is used cause this delay is invisible.
 The script in IDLE animation above works like this:
 Current health is attained then at 2nd frame, it is deducted 5 units. Notice that it takes 49 centiseconds before playing 2nd frame. After that the animation loops and the cycle repeats. That means, every 0.5 second or half second, delay loses 5 unit health. When health reaches 0, this entity removes itself. The default health is 10, meaning this entity will die on its won after 1 second is passed.
 That's how this delay works. Since health can be altered in level texts, we can set delay time to any time we want, for instance, setting health 1200 means 2 minutes delay.

 In order to use this, group settings must be set to something like this:
Quote
group   1 1
at   0

spawn   delay
health   580
coords   160 200
at   0

 Any coordinate will do since it's invisible but try not to spawn it outside screen and playing area.
 With this grouping, the next group of spawns will be held or delayed until this delay entity dies on its own.
 Limit: The delay time which can be set with this trick is limited per half seconds so you can't set say 1.2 seconds delay with this. The script and animation must be adjusted for that.
 Extra: If combined with enemy's SPAWN animation, you could make cool spawn effect in which group of enemies come one by one instead of all at once. Here's an example:
Quote
group   4 4
at   0

spawn   TopanS
alias   Topan
flip    1
map     5
coords   -60 225
at   0

spawn   delay
coords   150 195
at   0

spawn   delay
coords   150 195
at   0

spawn   delay
coords   150 195
at   0

spawn   TopanS
alias   Topan
flip    1
map     5
coords   -60 205
at   0

spawn   delay
coords   150 195
at   0

spawn   delay
coords   150 195
at   0

spawn   TopanS
alias   Topan
flip    1
map     5
coords   -60 185
at   0

spawn   delay
coords   150 195
at   0

spawn   TopanS
alias   Topan
flip    1
map     5
coords   -60 165
at   0

group   1 1
at   0

 In this example, 4 TopanS will come one by one and it's similar to how the archers appear in King of Dragons.

Alternate Portal

(http://i11.photobucket.com/albums/a177/DBloodbane/Contra/ContraP.png)

 Intro: For those familiar with branch feature, it's nice thing to add branches in mod, adding replayability to the mod. However, endlevel type entities which are used for the portal can't detect player's altitude or IOW player must be on ground to activate the portal. In normal levels, it's not big deal but in 2D levels, that's a big problem.
 This tutorial will describe how to make alternate portal which can detect altitude allowing the portal to be placed in high places (or in lower places ;) ).
 Procedure: Just like regular portal, this portal is an entity however it's not endlevel type. The example will be using type none but it can be other type, other than endlevel that is.
Quote
name       Portal
nomove      1
type       none
nolife     1
score      0 -1
antigravity     100
candamage     player
setlayer      100


anim idle
   loop   1
   delay   50
        followanim 1
        followcond 1
   offset   13 27
   attack   1 2 32 26 0 0 1 1
   noreflect   1
        hitfx   data/sounds/silent.wav
   frame   data/chars/misc/arrowr.png
   frame   data/chars/misc/empty.gif

anim follow1
   delay   50
   offset   13 27
   frame   data/chars/misc/arrowr.png
        @cmd    jumptobranch "Branch1" 1
   frame   data/chars/misc/empty.gif
   frame   data/chars/misc/arrowr.png

 This portal works by 'attacking' player then in its follow animation, it will run jumptobranch script which ends current level and jumps to branch named 'Branch1' in level set. The word 'attacking' is what literally it does but actually player is the one who touches this portal.
 This portal has 'antigravity 100' allowing it to be placed anywhere without falling.
 Nolife 1 and score 0 -1 are set to prevent lifebar shown onscreen and to prevent player from getting score when touching this portal.
 'setlayer' is optional, this example has the portal in front of other entities but it can be behind if desired.
 'candamage player' defines that player is the only type that can be 'touched' by this portal.
 IDLE animation holds the portal visuals and attackbox. The latter will work as the touching area for portal. Since attackbox could cause sideeffects, this attackbox is set to produce no flashes, no effect (with 'noreflect 1') and no sfx with silent hitfx. Then  a followup is set which is FOLLOW1 animation. This animation holds the animation that will be played if this portal is touched. It also holds jumptobranch script which does ends current level and jumps to 'Branch1' branch.
 This portal is ready to be placed.
 Issue: Since it's using attackbox, portal won't hit player if the latter's bbox isn't active or if player is in invincible mode.
 Another issue is, if player has 'takedamagescript', it will fire when touching this portal. To solve this, use alternate attacktype which is ignored by 'takedamagescript'.
Title: Re: BoR & OpenBoR Tricks
Post by: Fightn Words on January 11, 2010, 04:55:05 am
Thank you Bloodbane, nice tutorials! I think it's pretty useful to be able to place an entrance or exit anywhere that you need to for certain games. Also- one of my mods I planned to use custom animated arrows simply because the regular flashing one is too dull...
Title: Re: BoR & OpenBoR Tricks
Post by: Bloodbane on July 17, 2010, 03:52:39 am
Generic Portal

(http://i11.photobucket.com/albums/a177/DBloodbane/Contra/ContraP.png)

 Intro: Generic Portal is advanced version of Alternate Portal above. They work exactly the same. The only difference is that Generic Portal allows modder to set different branch in level texts without making another portal.
 This tutorial will describe how to modify alternate portal to make generic portal.
 Procedure: 1st, here's example of alternate portal:
Spoiler
Quote
name       Portal
nomove      1
type       none
nolife     1
score      0 -1
antigravity     100
candamage     player
setlayer      100

anim idle
   loop   1
   delay   50
        followanim 1
        followcond 1
   offset   13 27
   attack   1 2 32 26 0 0 1 1
   noreflect   1
        hitfx   data/sounds/silent.wav
   frame   data/chars/misc/arrowr.png
   frame   data/chars/misc/empty.gif

anim follow1
   delay   50
   offset   13 27
   frame   data/chars/misc/arrowr.png
        @cmd    jumptobranch "Branch1" 1
   frame   data/chars/misc/empty.gif
   frame   data/chars/misc/arrowr.png

 Now modify it into this:
Spoiler
Quote
name       Portal
nomove      1
type       none
nolife     1
score      0 -1
antigravity     100
candamage     player
setlayer      100

anim idle
   loop   1
   delay   50
        followanim 1
        followcond 1
   offset   13 27
   attack   1 2 32 26 0 0 1 1
   noreflect   1
        hitfx   data/sounds/silent.wav
   frame   data/chars/misc/arrowr.png
   frame   data/chars/misc/empty.gif

anim follow1
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame == 1){
      jumptobranch(Name, 1);
    }
@end_script
   delay   50
   offset   13 27
   frame   data/chars/misc/arrowr.png
   frame   data/chars/misc/empty.gif
   frame   data/chars/misc/arrowr.png

 As you can see, the script in FOLLOW1 is changed while the rest remains the same. What this script do is acquire this portal's alias then in 2nd frame, jumps to branch with that alias.
 See above picture. This is example of how to set it in a level:

Spoiler
Quote
spawn   Portal
alias   T1
coords  30 222 130
at   0

spawn   Portal
alias   T2
flip   1
coords  290 222 130
at   0

spawn   Portal
alias   T3
coords  30 222 70
at   0

spawn   Portal
alias   T4
flip   1
coords  290 222 70
at   0

spawn   Portal
alias   T5
coords  30 222 10
at   0

spawn   Portal
alias   T6
flip   1
coords  290 222 10
at   0

 With this, you only need one portal entity to set 6 branches. Efficient, don't you think? :)

 Limitation: The issue is exactly same as alternate portal's so I only mention its limitation. The most obvious limitation is that generic portal uses specific image (or nothing if you use blank image) and specific portal size. So it's recommended to set generic image and size so the portal can be used almost anywhere.

Level End Entity

 Intro: Normally levels in OpenBoR are ended by defeating every enemy in the level or by defeating boss. Alternatively, touching endlevel entity also ends level. With script, level can be ended in various ways. This tutorial describes how to make entity which ends current level after it is spawned. In addition to ending level, this entity also brings player to defined branch.
 Procedure: Let's name this entity as LevelEnd. Here's an example of its  text:
Spoiler
Quote
name       LevelEnd
type       none
antigravity     100

anim idle
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame == 1){
      jumptobranch(Name, 1);
    }
@end_script
   delay   300  #<--- defines how long it takes before level ends
   offset   1 1
   frame   data/chars/misc/empty.gif
   frame   data/chars/misc/empty.gif

 LevelEnd uses antigravity 100 to prevent it from falling to holes. Its type doesn't matter, let's just use type none.
 In its IDLE, it has script which works like this: entity's alias is acquired then at 2nd frame, level is ended and jumps to branch with same name as that alias. If there's no such branch, the level only ends without jumping to any branch.
 delay 300 means after LevelEnd is spawned, it will wait 300 centiseconds or 3 seconds before ending the level. Change the value to suit your need.
 It is using blank image (empty.gif) cause it's meant to be invisible.
 To use LevelEnd, either spawn it directly like this:
Quote
spawn  LevelEnd
alias  BranchName
coords 160 200
at     0

 or set it as other entity's dropped item like this:
Quote
spawn  Enemy
item   LevelEnd
itemalias BranchName
coords -100 200
at     0

 Alias is only added if you want LevelEnd to jump to defined branchbame after ending the level.
 Limitation: Since this entity uses its name as branch destination, it will try to jump to branch named 'LevelEnd' if no alias is given to it. That means, you can't use 'LevelEnd' as name of your branches to avoid conflict with LevelEnd (why would you anyways :) ?).

Alternate Default Palette

 Intro: Ever have problem in which entity's colors look awful but you are too lazy to edit all sprites? or you want to use remap as default palette but are too lazy to change sprites' palette? Now your problem is solved with this tutorial.
 Before we start, this method ONLY works with 16bit/32bit colour depth.
 Procedure: In 16bit/32bit colour depth, OpenBoR gets entity's palette from reference image which is either 1st defined image or image defined by palette command. This palette is used for all images/sprites by that entity.
 Because of that nature, if the reference image's palette is altered, the whole images' palette will be altered too. So in order to change shown colors, all we need to do is to change the reference image's palette.
 If your problem is entity's colors look awful, just find reference image and edit its palette. OTOH if you want to use a remap as default palette, just change reference image to something like this:
Quote
palette          data/chars/entity/alter.png
alter.png is the remap and it will be default palette for the entity.

 Limitation: Just to reiterate, this method ONLY change SHOWN colors in game. It doesn't change the images palette at all.

Simple Striker

 Intro: In Capcom beat'm ups, ever notice enemies which comes, attack then leaves? There is no official term for them so I use striker term cause they act just like King of Fighter's strikers.
 This tutorial desribes how to make such striker. However, since striker is not 100% stable, this tutorial will only desribe simple striker which is stable enough.The instability issues will be explained in detail in Issue below.
 One thing to mention is that strikers are optional enemies. Players could kill them or just let them go. When they are let go, offscreenkill command will remove them when they are offscreen far enough. That's why you have to make sure to use latest OpenBoR version cause that command is not supported in old version.
 Procedure: As mentioned before, striker comes, attack then leaves so that means the striker needs SPAWN animation for the coming in animation. For the attack animation, it can be added after the coming animation in SPAWN or in seperate ATTACK animation. Here's an example for the latter:

Spoiler
Quote
name   FlyOctiS
health   1
nomove   1 1
type   enemy
death   1
cantgrab 1
candamage   player obstacle
offscreenkill   100

anim spawn
   delay   10
   offset   44 90
        jumpframe  1  0  1 0
   frame   data/chars/enemy/idle1.png
   frame   data/chars/enemy/idle2.png
   bbox   12 18 68 63
   frame   data/chars/enemy/idle3.png
   frame   data/chars/enemy/idle1.png
   frame   data/chars/enemy/idle2.png
   frame   data/chars/enemy/idle3.png
   frame   data/chars/enemy/idle1.png
   frame   data/chars/enemy/idle2.png
   frame   data/chars/enemy/idle3.png
   frame   data/chars/enemy/idle1.png
   frame   data/chars/enemy/idle2.png

anim idle
   loop   1
   delay   10
   offset   44 90
   bbox   12 18 68 63
   frame   data/chars/enemy/idle1.png
   frame   data/chars/enemy/idle2.png
   frame   data/chars/enemy/idle3.png

anim attack1
   loop   1
   range   0 400
   rangez   -200 200
   delay   20
   offset   44 90
        jumpframe  0  0  2 0
   bbox   12 18 68 63
   attack   41 17 44 67 10 1
   frame   data/chars/enemy/attack.png

anim death
   delay   200
   offset   44 90
        jumpframe  0  3  -2 0
        landframe  1
   frame   data/chars/enemy/fall1.png
   delay   100
   frame   data/chars/enemy/dead.png
This striker is simple cause it only has 1 HP which means it will die if hit by any attack. It will also play DEATH when killed because of death 1. Animations such as PAIN, FALL and RISE aren't required.
 cantgrab 1 is set to prevent players from grabbing this enemy.
 nomove 1 1 is set to make striker just perform the attack and won't try to walk at all.
 candamage is set to player and obstacle. The former is obvious, the latter is so striker will also destroy obstacles if it meets any.
 offscreenkill is important. It is required to make the striker disappear after going offscreen. 100 is chosen so striker will immediately disappear when it is 100 pixels offscreen, left or right. That also means this striker should be spawned less than 100 pixels offscreen to avoid being removed right after being spawned.

 About the animations, SPAWN animation holds animation when striker comes. It will stop after animation ends. Then it has ATTACK1 which has wide and long coverage. The idea is so striker always find player and attack after coming in. Well, if there are no player, it will just stay still but it's good thing cause there's no need to attack when there's nothing to hit right? :).
 In ATTACK1, there's jumpframe which moves striker forward. The animation is looped also which make striker moves continuously to other screen edge. After it goes beyond offscreenkill value, it will disappear.

 Here's an example to spawn striker:
Quote
spawn   flyoctiS
map   2
coords   370 190
at   100

spawn   flyoctiS
map   2
flip   1
coords   -50 210
at   100

 Notice that both striker are spawned 50 pixels offscreen. Don't forget to set flip properly so they enter the screen instead of going out.

 That's one way to make simple striker. Striker can do anything after coming but make sure it goes offscreen cause players can't be forced to kill striker.
 Expansion: There are lots of way to expand the striker but you might need to use script to perfecten the striker. These are couple possible expansions:
 1. Instead of charging forward, the striker could shoot or toss projectile in ATTACK1. After shooting or tossing, it could move away offscreen to leave. Combine loop with jumpframe for the leaving effect.
 2. Strikers could act just as item carriers. They don't need to have attackbox (nothing wrong if they have though).
 3. Strikers could be living time bomb. These type don't need offscreenkill but lifespan instead. Add explosion in DEATH animation and they are set!
 4. Alternate ATTACK animation could be added to give alternate attack for the striker making it less predictable.

 Aside of using ATTACK animation, striker could just use SPAWN animation for the come, attack then leave actions.

 If you want to make striker which leaves from where it comes, you might need script to make sure they go to the right way after attacking. FYI enemy automatically turns if player is behind him/her that's why script is required.
 Issue: The simple striker above is actually not 100% stable.
 Here are couple instability issues, most of them are about ensuring striker's leave:
 1. Striker might be blocked by wall and stuck. Although, it can be solved by making striker ignores walls, it is best to avoid spawning them toward walls.
 2. Striker might be blocked by obstacles. The obstacles HP could be set low to help them charging though but it's best to avoid spawning them toward obstacles. OTOH some obstacles such as gate shouldn't be destroyed by them.
 3. Strikers which can be grabbed can be done, just don't use cantgrab. However, by allowing these, their position might change cause players could move them (with grabmove or throw) and let them go. They might bump to walls or obstacles later.
 4. Strikers with higher HP is possible but make sure they have leave screen animation. This could be set in RISE or just ATTACK animation with wide range like above.
SimplePortal 2.3.3 © 2008-2010, SimplePortal