Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 149
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: BoR & OpenBoR Tricks  (Read 18057 times)

0 Members and 1 Guest are viewing this topic.

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: BoR & OpenBoR Tricks
« Reply #60 on: December 17, 2007, 02:53:54 pm »
Opera does it too. Didn't use to. Odd.

DC
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: BoR & OpenBoR Tricks
« Reply #61 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.




Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: BoR & OpenBoR Tricks
« Reply #62 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.

Offline kbandressen

  • Developer
  • Hero Member
  • *****
  • Posts: 1347
Re: BoR & OpenBoR Tricks
« Reply #63 on: December 18, 2007, 04:27:29 pm »
Yeah, I've been using antigravity to tweak how fast entities fall.

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: BoR & OpenBoR Tricks
« Reply #64 on: December 21, 2007, 12:30:05 pm »
 Where can I find info about 'antigravity'? It's not in manual and features archive yet
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: BoR & OpenBoR Tricks
« Reply #65 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
« Last Edit: December 22, 2007, 08:11:55 am by utunnels »

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
2 more tricks!!
« Reply #66 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.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: BoR & OpenBoR Tricks
« Reply #67 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

 

 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.
« Last Edit: October 26, 2008, 12:29:36 pm by Bloodbane »
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: BoR & OpenBoR Tricks
« Reply #68 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



 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



 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'.
« Last Edit: January 18, 2010, 01:12:39 pm by Bloodbane »
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline Fightn Words

  • Hero Member
  • *****
  • Posts: 3264
  • Confectionary Country of the Nin-Nin
Re: BoR & OpenBoR Tricks
« Reply #69 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...

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: BoR & OpenBoR Tricks
« Reply #70 on: July 17, 2010, 03:52:39 am »
Generic Portal



 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.
« Last Edit: July 17, 2010, 04:01:40 am by Bloodbane »
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

 



 0%




mighty
SimplePortal 2.3.3 © 2008-2010, SimplePortal