Problems with walls

dantedevil

Well-known member
This is the second time I try to work with walls and is really frustrating.
I'm using the ObEditor 1.5.9 and have managed to create what he wanted.
But the problem is during the game.
The characters go through the walls in the slams, or throws and disappear from the screen. Each character has the script antiwall in their movements, but still not working properly. The players and the enemies disappear and  are locked up on the screen, if you try to move, eventually falls back to the screen.
I've been thinking about abandoning the idea of using walls, but I want to use every effort to make the most complete mod.
I hope to find what the problem is.

Level coords are z 226 270
Here the level:
music data/music/stonehenge.ogg
background data/bgs/stage1-1/backgr.png
panel    data/bgs/stage1-1/backgr.png
order          a

Wall  0  250  0  0  168  9  9  255
Wall  252  237  -15  0  670  655  12  250
Wall  1137  250  -150  0  18  18  9  255
Wall  0  241  0  0  173  168  30  250
Wall  987  241  -5  0  168  168  30  250
Wall  524  244  -272  0  383  119  7  245

updatescript data/scripts/traileru.c

spawn1 205 30 10
spawn2 205 35 10
spawn3 205 40 10

settime        0
notime          1
#type            0 0 0
#direction      right
type            1 0 1
direction      both

spawn trash
coords 1043 260  0
at 0

#spawn Story
#alias 01_begin
#at 0

spawn empty
coords 848 254
at 0

spawn amazon
coords 555 240
health 80
#map  1 
at 5

All players have the same problem in this type of moves.
Here some examples:
Code:
anim grabbackward
	loop	0
        attackone 1
	offset	94 177
	bbox	0 0 0 0
	delay      1
        @cmd    spawnbind "static" 0 70 1 0 0
	frame	data/chars/chosen/make00.png
        sound   data/sounds/tele.wav
	delay   6
        @cmd    slamstart
        @cmd    position 8 55 10 1 0
	frame	data/chars/chosen/make00.png
        @cmd    antiwall 70 20 -1 
        @cmd    position 0 55 30 1 0
        sound   data/chars/chosen/at2.wav
	frame	data/chars/chosen/make01.png
	delay   4
        @cmd    position 0 40 30 1 0
	frame	data/chars/chosen/backat02.png
        @cmd    position 0 20 30 1 0
	frame	data/chars/chosen/backat02.png
        @cmd    spawnbind "static2" 0 70 1 0 0
        @cmd    antiwall 70 25 -1 
        @cmd    position 16 0 30 1 0
	frame	data/chars/chosen/backat03.png
        @cmd    position 0 -20 30 1 1
	frame	data/chars/chosen/backat03.png
        @cmd    position 0 -40 30 1 1
	frame	data/chars/chosen/backat04.png
	delay	1
        @cmd    antiwall 70 25 -1 
        @cmd    position 10 -60 30 1 1
	frame	data/chars/chosen/backat04.png
        @cmd    depost 0
        @cmd    throw 25 4 -5 1 0 0
	frame	data/chars/chosen/backat04.png
        sound   data/sounds/swosh.wav
	frame	data/chars/chosen/backat04.png
	delay   25
	frame	data/chars/chosen/backat04.png
	delay   5
	frame	data/chars/chosen/backat03.png
	frame	data/chars/chosen/backat02.png
	frame	data/chars/chosen/backat01.png
