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
 
i think antiwall script could solve your problem

i use it on my projects and works for me
check if your antiwall is that 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 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);
   }
}
 
Thanks my friend!

But if you read all my post, you see i have that script in all my characters.
I post some animation, to see how use the script.

I can't understand where is the problem.
 
can i see a screenshot of your walls in obeditor? like the one i provided from mine
my walls are created by other forum users and i use it heavily into my current project,
i want check the shape of it

[attachment deleted by admin]
 
I am now on a smartphone, but when I got home, I pass the photo. Looking at your photo, strikes me the height of your walls. I see far exceed the size of the screen. In my stage, set up to only slightly exceeded. I do not know if that affects the problem.

About Maggas question,  happens in all type of slam or throws.
 
when are from corners and places like that, bloodbane and maxman like to set high ones at least when tehy do it for me
but there are sometimes that you need to make it smaller like in the case of my first stage, where players and enemies will jump from those walls

[attachment deleted by admin]
 
Thanks Maggas!

I try with the sripts, but the problem still coming.

Here a picture of this stage (original created by Illu) in ObEditor 1.5.9:
7OjYRJs.png

And here the bugs with different characters:
http://youtu.be/r5pLAzHvZgU

Here my last version of the stage:
Code:
music		data/music/stonehenge.ogg
background	data/bgs/stage1-1/backgr.png
panel    	data/bgs/stage1-1/backgr.png
order           a

Wall  0  228  0  0  232  0  22  280
Wall  1137  228  -232  0  18  18  22  280
Wall  514  224  -282  0  391  118  18  280

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	empty
coords	848 254
at	0

spawn	amazon
coords	555 240
health	80
at	5
The coords is z 208 270
 
I see in some animations of Muscle POwer in WHSJ, has set the antiwall in different way like Bloodbane show me.
Here the Muscle Power animation:
Code:
anim freespecial18
      loop	0
	delay	12
      offset	70 170
      attackone 0
      quakeframe 5 5 7
      flipframe 5
      hitfx   data/sounds/indirect.wav
      sound	data/chars/mpower/at2.wav
      @cmd    slamstart4
      @cmd    position 7 34 0 -1 0
      frame	data/chars/mpower/tth1.gif
      frame	data/chars/mpower/tth2.gif
      @cmd    position 7 34 30 0 0
      frame	data/chars/mpower/tth3.gif
      @cmd    position 9 -7 107 0 0
      delay	18
      frame	data/chars/mpower/tth4.gif
      @cmd    position 2 -132 35 0 1
      offset	135 170
      delay	10
      @cmd    antiwall -30 70 -1
      @cmd    antiwall -50 50 -1
      @cmd    antiwall -70 30 -1
      frame	data/chars/mpower/tth5.gif
      attack10 75 130 140 40 5 1 1 1
      dropv 2 1.5
      delay	8
      offset	62 170
      @cmd    position 11 130 0 0 1
      @cmd    antiwall 30 -70 -1
      @cmd    antiwall 50 -50 -1
      @cmd    antiwall 70 -30 -1
      frame	data/chars/mpower/tth7.gif
      attack10   0 0 0 0 0 0
      @cmd    hurt 25
      @cmd    antiwall 30 -70 -1
      @cmd    antiwall 50 -50 -1
      @cmd    antiwall 70 -30 -1
      frame	data/chars/mpower/tth7.gif
      @cmd    depost 0
      @cmd    finish 5 2 2 2 0 0
      @cmd    antiwall 30 -70 -1
      @cmd    antiwall 50 -50 -1
      @cmd    antiwall 70 -30 -1
      frame	data/chars/mpower/tth7.gif
      frame	data/chars/mpower/tth7.gif
      offset	104 120
	delay	9
	frame	data/chars/mpower/rise11.gif
	frame	data/chars/mpower/rise22.gif
	frame	data/chars/mpower/rise33.gif
	frame	data/chars/mpower/rise44.gif

I dont understand this type of values:
      @cmd    antiwall -30 70 -1
      @cmd    antiwall -50 50 -1
      @cmd    antiwall -70 30 -1

or this, where the antiwall is after the finish:

      @cmd    depost 0
      @cmd    finish 5 2 2 2 0 0
      @cmd    antiwall 30 -70 -1
      @cmd    antiwall 50 -50 -1
      @cmd    antiwall 70 -30 -1

Bloodbane teach me this:
http://www.chronocrash.com/forum/index.php?topic=1105.msg11571#msg11571

So ... what am I doing wrong?
 
i don know about the antiwall part but
judging by the image and your video  the problematic part of your walls are just the corners?

