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: Request: A2, A3 and A4 as standard grabattacks  (Read 723 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Q!

  • The Godfather of Modding
  • Jr. Member
  • **
  • Posts: 68
Request: A2, A3 and A4 as standard grabattacks
« on: September 02, 2012, 11:53:42 pm »
Can these extra buttones be treated just like grabattacks while grabbing someone? 'Cause currently (the cheap way) you just set 'cancel' in anim grab and there you go, A2 as an active grabattack, but if you have an anim grabbed for enemies, as soon as you press A2 or whatever, your enemy gets released from the anim grabbed, looking wrong for games like Double Dragon for exaple, where you grab them from their hair.

Please? The expensive way (script) its impossible for old :dunce: like me :)

Offline BeasTie

  • Hero Member
  • *****
  • Posts: 760
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #1 on: September 03, 2012, 02:16:17 am »
This is probably a good script to get a feel for scripting thou.

Take a look at the keyall.c script, the way this script is made, it's actually not too confusing to edit this one. - http://lavalit.com:8080/index.php/topic,3750.0.html

eg. this section is what you need to copy, just paste it under the original, make sure you get all the } etc.
Code: [Select]
if(anim == openborconstant("ANI_FORWARDJUMP"))
{
if(playerkeys(player, 1, "attack2"))
{
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW12"), 1);
}
else if(playerkeys(player, 1, "attack3"))
{
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW13"), 1);
}
else if(playerkeys(player, 1, "attack4"))
{
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW14"), 1);
}
}

I'm not very good with script myself, but basically for what you want, it's already setup in the script.  The first line checks what animation is playing, then if ANI_FORWARDJUMP is playing it checks what key is pressed, then plays the correct follow animation.  So A2 triggers ANI_FOLLOW12 and so forth.

The only difference for your needs is that we can change the line
Code: [Select]
if(anim == openborconstant("ANI_FORWARDJUMP"))into
Code: [Select]
if(anim == openborconstant("ANI_GRAB"))
Then just simply change the animations it triggers accordingly.  (doesn't have to be follow anims either)

Thou this is a simple way, it will probably be better to actually check if the opponent is currently being grabbed, or something like that.  Instead of check what anim is running, you could check if the opponent is in a grabbed state (or something).  Again, I'm not very good with script so I'll wait for someone more experienced to comment on this, they'll know what to do.  Obviously there's more to consider, (like the A2 issue) Hopefully this gets you started thou.

Check in the script reference - http://lavalit.com:8080/index.php/topic,164.0.html
under - getentityproperty(entity, propname)

Offline Mr.Q!

  • The Godfather of Modding
  • Jr. Member
  • **
  • Posts: 68
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #2 on: September 04, 2012, 09:43:58 am »
Just tried it and the same thing still happens, my character releases the enemy while doing a grab attack-like animation, looking pretty odd.

Maybe a good script will solve this, yes, but I was asking for a non script solution, something more globalized for most beat'em up styles around:

-Using a2, a3 and a4 as standard grab attacks.
-Ability to set how many grab attacks you can use before a finisher occurs (currently you can use 2 grab atacks, 2 grabup, 2 grab down, and then a grab finisher.

Offline magggas

  • Hero Member
  • *****
  • Posts: 735
  • .....
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #3 on: September 04, 2012, 11:08:37 am »
In my WH mod the grabattack system is like you want,with kick button(A2) you make grabattacks and with standard attack button you throw the enemy.And you can set how many grabattacks you like.
This custom grabattack system is an combination of cancel command and some small script functions.And belive me i´m an script noob too,but these scripts are ease to use.

Sure the best is if the engine will updated as you requested,but in case it will not or just you like to try my system,i can explain you everything about since i known is a bit confusing just to look my characters text.
I will be glad to help you Mr.Q :cheers!:
« Last Edit: September 04, 2012, 11:11:57 am by magggas »

Offline Die_In_Fire

  • Hero Member
  • *****
  • Posts: 1140
  • Where eagles dare!
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #4 on: September 04, 2012, 11:43:01 am »
it would be great any of those options!! updated engine, or Maggas's style.

Maggas I was also interested on the combo with a1 and a2, and was going to ask you about it as I have a a2 (kick) too, but can0t get the desire combo chain system. I think is similar to the grabattack stuff?

Offline Mr.Q!

  • The Godfather of Modding
  • Jr. Member
  • **
  • Posts: 68
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #5 on: September 04, 2012, 04:15:20 pm »
snip

I've tried your mod, and correct me if I'm wrong, but whenever I press A2 as a grab attack, your enemy gets released from the grab animation?  It may work in that way, as you said, but my Double Dragon characters grab anim is quite different that a hug you know, it's more like a hair grab, so releasing them and doing the knee strikes will always miss the target, and more importantly, relase the enemy from the grab, so that may not work as I want :/
« Last Edit: September 05, 2012, 01:46:40 am by Mr.Q! »

Offline Mr.Q!

  • The Godfather of Modding
  • Jr. Member
  • **
  • Posts: 68
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #6 on: September 05, 2012, 10:52:02 pm »
Help? :dunce:

Offline Goliath

  • Jr. Member
  • **
  • Posts: 68
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #7 on: September 06, 2012, 10:21:23 am »
@cmd position, maybe?

Code: [Select]
void position(int Frame, float dx, float dy, float dz, int face)
{ // Modify grabbed entity's position relative to grabber
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "grabbing");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     updateframe(target, Frame);
     bindentity(target, self, dx, dz, dy, face, 0);
   }
}