Code:
anim follow11
	 loop	0
	 offset	82 165
	 bbox	  0 0 0 0
         attackone 1
         fastattack 1
         landframe 14
	 delay      1
        jumpframe 3 3 0
        @cmd    cancelgrab
        @cmd    anti
	 frame	data/chars/midas/js3a.png
        @cmd    entergrab
	 frame	data/chars/midas/js3a.png
	 delay      4
        @cmd    slamstart2
        @cmd    position 8 90 15 1 0
	 frame	data/chars/midas/js3a.png
        @cmd    antiwall -75 25 -1 
        @cmd    position 8 80 15 1 0
	 frame	data/chars/midas/js2b.png
	 offset     90 177
        @cmd    position 1 62 40 -1 0
         frame	data/chars/midas/slam1b.png
         frame	data/chars/midas/slam1b.png
         frame	data/chars/midas/slam1b.png
        @cmd    position 2 18 76 -1 0
	 offset     84 174
         frame	data/chars/midas/slam2b.png
         frame	data/chars/midas/slam2b.png
	 delay      5
        @cmd    position 6 -5 80 -1 1
        @cmd    antiwall -75 25 -1 
         frame	data/chars/midas/slam3.png
         frame	data/chars/midas/slam3.png
	 offset     82 217
        @cmd    position 9 -72 45 -1 0
         frame	data/chars/midas/slam4.png
         frame	data/chars/midas/slam4.png
	 offset     82 177
	 delay  999
        @cmd    antiwall -75 25 -1 
        @cmd    position 9 -72 5 -1 0
         frame  data/chars/midas/slam4b.png
	@cmd	spawn01 "down" -60 0 -2
	 sound	data/sounds/land.wav
	 delay      1
         frame  data/chars/midas/slam4b.png
	 delay      15
         frame  data/chars/midas/slam4b.png
	 delay      5
        @cmd    depost 0
        @cmd    finish 35 4 -1 2.5 0 1
         frame  data/chars/midas/slam4b.png
         frame  data/chars/midas/slam4b.png
	 delay  12
         frame	data/chars/midas/slam4.png
         frame	data/chars/midas/slam4.png
         frame  data/chars/midas/roll7.png
         frame  data/chars/midas/roll8.png
	 delay	12
         frame  data/chars/midas/rise1.png
         frame  data/chars/midas/rise2.png
	 frame  data/chars/midas/rise3.png
Code:
anim follow6
	loop	0
        landframe 58
	offset	87 177
	fastattack 1
        attackone  1
	delay   1
        bbox    0 0 0 0
	frame	data/chars/raiden/s3.png
	delay   2
	move    14
        @cmd    slamstart2
        @cmd    position 10 50 5 -1 0
	frame	data/chars/raiden/s3.png
        @cmd    antiwall 60 20 -1
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
        @cmd    antiwall 60 20 -1
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
	frame	data/chars/raiden/s3.png
        @cmd    antiwall 60 20 -1
        @cmd    position 10 50 5 -1 0
	frame	data/chars/raiden/s3.png
	sound   data/sounds/indirect.wav
	move    0
        @cmd    depost 0
        @cmd    finish 25 1 0 2 0 0
	frame	data/chars/raiden/s3.png
	delay   3
        bbox    36 96 82 23
	frame	data/chars/raiden/s3.png
        bbox    73 86 47 38
	frame	data/chars/raiden/s2.png
	delay	2
        offset	95 159
        jumpframe 33 3 -1 0
	bbox	0 0 0 0
	sound   data/chars/raiden/rtorp2.wav
        attack  78 69 46 51 15 1 0 0 0
        frame	data/chars/raiden/j01.png
        frame	data/chars/raiden/j01.png
        frame	data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame	data/chars/raiden/j04.png
        frame	data/chars/raiden/j03.png
        frame	data/chars/raiden/j03.png
        frame	data/chars/raiden/j02.png
        sound   data/sounds/airpunch.wav
        frame	data/chars/raiden/j02.png
        frame	data/chars/raiden/j01.png
        frame	data/chars/raiden/j01.png
        frame	data/chars/raiden/j04.png
        frame	data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame	data/chars/raiden/j03.png
        frame	data/chars/raiden/j03.png
        frame	data/chars/raiden/j02.png
        frame	data/chars/raiden/j02.png
        frame	data/chars/raiden/j01.png
        frame	data/chars/raiden/j01.png
        frame	data/chars/raiden/j04.png
        frame	data/chars/raiden/j04.png
        sound   data/sounds/airpunch.wav
        frame	data/chars/raiden/j03.png
        frame	data/chars/raiden/j03.png
        frame	data/chars/raiden/j02.png
        frame	data/chars/raiden/j02.png
        attack    0 0 0 0
        delay   5
	offset	87 145
	bbox	68 61 42 59
	frame	data/chars/raiden/ja01.png
        delay   999
	offset	87 157
	bbox	72 57 37 80
	frame	data/chars/raiden/j2.png
        delay   15
	offset	87 177
	bbox	80 96 34 81
	frame	data/chars/raiden/u1.png
 
