Setting up multiple attack buttons

Hi. I read somewhere that scripts are necessary to set more than one attack button. Could someone point me to either an example pak or a tutorial that shows how this is done? Thanks in advance.
 
It's not necessary actually, since both "com" and "cancel" commands allow to set additional attacks buttons.

com is used in entity's header

Code:
com a2 freespecial1
com a3 freespecial2
com a4 freespecial3

cancel is used in animations.
 
Thanks, that worked fine for assigning freespecials. Is it possible to make a secondary 'basic' attack button (like one for punch and one for kick, each with its own attack chain)?
 
Is it possible to make a secondary 'basic' attack button (like one for punch and one for kick, each with its own attack chain)?

If you're referring to default attack chain i.e only combo if previous attack connects, then it would require some scripting. But if you're referring to attack chain which doesn't require connecting, that might work without script

So which attack chain system you're planning?
 
I see, thanks for letting me know. i'm starting to think I might just use freespecials for all basic attacks (this is for the 1st person fighter). Things like U, L for a left jab, D, R for a right to the body, etc.  Never liked putting out the same 1, 1, 2, 3 combo over and over, so this way I can make my own.  :)

I also think that would work well if the commands could be bound to a pad's right analog stick using Joy2Key or Pinnacle. It would make throwing punches be similar to how it's done in the last few Fight Night games.

Thanks again for the continued help!
 
If you don't like 1-1-2-3 combo attacks, you can use atchain with an attack number.

Example:

Code:
atchain 1

1 means only anim attack1 is what you're gonna use to press an attack button. 2 is for anim attack2. 3 is anim attack3 and so on..

atchain

atchain {number} {number} {number} {number} {number} ...

Determines the attack chain order for player. The attack chain only starts if the first attack hits though. Also if player takes too long before pressing attack to combo, the attack chain will reset to 1st step.

The maximum length is 5 with 'combostyle 0' or 12 with 'combostyle 1' (see below).

{number} can be anything from 1 to 12. 1 refers to ATTACK1, 2 to ATTACK2 and so on. Note: before using number 5 to 12, set 'maxattacks' to 12 1st. See 'maxattacks' above.

You can repeat the same number if you need to.

You don't have to use all of them. Setting something like 'atchain 1 3 2' works.

Default combo is 'atchain 1 1 2 3'.

With 'combostyle 1', various attack chain can be set with this command. For instance, 'atchain 1 2 5 0 3 3 6 0 4 0' have 3 kinds of attack chain in it.

The attack chains are selected by 'range' specified in respective attack (excluding ATTACK1). In above example, if ATTACK2 can't reach target, attack chain will switch to ATTACK3. If the latter hits, the attack chain becomes '1 3 3 6'. If the latter misses, attack chain will switch to ATTACK4.

In any attack chain, if it goes to 0, the attack chain will reset to 1st step (ATTACK1).

Basic

Atchain controls the basic attack chain sequence for all entities, and is optional. {number} corresponds to the attack of the same number, and will alter the sequence of basic attacks performed by an entity. For example, “atchain 1 2 2 3 4” will cause the entity to perform attack1, attack2 twice, then attack3 and finally attack4. Any sequence length from a single attack all the way up to five can be used, and in any order desired. It is also possible to extend the sequence limit to twelve with the Combostyle command (this also enables advanced use, see below).

Without the atchain command, players use a default sequence of 1 1 2 3, and other types do not perform attack chains at all (they randomly use attack1-4).

Advanced

With the Combostyle enabled, you may enter up to twelve attacks in the sequence. In addition, alternate chains can be enabled based upon range to the target using 0 as a divider. For instance, a sequence of “atchain 1 2 5 0 3 3 6 0 4 0”, can be entered, making effectively a three tier attack chain.

To make use of this, you must first enable Range settings in the various attack animations from 2 up. Once the chain starts, each attack is checked for range to the target. Should the target not be within range, the chain will skip to the next attack in order after 0. This cycle will continue until an attack is found with the valid range, or no attacks remain, in which case the very last attack will be used. So for example in the sequence above, an entity is attacked that falls within range of 1, 2, and 5. In this case, 1, 2, and 5 are used, with the chain ending at 5. If another entity is attacked that is out of range of 2, but close enough for 3, 3, and 6, then the sequence would be 1, 3, 3, 6. Should the target be yet again out of range, then 4 would be used. It should be noted that the chain will still end of no hit at all is made. That is, attacking empty air would not trigger 4 in the sequence.

When used properly, this feature can among other things enable ranged based single attacks identical to the Street Fighter series, or allow alternate attack chains based on proximity such as those found in Golden Axe. Below are some examples of attack chains in professional games. Note that just like in most professional games each attack must still hit successfully in order to perform a chain, with or without atchain enabled.

OpenBOR Default: 1 1 2 3
Guy (Final Fight): 1 1 2 3 4
Haggar (Final Fight): 1 1 2
Linn Kurosawa (AVP): 1 2 3 4 5
Ax Battler (Golden Axe): 1 2 6 0 3 3 4 0 5

Examples

In the excerpt of Ryo's header information, atchain can be seen in basic use. In this case, it serves the dual purpose of utilizing Attack4 and eliminating the default repetition of Attack1 to create a more visually appealing attack chain.

#*****General*****

name     Ryo_
type     player   
bounce     2
health     400
speed     9
Throwdamage  26        
throwframewait 1
holdblock    1       
#fmap     3 
hmap     1 5       
nodieblink  2
falldie      1    
diesound    data/sounds/voic120.wav
risetime    50
atchain      1 2 3 4 
running      15 5 2 1 1
turndelay    168
gfxshadow    1
#alpha     0
blockpain    1
 
Oh I know, I just meant that just about every beat-em-up I've ever played uses that basic system. We actually have more attack options here than many commercial games give us.

May I ask where you got that explanation from? It's a lot more detailed than the one in the manual I've been using for reference. Thanks.
 
It's a very old manual I've been using for years. I got it from Lavalit long time ago. If you like, (maybe) I can share here.

In case if you want to know about the combo style, here's a difference which can help you understand how to use combostyle for your characters' (players) combo chains. Only if atchain is used. If you don't put combostyle in the character header, it's okay 'cause it will be like default combostyle 0 which is for basic combo chain. combostyle is not a must, but it's optional to use.

combostyle

combostyle {bi}

Changes how 'atchain' works.

0 = (Default), old attack chain system. Max attacks is 5.

1 = new attack chain system. Max attacks is 12.

With 'combostyle 1', various attack chain can be set with this command. For instance, 'atchain 1 2 5 0 3 3 6 0 4 0' have 3 kinds of attack chain in it.

The attack chains are selected by 'range' specified in respective attack (excluding ATTACK1). In above example, if ATTACK2 can't reach target, attack chain will switch to ATTACK3. If the latter hits, the attack chain becomes '1 3 3 6'. If the latter misses, attack chain will switch to ATTACK4.
 
I see. The current manual I'm using for reference is here: http://dcemulation.org/index.php5?title=OpenBORManual

It seems to be the one with the most recent update date.


Thanks, I do know that code and plan on using it sometime. I want to look a little bit into implementing random events next (like random sounds on hit, random pain and death animations, and random attacks coming out), so if you know any resources for that sort of information, it would be appreciated. Take care!
 
As far as I remember, you can check with random sound hits in mersox's Power Rangers: Beats of Power mod. It has random sounds for attacks. I can't remember some of the others that have that though. The randomness is used with script IIRC.
 
Thanks Maxman and nsw25, I will look at those mods and do a few searches. I remember seeing a couple of script examples for random stuff, so unless they're outdated, they should help.

Right now I'm stuck on something that's probably really basic but I just cannot figure it out. I want to have a level (it's flat, no z axis) where the characters can jump very high. Making a tall panel allows this, but when the stage begins, the camera always has to pan way down to where the floor is. I've tried at least two other mods than allow their characters to jump and have the screen scroll (He-Man being one) without the stage starting with a vertical pan, but I can't find anything in the level txt files that they have that I don't.

Probably something very simple that I'm overlooking so I figured I wouldn't start a whole new thread for it. Thanks for your continued help.
 
No z axis???? What do you mean? There's no such thing as "no z axis". There's always z axis every time a level/stage is created in txt and you need to take a look at z in levels.txt which makes characters walkable. We have minz and maxz (plus bgheight which is background height; optional) you can make them walkable for the characters to walk on. In default for z in levels.txt, it's like this:

Code:
z 160 240 160

Format for use of value in z:

z {zmin} {zmax} {bgheight} #zmin - z minimum; zmax - z maximum; bgheight - background height

You can make characters jump very high and that's possible. If you want to move the characters during jump, read this:

jumpmove

jumpmove {fx} {fz}

This allows Player to modify player's jump movement.

{fx} determines effect in x axis:

0 = (default) No effect.

1 = Left/Right changes facing direction during jump.

2 = Left/Right changes jumping speed during jump (doesn't work with static jump).

3 = Combination of 1 and 2.

{fz} determines effect in z axis:

0 = (default) No effect.

1 = Walking/running momentum is carried during jump.

2 = Up/Down changes jumping speed during jump (doesn't work with static jump).

3 = Combination of 1 and 2.

If you want to make your characters jump very high, you can use jumpheight in the character header to make your character jump higher if the value is higher than the default.

jumpheight

jumpheight {int}

{int} is an integer value which determines how high an entity jumps.

The default value is 4.

An entity's jumpheight also affects how far it flys when knocked down, and how high and far jumpframe moves you.

For Bomb entities, this controls how high the bomb arcs into the air.
 
No z axis meaning it's a platform-type level (like Super Mario Bros, Contra, etc). The z setting I'm using is 700 700. I probably should have said "no z depth", sorry.

Thanks, but I do know those jump commands. What I was asking was how to have the screen scroll up when a character jumps high, but to not have the screen scroll down when the level starts to reach the player.

Now one thing about jumping that I'm not sure about is if there's a way to jump straight up and then move. Probably needs scripting, as those jumpmove settings do not allow that.

 
Let me see if I can explain this camera panning problem in more detail. I've experimented all day and checked the code of two other mods that do not have this issue and I cannot find a solution.

- I have a level with a 1000 pixel high panel, no z depth (it's a platform-like stage with the z set to 700 700). This is to allow large characters to jump high and have the screen scroll vertically as they sail through the air. All of this is working fine.

- When the level begins however, the screen scrolls all the way down to where the stage begins (at z 700) and where the player is spawned. I understand why this happens. What I do not understand is how other mods are able to have the camera not pan down when the stage begins, but yet allow the player to jump high enough to have the camera view rise up. An example I was studying is the training stage in the He-Man mod. When the stage begins, He-Man falls from the sky and there is no vertical camera panning. However, when he jumps, the view moves up along with him; the panel moving down and more of the background being shown.

Another oddity is that if I try to spawn the player in the air in order to drop down, he still appears in place when the camera finishes panning down, there's no dropping at all.

This is really frustrating because it's got to be a very simple issue that I'm overlooking somewhere. I've tried cameratype, cameraoffset, adding z depth to the stage, having the player spawn high above the stage, and changing the panel and video dimensions, and nothing is giving the results I'm looking for.

Thanks in advance for any advice.
 
Try putting this script:

Code:
@script
void main()
{
    changeopenborvariant("ypos", 700);
}
@end_script

on any entity you spawned early in the level. If you don't have any, just spawn an empty entity like this:

spawn empty
@script
void main()
{
    changeopenborvariant("ypos", 700);
}
@end_script
coords 320 170
at 0

This will immediately move camera down when level starts. Make sure this entity is spawned at 0
As I posted before, this script is not related to entity at all allowing you to declare it in any entity
700 is rough estimated value from panel height-screen height, you can change the value to get best result
 
Thank you, but could you clarify exactly where that top example is placed? In a player's txt file for example? I tried it there and got an error saying some sort of apostrophe or comma was expected and not found.

Empty entity didn't work here either, crashed when the level started. Apologies for not knowing where these go, I still don't understand scripting very well.
 
empty is blank obstacle I always use to create endless level. Though now I use it for other purposes such as holding script like this
You need to create and load it yourself, this is the empty entity:
name Empty
type obstacle
shadow 0
offscreenkill 12000
subject_to_gravity 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

could you clarify exactly where that top example is placed?

The script was declared in level text
 
I think you define a new attack button and then make it a freespecial, and then use cancels and follow anims

That's correct

but how does this string chains together and combos ?

See this example:

anim freespecial2
delay 8
offset 170 302
bbox 129 60 88 244
cancel 5 5 0 A2 freespecial4
        sound  data/chars/kenshiro/ah.wav
        frame  data/chars/kenshiro/lkick1.png
bbox 76 65 105 239
        frame  data/chars/kenshiro/lkick2.png
        frame  data/chars/kenshiro/lkick3.png
attack  176 174 110 85 10 0 0 0 10
        frame  data/chars/kenshiro/lkick4.png
attack  0
        frame  data/chars/kenshiro/lkick5.png
        frame  data/chars/kenshiro/lkick5.png

anim freespecial4
delay 10
offset 170 302
bbox 80 55 97 250
cancel 4 4 0 A2 freespecial5
        sound  data/chars/kenshiro/ah.wav
        frame  data/chars/kenshiro/hkick1.png
bbox 45 78 100 226
        frame  data/chars/kenshiro/hkick2.png
attack4 143 80 156 51 10 0 0 0 10
        frame  data/chars/kenshiro/hkick3.png
attack  0
bbox 80 55 97 250
        frame  data/chars/kenshiro/hkick4.png
        frame  data/chars/kenshiro/hkick4.png

anim freespecial5
delay 7
offset 170 302
bbox 169 82 76 222
        sound  data/chars/kenshiro/ah.wav
        frame  data/chars/kenshiro/rkick1.png
bbox 114 66 127 240
        frame  data/chars/kenshiro/rkick2.png
attack2 240 49 124 114 20 1 0 0 20
dropv 4 4 0
        frame  data/chars/kenshiro/rkick3.png
attack  0
        frame  data/chars/kenshiro/rkick4.png
        frame  data/chars/kenshiro/rkick5.png
        frame  data/chars/kenshiro/rkick6.png
bbox 84 75 118 230
        frame  data/chars/kenshiro/rkick7.png
        frame  data/chars/kenshiro/rkick8.png
        frame  data/chars/kenshiro/rkick9.png
        frame  data/chars/kenshiro/rkick10.png

Though unlike default attack chain which requires each attack to connect, this chain combo can be performed fully without hitting anything
 
Back
Top Bottom