Get in a plateform/wall (using script)

NED

Well-known member
Hello,
As some of you know, my project will have  "game systems"
1- "regular beat'em up type" with some custom stuffs.
2- "Kind of wrestling type" with really few of the features you can see in 2D wrestling games.

For the type2, I have a regular stage with a wrestling ring. I'm still coding it to have the best feeling, then I'll swap with some graphic variation, but using the same code.

For the moment, the ring is using this wall code:
Code:
wall 299 584 90 -20 758 858 160 67

and I would like to make the "get in the ring" movement possible without jumping.
I tried different stuffs in the past, but nothing can make it right for themoment.

At the moment, my idea is to use 4 variations of ladder climb script.
for each direction UP, DOWN, LEFT, RIGHT.

But I don't know how to edit the ladder script to have something working.

Any help is welcome.
Thanks

BTW : I have some display layer problems on the ring sprite, but I givent up on it, since there is absolutly no solution to fix it. And I'm not a professionnal, so I don't have to make a perfect looking game.
 
Oh, sorry.
I tend to lose text structure when writting english language.

The idea is to have to possibility to climb on the ring just like in wrestling games.
You can climb by any of the 4 sides of the ring.
Exemples from DOWN and from RIGHT
GkAtZHD.jpg


I think the input would be double tap direction (U, U , D, D or F, F...)

This maneuver is to do when you're out of the ring, to climb on it without hitting jump button.

This is some simulation of the "triggers" position to activate wall climbing
I565ckP.jpg

Up and down can have one wide "trigger" (green in the picture)
Left and right should have several smaller triggers to match to trapezoidal shape (blue in the picture)
 