you can put the enemy in whatever position/animation you want at whatever frame you want on grab anim with this. The problem with releasing the enemy will be still there but at least the knees will hit the target.

Why dont you show the problem with little clip?, visual reference is allways good.

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #8 on: September 06, 2012, 10:40:04 am »
Can't even look at it right at the moment. Had to re-image my comp, and it caused me to lose my credentials to the source code. :eek:

Will send SX a message to reset my access.

DC

OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline magggas

  • Hero Member
  • *****
  • Posts: 735
  • .....
Re: Request: A2, A3 and A4 as standard grabattacks
« Reply #9 on: September 06, 2012, 10:51:41 am »
Here is an example of hazou´s 3 chain grabattack.This is actually the whole custum grabattack system.
With red color i have marked the explanation comments i added for you.

Quote
anim grab
   loop   0
   delay   8
      offset   70 170
      bbox   50 78 47 80
      cancel 0 3 0 A2 freespecial13 (for custom grabattack)
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif


anim freespecial13 (custom grabattack)
   loop   0
   delay   5
      offset   70 170
      @cmd forceanim openborconstant("ANI_FOLLOW2") (to force enemy play anim grabbed clone)
      @cmd bind 1 40 -1 0 -1
      frame   data/chars/hanzou/ga1.gif
      sound   data/sounds/beat1.wav      (to play hitfx)
      frame   data/chars/hanzou/ga2.gif
      @cmd    spawn01 "flas" 60 0 1    (to spawn hitflash)
      @cmd    hurt2 5                  (to damage enemy)
      frame   data/chars/hanzou/ga3.gif
      delay   12
      frame   data/chars/hanzou/ga3.gif
      delay   6
      frame   data/chars/hanzou/ga2.gif
      @cmd    anichange "ANI_FOLLOW4" (to go on anim grab clone)
      frame   data/chars/hanzou/ga2.gif


anim follow4 (anim grab clone)
      loop   1
   delay   8
      offset   70 170
      cancel 0 3 0 A2 freespecial14 (for second custom grabattack)
      @cmd bind 1 40 -1 0 -1
      @cmd forceanim openborconstant("ANI_FOLLOW2")
      cancel 0 3 0 A freespecial16  (anim grabattack clone)
      cancel 0 3 0 J freespecial17  (anim grabattack2 clone)
      cancel 0 3 0 B A freespecial18 (anim grabbackward clone)
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif


anim freespecial14 (second custom grabattack)
   loop   0
   delay   5
      offset   70 170
      @cmd bind 0 40 -1 0 -1
      @cmd forceanim openborconstant("ANI_FOLLOW2")
      frame   data/chars/hanzou/ga1.gif
      sound   data/sounds/beat1.wav
      frame   data/chars/hanzou/ga2.gif
      @cmd    spawn01 "flas" 60 0 1
      @cmd    hurt2 5
      frame   data/chars/hanzou/ga3.gif
      delay   13
      frame   data/chars/hanzou/ga3.gif
      delay   5
      frame   data/chars/hanzou/ga2.gif
      @cmd    anichange "ANI_FOLLOW5" (to go on second anim grab clone)
      frame   data/chars/hanzou/ga2.gif


anim follow5 (second anim grab clone)
      loop   1
   delay   8
      offset   70 170
      cancel 0 3 0 A2 freespecial15 (for knockdown custom grabattack)
      @cmd bind 1 40 -1 0 -1
      @cmd forceanim openborconstant("ANI_FOLLOW2")
      cancel 0 3 0 A freespecial16
      cancel 0 3 0 J freespecial17
      cancel 0 3 0 B A freespecial18
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif
      frame   data/chars/hanzou/th2.gif


anim freespecial15 (custom knockdown grabattack)
   loop   0
   delay   6.5
      offset   70 170
      @cmd    slamstart2
      @cmd    position 29 36 0 -1 1
      sound   data/sounds/air5.wav
      frame   data/chars/hanzou/aaaaaa5.gif
      sound   data/chars/hanzou/at3.wav
      frame   data/chars/hanzou/aaaaaa4.gif
      sound   data/sounds/beat2.wav
      delay   2
      @cmd    spawn01 "flas" 70 20 1
      frame   data/chars/hanzou/aaaaaa3.gif
      @cmd    depost 0
      @cmd    finish 15 1 2.5 3 0 1
      delay   10
      frame   data/chars/hanzou/aaaaaa3.gif
      delay   8
      frame   data/chars/hanzou/aaaaaa2.gif
      frame   data/chars/hanzou/aaaaaa1.gif



Here are the Script functions:
Spoiler
Code: [Select]
void bind(int null, float x, float z, float y, int dir){
void self = getlocalvar("self");
void opp = getentityproperty(self, "opponent");
if(null == 1)
{
bindentity(opp, self, x, z, y, dir, 0);
}
else if(null == 0)
{
bindentity(opp, NULL());
}
}

void forceanim(int anim){
void self = getlocalvar("self");
void opp = getentityproperty(self, "opponent");
changeentityproperty(opp, "animation", anim);
}

void hurt2(int Damage)
{ // Damage without altering opponent's animation + less damage if opponent has less health
// Mainly used for slams
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int THealth = getentityproperty(target,"health"); //Get target's health
     int TAniPos = getentityproperty(target,"animpos"); //Get target's animation frame
     if(THealth > Damage)
     {
       damageentity(target, self, Damage, 0, openborconstant("ATK_NORMAL7")); // Damage target with desired damage
       updateframe(target, TAniPos);
     } else {
       int Damage2 = THealth - 1;
       damageentity(target, self, Damage2, 0, openborconstant("ATK_NORMAL7")); //Damage target with less damage
       updateframe(target, TAniPos);
     }
   }
}

void spawn01(void vName, float fX, float fY, float fZ)
{
//spawn01 (Generic spawner)
//Damon Vaughn Caskey
//07/06/2007
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fZ: Y location adjustment.
      //fY: Z location adjustment.

void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int  iDirection = getentityproperty(self, "direction");

clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

if (iDirection == 0){ //Is entity facing left?                 
          fX = -fX; //Reverse X direction to match facing.
}

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.

vSpawn = spawn(); //Spawn in entity.

changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
   
return vSpawn; //Return spawn.
}


So,i hope i get you covered with.I think this is the best way to explain it.If you have any questions i will be here ;)



it would be great any of those options!! updated engine, or Maggas's style.

Maggas I was also interested on the combo with a1 and a2, and was going to ask you about it as I have a a2 (kick) too, but can0t get the desire combo chain system. I think is similar to the grabattack stuff?

Actually the kick combo uses different way.Is made with an script function which DC posted here:
http://lavalit.com:8080/index.php/topic,4995.0.html
« Last Edit: September 06, 2012, 11:31:51 am by magggas »

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal