check the edge of the platform , it is possible ? help

monomartin

Active member
checks the distance to the edge of the platform and change the animation, is that possible?
http://s2.subirimagenes.com/imagen/previo/thump_9626414ejemo.gif

thump_9626414ejemo.gif
[/URL][/img]
 
Thanks DC
Yes, I'll use it for players as well.
I would like to make it possible with "on block" with platform in X axis or in Z axis, so you can climb in the ring from any side.

Do you have an exemple of this onblock script?
Sounds familiar, but never really seen it.
 
@ned: I have a script which flips enemy when blocked by platform. The script already has height limit when detecting platforms so it could be modified to create auto climb on platform
 
Bloodbane said:
@ned: I have a script which flips enemy when blocked by platform. The script already has height limit when detecting platforms so it could be modified to create auto climb on platform

Yes, please.
It would be a good base for what I need.
 
@White Dragon
Yes, it would be great!

@Bloodbane
Do you have used this in some of your technical demo (double dragon or something else?)
I would like to try this code!
 
nedflandeurse said:
Do you have used this in some of your technical demo (double dragon or something else?)
I would like to try this code!

No, I haven't shared the code yet since it is for 2D mods.
This the quick edit of the code:
anim walk
@script
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int y = getentityproperty(self, "a");
    int z = getentityproperty(self, "z");
    int Dir = getentityproperty(self, "direction");
    int Sx = 20; // checking distance
    int Sy = 115; // checking height

    if(Dir==0){
      Sx = -20;
    }

    void Plat = checkplatformbelow(x+Sx, z, y+Sy);

    if(Plat){
      changeentityproperty(self, "velocity", 0, 0, 0);
      performattack(self, openborconstant("ANI_FOLLOW1"));
    }
@end_script
...

This script will look for platform placed 20 pixels in front and whose altitude is less than 115 pixels
Yes, it doesn't check platform's height since the latter can't be acquired directly BUT there's a workaround for that by using antigrab or grabforce ;)
 
Thanks guys.
I'll give it a try. I'll get back to you if I'm stuck in it.

Edit :
@Bloodbane, I tested your version and Openbor don't loads.
Log file says :

Code:
Script error: data/chars/rachel/rachel.txt, line 6539: Unknown error 'void' (in production 20)

    void Plat = checkplatformbelow(x+Sx, z, y+Sy);
    ^


Script compile error in 'animationscript': Plat line 6539, column 9
 
That's strange... but try changing the script to this:

Code:
anim	walk
@script
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int y = getentityproperty(self, "a");
    int z = getentityproperty(self, "z");
    int Dir = getentityproperty(self, "direction");
    int Sx = 20;
    int Sy = 115;
    void Plat;

    if(Dir==0){
      Sx = -Sx;
    }

    Plat = checkplatformbelow(x+Sx, z, y+Sy);

    if(Plat){
      changeentityproperty(self, "velocity", 0, 0, 0);
      performattack(self, openborconstant("ANI_FOLLOW1"));
    }
@end_script
...
 
Bloodbane said:
That's strange... but try changing the script to this:

Code:
anim	walk
@script
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int y = getentityproperty(self, "a");
    int z = getentityproperty(self, "z");
    int Dir = getentityproperty(self, "direction");
    int Sx = 20;
    int Sy = 115;
    void Plat;

    if(Dir==0){
      Sx = -Sx;
    }

    Plat = checkplatformbelow(x+Sx, z, y+Sy);

    if(Plat){
      changeentityproperty(self, "velocity", 0, 0, 0);
      performattack(self, openborconstant("ANI_FOLLOW1"));
    }
@end_script
...

Thanks a lot BB,
it worked! Finally, I will add it to the game system!

@Magggas, thanks for your help and support as well.
 
Thanks for your support WD!
I'll try to edit it!

But I don't understand this idle1 command.
Why it have to cancel/stop itself?
How to use it? Is it compatible with this previous script?
 
OK
I think I understand.
It would be perfect for my project, so the move cannot activate by error, but only with right input.

Ex : walk, blocked by platform, input forward again, proceed to get on the platform.

But how to actually add it?
 
Thanks, I never used it before.

But I still cannot understand why the value have to be (1)

As I'm talking about it, I would like my system to be done with F, F input (but not from run)
This way.

Walk to platform
Blocked by platform
Input : F, F
Go to climb the ring anim

I don't want it to be done from run
Ex : run from far, contact with ring -> NO climb to the ring

EDIT : after testing the initial script a bit.
I had this problem. (My obstacle entities contain platform code to be jumpable/walkable)
And my character triggers the previous script you posted BB even when you're on top of it, as soon as you try to walk.
cgb1oNk.jpg

Can you get rid of it by using Y position stuff?
Thanks
 
For the actual wrestling ring, I dont see why you need to detect platforms really, just allow the anim to be triggered if their close enough with invisible entities.  I've used invisible entities to make enemies walk up walls/platforms etc.  It doesn't detect anything it's just worked out pixel perfect so it only executes in exact spots.  Basically you'd have to be walking against it to trigger the climb.  FORWARD+ATTACK would be a good choice to do the move.

I know it's a workaround mentality, but sometimes it's all you need and has exactly the same result anyway.

 
Sorry my longer post that actually explained it got erased so I had to start over :/ 

But yeah it's basically like that, remember you can still expand it with script and other commands to have more conditions. 

FORWARD+ATTACK while walking into the ring should work because you'll still be able to turn around and deal with an opponent if you had too and not trigger the climb.  But turning your back on him means you will climb in the ring avoid pointlessly punching at the mat.

You could also just have an automatic  kind of jump into the ring, where the player cant control it at all.  Just like Fire Pro Wrestling
 
Idle 1
example:
Code:
anim	FOLLOW15 # (WALKOFF)
	idle 1 #like idle anim you can iterrupt it
	landframe 3
	loop	1

        delay   12
	offset  50  87
		bbox  44  24  26  42
	frame	data/chars/leo/walkoff01.gif
		bbox  29  29  31  39
	frame	data/chars/leo/walkoff02.gif
		bbox  25  31  31  37
	frame	data/chars/leo/walkoff03.gif
		bbox  30  30  34  39
	frame	data/chars/leo/walkoff02.gif

idle 1 is a command able to CANCEL your animation with any key.
If you change your animation (performattack or cep) and this anim is a looped anim, normally you will have a loop and you shalt not move your character. But if you set "idle 1" you will cancel the looped animation (edge animation for ex.) and turn it into normal idle animation.

See TMNT:SS and try for example the bridge level to test my edge animation.

Example:
Walk to edges ->stop -> edge animation -> cancel animation by pressing any key



[attachment deleted by admin]
 
Back
Top Bottom