I knew what you meant at first when you posted this that you want to get inside the ring. I will say what I had in mind 'fore Bloodbane posted. You're going to need a follow animation (or freespecial animation if you don't plan to execute commands like D F A) with script. Even entityvars could work but I know a little bit about entityvars. It's something like a pointer. What I have in mind so far is bindentity for target and self but I don't know what the real solution is for it.

From looking at the first two shots where Gunloc is climbing, the rope can be a platform but you'd need to set it as subject_to_wall 1 and subject_to_platform 1.

For character animation (based on the first two shots):

1. Immunize your character by setting subject_to_platform 0 with first frame in script.
2. Change altitude in position or velocity with script to see how high he can climb up. Do you see the shadow of Gunloc?
3. Use velocity with negative value of z to make him "walk" upwards in z.
4. Set subject_to_platform 1 in the last frame AFTER he gets inside the ring.

For ropes and character, that's my theory. But you need Bloodbane's DDMini mod if you want to make that kind of climbing system. You will need an animation without a loop for it because in an animation in Double Dragon Reloaded where you start to climb up or down, it's meant to be looped before pressing up or down to climb.

Examples:

Code:
anim	idle
@script
   void self = getlocalvar("self");

   setlocalvar("PKnee" + self, 0);
//   setlocalvar("PSign" + self, 0);
   setlocalvar("Target" + self, NULL());
@end_script	
	loop	1
	delay	5
	offset	68 131
	bbox	54 76 20 56
	frame	data/chars/billy/idle1.png
	@cmd	keyclimb "U" 8 2 "ANI_FOLLOW17"
	@cmd	keyclimb "D" 8 2 "ANI_FOLLOW16"
	frame	data/chars/billy/idle1.png
#	delay	20
#	frame	data/chars/billy/idle2.png


anim follow17 # Climb
	loop	1
	delay   2
	offset	66 131
	bbox	54 76 20 56
	@cmd	dasher 0 0 0
	@cmd	keyint "ANI_FOLLOW13" 0 "U" 0
	@cmd	keyint "ANI_FOLLOW14" 0 "D" 0
	frame   data/chars/billy/climb1.png
	@cmd	keyint "ANI_FOLLOW13" 0 "U" 0
	@cmd	keyint "ANI_FOLLOW14" 0 "D" 0
	frame   data/chars/billy/climb1.png


anim follow16 # Start of Climb Down
@script
    if(frame==2){
      void self = getlocalvar("self");
      performattack(self, openborconstant("ANI_FOLLOW17"));
    }
@end_script
	delay   1
	offset	66 121
	frame   data/chars/billy/climb5.png
	delay   20
	frame   data/chars/billy/climb5.png
	frame   data/chars/billy/climb5.png

My script attempt for climbing or walking on staircases:
Code:
anim	idle
	loop	1
	delay	4
	offset	100 86
	@cmd	keyclimb "U" 8 2 "ANI_FOLLOW8" #keyclimb {key} {x} {z} {ani}
	@cmd	keyclimb "D" 8 2 "ANI_FOLLOW10"
	frame	data/chars/simonb/147.gif
	bbox	87 41 21 45
	frame	data/chars/simonb/147.gif

anim	follow8 #On climb
	offset	99 85
	delay	2
	loop	1
	@cmd	dasher 0 0 0 #Freeze!
	@cmd	keyint "ANI_FOLLOW6" 0 "U" 0 #Holding up to climb animation
	@cmd	keyint "ANI_FOLLOW7" 0 "D" 0 #Holding down to climb animation
	frame	data/chars/simonb/148.gif #1
	@cmd	keyint "ANI_FOLLOW6" 0 "U" 0
	@cmd	keyint "ANI_FOLLOW7" 0 "D" 0
	frame	data/chars/simonb/148.gif #1

anim	follow10
@script
    if(frame==2){
      void self = getlocalvar("self");
      performattack(self, openborconstant("ANI_FOLLOW8"));
    }
	@end_script	
	offset	98 82
	delay	1
	frame	data/chars/simonb/162.gif
	delay	20
	frame	data/chars/simonb/162.gif
	frame	data/chars/simonb/162.gif

I set loop in mine because I want him to walk up or down so I use keyint. But for yours, I don't think you need a loop. But I think the hard part is climbing down out of the ring.
 
Thanks for your reply.

I will not make any get down from the ring to the ground.
I'll use walkoff animation.

My ropes have no real physics/contact. You can go through.
My only need is how to climb a plateform with a double tap input.

Basically DDmod ladder is the right base.

Only difference is invincibility, input, animation with an end, velocity.
 
For double tapping, I dunno. Why double tap when being very close to the ring?

You can use climbspot (entity) as a base for climbing up or wherever.
 
The double tap is to avoid climbing on it by error.
In some matches, there might be a lot of characters out of the ring, so you might walk close to the ring and climb it by error if this is not a more defined comand like F F or U U.

THis is the input used in Slam masters games as well. Some other games use direction + button.

But I'll consider using just regular walk if it helps adapting ladder script to my project. ?
 
Ok, I created a double of BloodBane's ladder script.
I tried to edit stuffs. like width of the contact zone.

This is the copy of climber script (untouched)
Code:
void climberx(int Rx, int Rz, void Ani)
{// Performs climb ladder up animation if ClimbSpot is found within defined range
// Rx = x distance to find ClimbSpot
// Rz = z distance to find ClimbSpot
// Ani = Animation to climb
    void self = getlocalvar("self");
    float x = getentityproperty(self, "x");
    float y = getentityproperty(self, "a");
    float z = getentityproperty(self, "z");

    void vEntity;                                       //Target entity placeholder.
    int  iEntity;                                       //Entity enumeration holder.
    int  iName;                                         //Entity name.
    int  iMax      = openborvariant("ent_max");         //Entity count.

    float Tx;
    float Ty;
    float Tz;
    int THealth;
    int TDir;
    int Type;
    float Disx;
    float Disz;

    //Enumerate and loop through entity collection.
    for(iEntity=0; iEntity<iMax; iEntity++){
      vEntity = getentity(iEntity);                 //Get target entity from current loop.
      iName   = getentityproperty(vEntity, "defaultname"); //Get target name

      if(iName == "ClimbSpot"){
        Tx = getentityproperty(vEntity, "x");
        Ty = getentityproperty(vEntity, "a");
        Tz = getentityproperty(vEntity, "z");
        THealth = getentityproperty(vEntity,"health");
        Disx = Tx - x;
        Disz = Tz - z;

        if(Disx >= -Rx && Disx <= Rx && Disz >= -Rz && Disz <= Rz && y < Ty + THealth-20){
          TDir = getentityproperty(vEntity,"direction");
          Type = getentityvar(vEntity, 1);

          if(Type == NULL()){
            Type = 0;
          }

          dasher(0,0,0);
          setentityvar(self, 4, THealth);
          setentityvar(self, 5, Ty);
          setentityvar(self, 6, Type);
          changeentityproperty(self, "antigravity", 1);
          changeentityproperty(self, "position", Tx, Tz, Ty+1);
          changeentityproperty(self, "direction", TDir);
          performattack(self, openborconstant(Ani));
        }
      }
    }
}
I really don't know how to change this script to have these changes :

-If player contact this area, just send him to a follow# animation.
-no need to hold any direction when player is into this follow animation
-don't make player binding in X axis to "climber entity" position.

Thanks
 
Mmm... I don't think you need to use ladder climbing for ring climbing. The reason is unlike the former, ring climbing is a single step process i.e once it's started, wrestler will climb and reach the ring. Ladder climbing only starts the climbing or rather brings player to climbing state where player can choose to go down or up

My suggestion is to use onblockwscript and onblockpscript to do this. That script is run when entity is blocked by wall and platform respectively which are used for the ring.
Since you want to use double tap commands such as F F or U U, that means those scripts should check if player is in RUN or ATTACKUP animation respectively before changing animation to climb the ring animation
I'll make an example script for this, give me some time :)
 
Yes, please. :)
Would the same script be used for all the ring climbing commands U U, D D, F F?

Because I'm thinking to create custom different animation for each climbing anim.

And yes, the command is to put on RUN, ATTACKUP and ATTACKDOWN.
But I dont think it should be able from regular run from far? (I mean, run then contact the ring)
 
But I dont think it should be able from regular run from far? (I mean, run then contact the ring)

I don't see any problem with that but a good way to prevent running from far then climb is by setting frame detection in the script
Anyways, here's the script
getring.c:

Code:
void main()
{// Script for being blocked by platform
    void self = getlocalvar("self");
    float Vy = getentityproperty(self,"tossv");
    void vAniID = getentityproperty(self,"animationID");

    if(vAniID == openborconstant("ANI_ATTACKUP") && Vy==0){
      performattack(self, openborconstant("ANI_FOLLOW1"));
    } else if(vAniID == openborconstant("ANI_ATTACKDOWN") && Vy==0){
      performattack(self, openborconstant("ANI_FOLLOW2"));
    } else if(vAniID == openborconstant("ANI_RUN") && Vy==0){
      performattack(self, openborconstant("ANI_FOLLOW3"));
    }
}

FOLLOW1 is for climbing from south, FOLLOW2 from north and FOLLOW3 from either west or east. I used NEWS reference to avoid confusion
Declare this script in header like this:

onblockpscript data/scripts/getring.c
onblockwscript data/scripts/getring.c

The first is for climbing on platforms while latter for walls

Currently, this script has no frame check i.e you can trigger climb the ring by running from far

Try this one first and tell me how it works :)
 
Thanks a lot Bloodbane, this is definitly what I need.
I have not created the actual follow states for the moment.
It still seems to trigger on strange way sometimes.

In my BG I have crowd on the sides (using a wery high wall) and the script trigers when you go toward these walls. Perhaps some height paramertrer can be edited?

Code:
ring code
wall 299 584 90 -20 758 858 160 67

side walls code
left
wall 0 534 0 0 355 20 300 400

right
wall 1438 534 -355 -20 1 1 300 400

Also, the fact characters can run diagonally can trigger the wrong follow anim.

I'm thinking of editing run animation if it's possible to something like that.
Runstart frame 1
(loop start here)
Run frame2
run frame3
...

so you can activate the script on 1st frame only. (?)

perhaps it can help to add one more condition like a command input FF, DD or UU?
 
Perhaps some height paramertrer can be edited?

Sure, I'll give 70 pixels as the limit then :)

Also, the fact characters can run diagonally can trigger the wrong follow anim.

Oh you're right. I'll add a check for that too

it can help to add one more condition like a command input FF, DD or UU?

I'm afraid that would make this feature harder to activate. By simply using onblockwscript like this, player isn't required to stand very close to the ring i.e couple pixels away is okay

Speaking of which, since the ring is a wall, you can omit onblockpscript line :)

[couple hours later]

Okay, I've updated the code into this:
getring.c
Code:
void main()
{// Script for being blocked by wall
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int y = getentityproperty(self, "a");
    int z = getentityproperty(self, "z");
    float Vy = getentityproperty(self,"tossv");
    int Direction = getentityproperty(self, "direction");
    void vAniID = getentityproperty(self,"animationID");
    void vAniPos = getentityproperty(self, "animpos");
    int dx = 5;

    if(Direction == 0){ //Is entity facing left?        
      dx = -dx; //Reverse Dist to match facing
    }

    if(vAniID == openborconstant("ANI_ATTACKUP") && checkwall(x,z-5)<=70){
      performattack(self, openborconstant("ANI_FOLLOW1"));
    } else if(vAniID == openborconstant("ANI_ATTACKDOWN") && checkwall(x,z+5)<=70){
      performattack(self, openborconstant("ANI_FOLLOW2"));
    } else if(vAniID == openborconstant("ANI_RUN") && vAniPos < 2 && checkwall(x+dx,z)>y && checkwall(x+dx,z)<=70){
      performattack(self, openborconstant("ANI_FOLLOW3"));
    }
}

This updated version has wall height check to prevent character from changing animation if the wall is taller than 70 pixels. It also has frame check for running animation i.e changing animation is only done if character is in first two frames of running animation
 
Sorry, I watch the thread really fastly this morning.
I was in a rush.

Thanks for your help, I'm doing tests with it right now! :)

EDIT :
I tested it, it works really well.
You did some awesome work.

only 2 little things I can see.

Running animation is played in loop, so these "first two frames" are played several times if you run, so it still triggers when you run "blocked by the ring"
Can it be triggered using time value.
(There is something similar in mugen, like AnimElem and AnimTime)

Also for Up and Down versions, my "attackup" and "attackdown" animations have a jumpframe on it, so it makes strange results with a jump then goes to follow in mid air.
This is my attackup anim as an exemple.
Code:
anim attackup# Z move up
        jumpframe 1 2.3 0 -1.8
	landframe	6 dus#6#7
#	subentity	dus#t
#	summonframe	6 0
	loop	0
	offset	96 177
	bbox	75 95 45 89
      cancel 1 3 0 A freespecial8#--------------go to leg lariat
	delay	4
	sound	data/sounds/jump.wav
	frame	data/chars/rachel/j01.gif
	bbox	76 65 40 78
	delay	6
	frame	data/chars/rachel/j02.gif
	delay	5
	frame	data/chars/rachel/j03.gif
	delay	9
	frame	data/chars/rachel/j04.gif
	delay	5
	frame	data/chars/rachel/j05.gif
	delay	-1000#5
	frame	data/chars/rachel/j06.gif
	delay	7
	sound	data/sounds/land.wav
	frame	data/chars/rachel/j01.gif
 
Thanks :)

Running animation is played in loop, so these "first two frames" are played several times if you run, so it still triggers when you run "blocked by the ring"

Oh, I forgot to tell you that you need to adjust RUN animation a bit to something like this:
anim run
loop 1 3 9
delay 10
offset 67 130
bbox 55 76 34 55
        frame data/chars/trix/run1.png
        frame data/chars/trix/run2.png
        frame data/chars/trix/run3.png
        frame data/chars/trix/run4.png
        frame data/chars/trix/run5.png
        frame data/chars/trix/run6.png #
        frame data/chars/trix/run1.png
        frame data/chars/trix/run2.png
        frame data/chars/trix/run3.png
        frame data/chars/trix/run4.png
        frame data/chars/trix/run5.png
        frame data/chars/trix/run6.png #

This RUN animation is looped but the first three frames aren't looped
Just double the animation frames like this example and set loop command like the above :)

my "attackup" and "attackdown" animations have a jumpframe on it, so it makes strange results with a jump then goes to follow in mid air.

Hmm... you could add some frames in the FOLLOW animation for the character to land first before climbing the ring
 
Bloodbane said:
Hmm... you could add some frames in the FOLLOW animation for the character to land first before climbing the ring

Yes, I'll do it, it will be definitly better.
Thanks

So I tried to edit run animation
I have normally 8 frames, I copy pasted them to have 16 frames
I used loop this way
Code:
loop 1 3 14#loop {bi} {start} {end}----- frame 1 et 2 sans loop, le loop commence au frame 3 jusque 16 (le dernier)

I used a draw method on 2 starting frames to debug the loop.
It works well since these 2 frames are played 1 time only.
And ring climbing is OK as well.

But the loop seems to be wrong and irregular (not well linked) - I checked Openbor Manual to config the loop param.
This is my run anim
Code:
anim run
#	drawmethod 210 210
cancel 1 16 0 A2 freespecial15#cancel to hard attack (slide kick)
cancel 1 16 0 A4 freespecial18#cancel to lariat
cancel 1 16 0 A3 freespecial43# mount punches attempt
cancel 1 16 0 S freespecial34# RUN ROLL
cancel 1 16 0 D S freespecial48# crouch (esquive) ANTI BUG
	loop 1 3 14#loop {bi} {start} {end}----- frame 1 et 2 sans loop, le loop commence au frame 3 jusque 16 (le dernier)
	offset	96 177

	delay 8
drawmethod 256 256 0 0 0 1#plus clair#-----------------------CANCEL FROM HERE
	bbox	69 84 60 98
	frame	data/chars/rachel/run1.gif
	frame	data/chars/rachel/run2.gif
	delay 4
drawmethod 256 256 0 0 0 0#normal#-----------------------CANCEL FROM HERE
	sound	data/sounds/run.wav
	frame	data/chars/rachel/run3.gif
	sound	data/sounds/step1.wav
	frame	data/chars/rachel/run3.gif
#1 seul########@cmd spawnDmg "bdropfst" 7 82 3 0.1#0.99#--name x y z niv de life--
	delay 8
	frame	data/chars/rachel/run4.gif
	frame	data/chars/rachel/run5.gif
	delay 4
	sound	data/sounds/run.wav
	frame	data/chars/rachel/run6.gif
@cmd spawnDmg "bdropfst" 7 82 3 0.1#0.99#--name x y z niv de life--
	sound	data/sounds/step2.wav
	frame	data/chars/rachel/run6.gif

	delay 8
	bbox	69 84 60 98
	frame	data/chars/rachel/run1.gif
	frame	data/chars/rachel/run2.gif
	delay 4
	sound	data/sounds/run.wav
	frame	data/chars/rachel/run3.gif
	sound	data/sounds/step1.wav
	frame	data/chars/rachel/run3.gif
#1 seul########@cmd spawnDmg "bdropfst" 7 82 3 0.1#0.99#--name x y z niv de life--
	delay 8
	frame	data/chars/rachel/run4.gif
	frame	data/chars/rachel/run5.gif
	delay 4
	sound	data/sounds/run.wav
	frame	data/chars/rachel/run6.gif
@cmd spawnDmg "bdropfst" 7 82 3 0.1#0.99#--name x y z niv de life--
	sound	data/sounds/step2.wav
	frame	data/chars/rachel/run6.gif

Is my setting wrong?
 
Now it works perfectly!

All I have to do now is to create the custom anims for all the climb versions.
for attackup and attackdown versions, I don't know how to force a landing on start of follow.

Attackdown and  up have a jump on them (as you know)
but follows (ring climb anim) have some too.
So I cannot put landing frame on 1st follow frame :/

Is there a way to force landing on specified frame?
 
Back
Top Bottom