O Ilusionista said:
DC will this function detect the difference between a wall in front of you and when you are on top of a wall?

It's more accurate to say it doesn't care - all it looks for is if the bound entity is inside of a wall. So if you on top of a wall but not in it, then it knows not to shunt. The only situation you might want to watch for is if you are on a wall and you push the bound entity below you down into it. As you can probably guess, you'll get shunted instantly to the far end of that wall, or to the edge of the screen if said wall is long enough.

I don't worry about this because my grab system is configured to allow pushing people into the ground without making their offset go below it.

So please DC, show us how declare in a animation with a example.  And explain better how set that values.
Thanks!

The script itself has commenting that explains how it works, and I've already answered your questions. Not to be mean, but it's very annoying to spend time creating functions specifically for others to use and have them repeatedly ignore the documentation. All you need is inside.

DC
 
It's more accurate to say it doesn't care

That is the question: What happens if you are above a wall, which is been used as a platform and use this code? Won't it push the entity backward?

Maybe my crap english isn't enough to explain, so watch this video - see how Hulk is pushed back at the end by the @cmd antiwall. There is no wall in front of him, but below him (as a platform), but the code still detects it.

! No longer available

Here is the code:

void antiwall(int Dist, int Move, int Distz)
{// Checks if there is wall at defined distance
// If there is wall, entity will be moved away with defined movement
  void self = getlocalvar("self");
  int Direction = getentityproperty(self, "direction");
  int x = getentityproperty(self, "x");
  int z = getentityproperty(self, "z");
  float H;
  float Hz;

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

  H = checkwall(x+Dist,z);
  Hz = checkwall(x+Dist,z+Distz);

  if(Hz > 0)
  {
    changeentityproperty(self, "position", x, z-Distz);
  }

  if(H > 0)
  {
    changeentityproperty(self, "position", x+Move);
  }
}

What I can do to prevent such behaviour on that code?


Also, I don't get this part:
    #define DC_WALL_SHUNT_VT_EMPTY  openborconstant("VT_EMPTY")
    #define DC_WALL_SHUNT_VT_PTR    openborconstant("VT_PTR")

What "openborconstant("VT_PTR")" means?
 
O Ilusionista said:
That is the question: What happens if you are above a wall, which is been used as a platform and use this code? Won't it push the entity backward?

No I get what you mean. Like I said in my post before, when you are on a wall it depends on the height of the offset you are checking. If the offset being checked is below "ground level", that is to say, falls down into the wall you are standing on, then it will be detected as a wall and give you unwanted wall shunting. There are a couple of ways to deal with this depending on your setup.

What "openborconstant("VT_PTR")" means?

It means "pointer type". Internally, entities and objects are pointer variables. A pointer is a variable that "points" to the memory address of another variable. Sounds esoteric and pointless on paper, but is one of the most necessary and powerful coding features of C.

Anyway, checking the type of parameter is a dependable way to verify it. I see this technique a lot and it works OK...

Code:
if(entity && getentityproperty(entity, "exists"))
{
    ...do stuff...

...but sometimes bad data can still get through and cause undefined behavior. Type checking is much cleaner and more reliable. Entities are always pointers, ergo if the variable is anything but a pointer, then it's not a valid entity. Simple as that.

DC
 
@ Ilu : I think I've posted the updated antiwall function somewhere :-[
Anyways, here's the updated one:

Code:
void antiwall(int Dist, int Move, int Distz)
{// Checks if there is wall at defined distance
// If there is wall, entity will be moved away with defined movement
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "a");
   int z = getentityproperty(self, "z");
   float H;
   float Hz;
   float Hw;

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

   H = checkwall(x+Dist,z);
   Hz = checkwall(x+Dist,z+Distz);
   Hw = checkwall(x+Dist,z-Distz);

   if(Hz > y && Hw <= y)
   {
     changeentityproperty(self, "position", x, z-Distz);
   }

   if(H > y)
   {
     changeentityproperty(self, "position", x+Move);
   }
}
 
DC sorry, but your explanation is too technical and not all handle that language.
I do not even really speak English, but I do my best to make myself understood and understand everyone.
I always give my best to learn new things, and I think I have not done too badly, considering the result of my first demo.
So if this is your decision not to provide all those things we try to learn every day, I respect but do not share.
Since the idea is to help each other, no matter who knows less or more.
For my part I will not comment more on this thread, it makes no sense.
If anyone can explain this scrip and show how in an animation, will be welcome. Thanks for all anyway.
 
dantedevil said:
Hey friend you can understand how declare that script?

I think you need to acquire first the "self" (or the caller) and the "target", or I am missing something here?

void self = getlocalvar("self");
void target = getentityproperty(self, "grabbing");

or

void self = getlocalvar("self");
void target = getlocalvar("Target" + self);

Then

dc_wall_shunt (self, target);

By the way, the difference between getentityproperty(self, "grabbing") and getlocalvar("Target" + self) is that in the first case its a shortcut for whatever entity the caller is 'grabbing' (an internal routine for grab) where the second works with any target?

@BB: thanks!
 
I appreciate your help friend!
But it would be good you try the script first and then show as you declared in animation. Because what you treat me to explain is Chinese to me. Thank you.
 
Well this is far I can reach wit my limited knowledege about this:

Code:
// Default to self if no anchor entity provided.
    if(typeof(ent) != DC_WALL_SHUNT_VT_PTR)
    {
        ent = getlocalvar("self");
    }

    // Get anchor location.
    x		= getentityproperty(ent, "x");
    y		= getentityproperty(ent, "y");
    z		= getentityproperty(ent, "z");

    // Get location of bound entity.
    check_x = getentityproperty(bound, "x");
    check_z = getentityproperty(bound, "z");
    anchor_b = getentityproperty(bound, "base");

    // Bound is right of anchor?
    if (check_x > x)

See the info here, can undestand six values must set:

I think this refer to the player, "x" and "y" must be the offset and "z"  I guess be 0
Code:
    // Get anchor location.
    x		= getentityproperty(ent, "x");
    y		= getentityproperty(ent, "y");
    z		= getentityproperty(ent, "z");
[/code

And this mus be for the enemy, "x" an "z"are the coordinates of the @cmd position, and "base" I guess that will be the coordinates of "y"
[code]    // Get location of bound entity.
    check_x = getentityproperty(bound, "x");
    check_z = getentityproperty(bound, "z");
    anchor_b = getentityproperty(bound, "base");

So in this animation i set like this:
        @cmd    dc_wall_shunt 109 183 0 -58 -1 10
But not work.
Code:
anim grabbackward
	 fastattack 1
	 loop     0
	 offset     109 183
	 bbox	 0 0 0 0
	 delay      1
         attackone 0
         frame   data/chars/caro/throw01.png
	sound   data/chars/chosen/hmm.wav
	 delay   30
        @cmd    slamstart
        @cmd    position 8 15 0 -1 0
         frame   data/chars/caro/throw01.png
	 delay   15
        @cmd    position 2 10 0 -1 0
         frame   data/chars/caro/throw02.png
	sound   data/chars/chosen/at1.wav
         hitfx      data/sounds/indirect.wav
         attack30 70 130 40 40 10 1 1 0 10
         @cmd   dasher -2 0 0
	 delay      4
        @cmd    position 2 -8 6 -1 0
         frame	data/chars/caro/throw01b.png
         frame	data/chars/caro/throw01b.png
        @cmd    position 9 -35 -10 -1 1
         frame	data/chars/caro/throw01c.png
         frame	data/chars/caro/throw01c.png
        @cmd    position 5 0 -5 -1 -1
         frame	data/chars/caro/throw01d.png
         frame	data/chars/caro/throw01d.png
         sound   data/sounds/airpunch.wav
        @cmd    position 8 18 -5 -1 -1
         frame	data/chars/caro/throw01.png
         frame	data/chars/caro/throw01.png
        @cmd    position 2 10 0 -1 0
         frame   data/chars/caro/throw02.png
         @cmd   stop
         frame   data/chars/caro/throw02.png
         attack 0 0 0 0
	sound   data/chars/chosen/at2.wav
	 delay  10
        @cmd    position 6 -28 28 -1 1
         frame   data/chars/caro/throw03.png
        @cmd     dc_wall_shunt 109 183 0 -58 -1 10
        @cmd    position 9 -58 10 -1 1
         frame   data/chars/caro/throw04.png
	 delay   40
        @cmd    depost 0
        @cmd    throw 25 2 -2.5 2 0 1 
         frame   data/chars/caro/throw04.png
	 delay  9
         frame   data/chars/caro/throw03.png
         frame  data/chars/caro/throw02.png
	 offset	98 173
	delay   12
	frame	data/chars/caro/rise0.png
	delay   14
	offset	98 176
	frame	data/chars/caro/rise1.png
	offset	98 173
	frame	data/chars/caro/rise2.png

So I give up...
 
no, you are missing the point:

void dc_wall_shunt(void ent, void bound){

The function is waiting for just TWO values: the  ENT and BOUND values.

ent: Anchor entity. - Who is calling this function
bound: Bound entity. - entity to be checked.

So "109" is not a valid caller. Neither "183" is a valid bound entity. Plus, the function is wating for a string - a value between quotes, not a number.

And if I am not wrong, you can't call this function this way:
@cmd    dc_wall_shunt 109 183 0 -58 -1 10

Because you need to give the caller and the bound entity (the target) and you can't give it that way.

Unless you can use like this:

anim attack3
loop 0
delay 6
offset 72 109
bbox 52 50 32 59
hitflash flash3

@script
    if(frame==0){
    void self = getlocalvar("self");
    void target = getentityproperty(self, "grabbing");
    dc_wall_shunt (self, target);
    }
@end_script

sound data/chars/beast/att2.wav
frame data/chars/beast/att31.pcx
bbox 62 53 35 56
frame data/chars/beast/att32.pcx



 
Not working!

Set like this:
Code:
anim grabbackward
	 fastattack 1
	 loop     0
	 offset     109 183
	 bbox	 0 0 0 0
	 delay      1
         attackone 0
         frame   data/chars/caro/throw01.png
	sound   data/chars/chosen/hmm.wav
	 delay   30
@script
    if(frame==2){
    void self = getlocalvar("self");
    void target = getentityproperty(self, "grabbing");
    dc_wall_shunt (self, target);
    }
@end_script
        @cmd    slamstart
        @cmd    position 8 15 0 -1 0
         frame   data/chars/caro/throw01.png
	 delay   15
        @cmd    position 2 10 0 -1 0
         frame   data/chars/caro/throw02.png
	sound   data/chars/chosen/at1.wav
         hitfx      data/sounds/indirect.wav
         attack30 70 130 40 40 10 1 1 0 10
         @cmd   dasher -2 0 0
	 delay      4
        @cmd    position 2 -8 6 -1 0
         frame	data/chars/caro/throw01b.png
         frame	data/chars/caro/throw01b.png
        @cmd    position 9 -35 -10 -1 1
         frame	data/chars/caro/throw01c.png
         frame	data/chars/caro/throw01c.png
        @cmd    position 5 0 -5 -1 -1
         frame	data/chars/caro/throw01d.png
         frame	data/chars/caro/throw01d.png
         sound   data/sounds/airpunch.wav
        @cmd    position 8 18 -5 -1 -1
         frame	data/chars/caro/throw01.png
         frame	data/chars/caro/throw01.png
        @cmd    position 2 10 0 -1 0
         frame   data/chars/caro/throw02.png
         @cmd   stop
         frame   data/chars/caro/throw02.png
         attack 0 0 0 0
	sound   data/chars/chosen/at2.wav
	 delay  10
        @cmd    position 6 -28 28 -1 1
         frame   data/chars/caro/throw03.png
        @cmd    position 9 -58 10 -1 1
         frame   data/chars/caro/throw04.png
	 delay   40
        @cmd    depost 0
        @cmd    throw 25 2 -2.5 2 0 1 
         frame   data/chars/caro/throw04.png
	 delay  9
         frame   data/chars/caro/throw03.png
         frame  data/chars/caro/throw02.png
	 offset	98 173
	delay   12
	frame	data/chars/caro/rise0.png
	delay   14
	offset	98 176
	frame	data/chars/caro/rise1.png
	offset	98 173
	frame	data/chars/caro/rise2.png
 
Damon, am I calling the function on the right way?

@script
    if(frame==0){
    void self = getlocalvar("self");
    void target = getentityproperty(self, "grabbing");
    dc_wall_shunt (self, target);
    }
@end_script

Or can I call it using @cmd method?
 
You're close, but using @script tags really isn't how it was meant to work. Unfortunately I can see that Bloodbane's script doesn't provide any way to get the bound entity. I've got an idea of how that might be handled. Let me get back to you a little later today.

DC
 
Here is an updated version. This one will default to anchor's "grabbed" entity if you don't pass a valid bound. As before, anchor defaults to self. This makes it possible to use @cmd tag with grab systems that don't provide entities.

So you can call it like this:

Code:
@cmd dc_wall_shunt NULL() NULL()

Now you just need to call it in the right spot. That one is easy. Call it when you think a wall shunt is needed. Generally the best place to do that is right before you release a bound entity - but depending on the visual dynamics of the throw, you are free to call it elsewhere too.

Code:
#ifndef DC_WALL_SHUNT

    #define DC_WALL_SHUNT 1

    #define DC_WALL_SHUNT_VT_EMPTY  openborconstant("VT_EMPTY")
    #define DC_WALL_SHUNT_VT_PTR    openborconstant("VT_PTR")

    #define DC_WALL_SHUNT_ADJUST    15

#endif

void dc_wall_shunt(void ent, void bound){

	/*
	dc_wall_shunt
	Caskey, Damon Vaughn
	http://www.caskeys.com/dc]www.caskeys.com/dc
	2010-05-15
	~2011-07-22
	~2015-03-08
	~2015-06-10 - Default to "grabbed" if invalid anchor provided.

	Shunt self away from wall if bound entity is inside of it (wall). Prevents getting
	a bound entity stuck within areas meant to be inaccesable or bounced to infinity
	by wall functions.

    ent:	Anchor entity.
	bound:	Bound entity.
	*/

    int
        wall,
        hole;

    // Anchor entity location.
    float
        x,
        y,
        z,
        anchor_b;

    // Bound offset and base.
    int
        check_x,
        check_z;

	// Default to self if no anchor entity provided.
    if(typeof(ent) != DC_WALL_SHUNT_VT_PTR)
    {
        ent = getlocalvar("self");
    }

    // Verify the bound entity is valid. If not, attempt a default
    // to anchor entity's "grabbed" property. If that fails,
    // there is nothing more we can do, so we'll exit the function
    // and send a log alert.
	if(typeof(bound) != DC_WALL_SHUNT_VT_PTR)
    {
        bound = getentityproperty(ent, "grabbing");

        // Verify the grabbed default found valid entity.
        if(typeof(bound) != DC_WALL_SHUNT_VT_PTR)
        {
            log("dc_wall_shunt(<anchor entity>, <bound entity>): Invalid or missing bound entity.");
            return;
        }
    }

    // Get anchor location.
    x		= getentityproperty(ent, "x");
    y		= getentityproperty(ent, "y");
    z		= getentityproperty(ent, "z");

    // Get location of bound entity.
    check_x = getentityproperty(bound, "x");
    check_z = getentityproperty(bound, "z");
    anchor_b = getentityproperty(bound, "base");

    // Bound is right of anchor?
    if (check_x > x)
    {
        // Check wall and hole using temporary check location that is
        // made up of the bound entity's initial location w/adjustment (this
        // adjustment is just to enhance the visual appearance - it is not a technical
        // necessity). If the temp location is A) in a wall, and B) not in a pit,
        // decrement both the real and temp location, then repeat.
        do
        {
            // Decrement real and temp location.
            x--;
            check_x--;

            // Check for wall and hole.
            wall = (checkwall(check_x+DC_WALL_SHUNT_ADJUST, check_z) > anchor_b);
            hole = checkhole(check_x+DC_WALL_SHUNT_ADJUST, check_z);
        }
        while(wall || !hole);
    }
    else
    {
        // Same as above, except locations are incrmented.
        do
        {
            // Increment real and temp location.
            x++;
            check_x++;

            // Check for wall and hole.
            wall = (checkwall(check_x+DC_WALL_SHUNT_ADJUST, check_z) > anchor_b);
            hole = checkhole(check_x+DC_WALL_SHUNT_ADJUST, check_z);
        }
        while(wall || !hole);
    }

    // Apply final calculated location to anchor.
    changeentityproperty(ent, "position", x, z, y);					//Apply location to anchor.

}
 
Set like DC says and not work.
Code:
anim grabbackward
	 fastattack 1
	 loop     0
	 offset     109 183
	 bbox	 0 0 0 0
	 delay      1
         attackone 0
         frame   data/chars/caro/throw01.png
	sound   data/chars/chosen/hmm.wav
	 delay   30
        @cmd    slamstart
        @cmd    position 8 15 0 -1 0
         frame   data/chars/caro/throw01.png
	 delay   15
        @cmd    position 2 10 0 -1 0
         frame   data/chars/caro/throw02.png
	sound   data/chars/chosen/at1.wav
         hitfx      data/sounds/indirect.wav
         attack30 70 130 40 40 10 1 1 0 10
         @cmd   dasher -2 0 0
	 delay      4
        @cmd    position 2 -8 6 -1 0
         frame	data/chars/caro/throw01b.png
         frame	data/chars/caro/throw01b.png
        @cmd    position 9 -35 -10 -1 1
         frame	data/chars/caro/throw01c.png
         frame	data/chars/caro/throw01c.png
        @cmd    position 5 0 -5 -1 -1
         frame	data/chars/caro/throw01d.png
         frame	data/chars/caro/throw01d.png
         sound   data/sounds/airpunch.wav
        @cmd    position 8 18 -5 -1 -1
         frame	data/chars/caro/throw01.png
         frame	data/chars/caro/throw01.png
        @cmd    position 2 10 0 -1 0
         frame   data/chars/caro/throw02.png
         @cmd   stop
         frame   data/chars/caro/throw02.png
         attack 0 0 0 0
	sound   data/chars/chosen/at2.wav
	 delay  10
        @cmd    position 6 -28 28 -1 1
        frame    data/chars /caro/throw03.png
        @cmd    position 9 -58 10 -1 1
         frame   data/chars/caro/throw04.png
	 delay   40
        @cmd dc_wall_shunt NULL() NULL()
        @cmd    depost 0
        @cmd    throw 25 2 -2.5 2 0 1 
         frame   data/chars/caro/throw04.png
	 delay  9
         frame   data/chars/caro/throw03.png
         frame  data/chars/caro/throw02.png
	 offset	98 173
	delay   12
	frame	data/chars/caro/rise0.png
	delay   14
	offset	98 176
	frame	data/chars/caro/rise1.png
	offset	98 173
	frame	data/chars/caro/rise2.png
 
Thanks. Using the @script was the only way to pass who is the self and the target.

And if I may ask, why don't you simple post the way you call the function on your character? I think we can understand better if we see how you do it, because I fail to think in any other way to call it (unless you use openborvariant direclty on the script call).

@BB: Thanks man, I tried your code and it works perfectly.
 
O Ilusionista said:
Thanks. Using the @script was the only way to pass who is the self and the target.

And if I may ask, why don't you simple post the way you call the function on your character? I think we can understand better if we see how you do it, because I fail to think in any other way to call it (unless you use openborvariant direclty on the script call).

@BB: Thanks man, I tried your code and it works perfectly.

I totally agree with you my friend.
It would be much easier if he share the script showing it like that, and I asked at the beginning.
It is much clearer to everyone.
 
Back
Top Bottom