i edit some points in your image make a backup of your wall values and try to move a little up the places i have marked with an arrow until the places where the lines are crossing become separated (where i marked with a circle)
check if this way something changes

looking by the video i got the impression that the character and enemies are already inside the wall

[attachment deleted by admin]
 
Maggas can you help my with a example, to undestand better?

How set your antiwall method in this animation?
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
 
Well, i try setting your values in the animation and work perfect:

I mean this:
      @cmd    antiwall 30 -70 -1
      @cmd    antiwall 50 -50 -1
      @cmd    antiwall 70 -30 -1

If the position is negative i suposse use this:
      @cmd    antiwall -30 70 -1
      @cmd    antiwall -50 50 -1
      @cmd    antiwall -70 30 -1

Thanks for all you help my friend.

I admire your work, and I want you to know that your mods of Mortal Kombat, were the inspiration that led me to be working on mine.

THANKS!
 
Anyone else use the method of Maggas?

Let me know if you need to set different antiwall the script, instead of copying and pasting as I did. Beyond that worked well Raiden.
But not if it be so with all the characters.
 
You may have other issues as well, but you defiantly need a wall checking function that only requires running once and fully shunts instead of needing to be run on multiple frames. Here's the latest version of my own wall shunt. You run it right before releasing a bound entity and it will auto shunt exactly how far is needed.

Code:
void dc_wall_shunt(void ent, void bound){

	/*
	dc_wall_shunt
	Caskey, Damon Vaughn
	2010-05-15
	~2011-07-22
	~2015-03-08

	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;

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

	// 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 initial check location.
    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 checklocation w/adjustment.
        // If in a wall but not a pit, decrement the offset and location,
        // then check again. Continue until either in a pit or not in a wall.
        do
        {
            x--;
            check_x--;

            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
    {
        do
        {
            x++;
            offset_x++;

            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.

}

DC
 
Well, i have carefully read your answer and what it says in the script, but I do not understand exactly what values should be set in this part:

(void ent, void bound)


I could understand as used.
It would be something like this:

Code:
anim grabbackward
	 fastattack 1
	 loop       0
	 offset     87 177
	 bbox	    0 0 0 0
	 delay      1
         attackone 0
	 jumpframe 	2 3.3 0
	 landframe	7
	 sound      data/chars/raiden/rthrow.wav
	 frame	    data/chars/raiden/grab.png
        @cmd    slamstart
	 delay      35
        @cmd    antiwall -35 10 -1 
        @cmd    position 8 60 15 -1 1
	 frame	    data/chars/raiden/throw00.png
	 delay      30
	 offset     109 183
        @cmd    position 8 40 20 1 1
         frame      data/chars/raiden/throw01.png
	 delay      4
        @cmd    antiwall -35 10 -1 
        @cmd    position 10 25 20 1 1
         frame      data/chars/raiden/throw02.png
	 delay      1
         frame      data/chars/raiden/throw02.png
	 sound      data/sounds/punch.wav
        @cmd    antiwall -35 15 -1 
        @cmd    position 10 -30 -15 1 1
	 delay      2
         frame      data/chars/raiden/throw03.png
        @cmd    depost 0
        @cmd    throw 25 4 -4.5 -1.8 0 0
        @cmd dc_wall_shunt ? ?
	 delay      999
         frame      data/chars/raiden/throw03.png
         flipframe  7
	 delay      15
  	 offset	    92 177
	 frame	    data/chars/raiden/u1.png
 
Ent and bound are the holding entity and the defending (grappled) entities respectively. You call it this function immediately before releasing a bind, and it will ensure you don't leave the grappled entity inside of a wall. It replaces your antiwall function and only needs to be called that one time.

DC
 
OpenBor crash with this script.
Script compile error in 'animationscript': DC_WALL_SHUNT_VT_PTR line 37, column 24

I put first in my scipt.c:

Code:
#include "data/scripts/library/ani0020.h"

void dc_wall_shunt(void ent, void bound){

	/*
	dc_wall_shunt
	Caskey, Damon Vaughn
	2010-05-15
	~2011-07-22
	~2015-03-08

	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;

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

	// 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 initial check location.
    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 checklocation w/adjustment.
        // If in a wall but not a pit, decrement the offset and location,
        // then check again. Continue until either in a pit or not in a wall.
        do
        {
            x--;
            check_x--;

            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
    {
        do
        {
            x++;
            offset_x++;

            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.

}
 
First... The engine detected an error and shut itself down, it did not crash. There is a big difference and it does matter. Second, you removed the constants definition when you copied, so of course it won't work.

DC
 
Back
Top Bottom