[SOLVED] Strange Bug

O Ilusionista

Captain 100K
Have anyone experienced this bug? I have a character that doesn't work only in a specific stage, where all other chars works and she works perfrectly on every other stages.

And the logs says...nothing. The game just crashes: http://pastebin.com/67mjvdnd

I already tested all my backup versions, and they doesn't work either. So its not a change which had broken the char.

Any ideas?
 
I managed to get some errors when I tried.

Command '//counterrange' not understood in file 'data/chars/misc/drum.txt'!
Command '//followanim' not understood in file 'data/chars/misc/drum.txt'!
Loading 'Drum' from data/chars/misc/drum.txt
Loading 'iHP' from data/chars/misc/iHP.txt
Loading 'coin' from data/chars/misc/coin.txt
Loading 'Crate' from data/chars/misc/crate.txt
Loading 'Money' from data/chars/misc/money.txt
Loading 'textWhirl' from data/chars/misc/text/textWhirl.txt
Loading 'Blower' from data/chars/misc/blower.txt
Command '@script{' not understood in file 'data/chars/bosses/whirlwind/Whirlwind.txt'!
Command 'int' not understood in file 'data/chars/bosses/whirlwind/Whirlwind.txt'!
Command 'dodgeleapz(xr,0,1.7);' not understood in file 'data/chars/bosses/whirlwind/Whirlwind.txt'!
Command '}' not understood in file 'data/chars/bosses/whirlwind/Whirlwind.txt'!
Command '@end_script' not understood in file 'data/chars/bosses/whirlwind/Whirlwind.txt'!
Loading 'Whirlwind' from data/chars/bosses/whirlwind/Whirlwind.txt
Loading 'minebot' from data/chars/robots/minebot.TXT
Loading 'golem' from data/chars/golem/golem.txt
Loading 'Soldier' from data/chars/soldier/soldier.txt
Loading 'Guardian' from data/chars/guardian/guardian.txt
Loading 'bala' from data/chars/misc/Bala.txt
Loading 'balaE' from data/chars/misc/BalaE.txt
Loading 'Gunner' from data/chars/gunner/gunner.txt
WARNING: data/chars/soldier/Forklift.txt tries to load a nonnumeric value at drawmethod, where a number is expected!
erroneus string: .
Loading 'Forklift' from data/chars/soldier/Forklift.txt
Command 'blockratio' not understood in file 'data/chars/guard/guard.txt'!
Loading 'Guard' from data/chars/guard/guard.txt

I don't know, but I think something with conflicting with wirlwind's scripts.
 
I think your version is outdated, there is no Whirwind on that stage.

edit: I got what is breaking it. The bug just happens if you set minz and maxz to the same value, like this:

z 189 189 0
I changed those values for another stage and the crashes happens too.

The strange is: Brand is the only char to have this problem, and I can't tell you why.
 
copy character folder and keep it as backup, then remove half of his anims and see if it solves the problem, you will be able to find the problem easily.If removing anims wont work then remove half of his header commands.
 
I got what was causing the bug: her spawn animation.

But I don't see any problem with that. Tried to remove "seta", but no good.
anim spawn
loop 0
delay 2
offset 100 124
bbox 63 47 23 52
seta 200
bbox 82 70 40 45
@cmd toss "bombb" 100 240 0
@cmd toss "bombb" 100 240 0
sound data/chars/brand/retreat.wav
frame data/chars/brand/jump02.png
@cmd toss "bombb" 100 240 0
@cmd toss "bombb" 100 240 0
frame data/chars/brand/jump02.png
@cmd toss "bombb" 100 240 0
frame data/chars/brand/jump02.png
@cmd toss "bombb" 100 240 0
frame data/chars/brand/jump02.png

in another test, I found that if I remove those "@cmd toss" commands, the animation works fine.

Code:
void toss(void Bomb, float dx, float dy, float dz)
{ // Tossing bomb
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "a");
   int z = getentityproperty(self, "z");

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

   projectile(Bomb, x+dx, z+dz, y+dy, Direction, 0, 1, 0);
}

Maybe I will need to use a an animation change to make those bombs
 
Try moving them to the second frame - just insert a frame of delay 1 before running any scripts and that might do it.

DC
 
no, I tested DC' spawn01 function and it works. Even if I put in frame 0.
I am aware of the frame 0 bug, but he just ignores the script sometimes, not crashes the engine.

The whole thing is TOSS function VS 2D stages. IF you use TOSS in any animation while you are on a 2D, the engine crashes.
 
I'm betting it has to do with the spawning - the spawned entity might be out of bounds and killed instantly before it's moved properly into the 2D playfield, then when an action is taken (the toss effect) it's trying to act upon a dangling pointer and you get a genuine crash.

Try taking out the spawn effect and see what happens.

DC
 
I changed the spawned entity, and TOSS is working. So its an entity issue.

This is the bombb text:

name bombb
speed 0
jumpheight 0
jumpspeed 0
type none
gfxshadow 1
Antigravity 100
subject_to_wall  1
subject_to_platform 1
subject_to_hole 1

animationscript data/scripts/grabscript.c

palette none

anim attack1
delay 4
loop 0
offset 11 14
quakeframe 0 2 4
sound data/sounds/fogo02.wav
frame data/chars/brand/misc/00.png
frame data/chars/brand/misc/01.png
frame data/chars/brand/misc/02.png
frame data/chars/brand/misc/03.png
frame data/chars/brand/misc/04.png
frame data/chars/brand/misc/05.png
frame data/chars/brand/misc/06.png

anim idle
delay 6
loop 1 1 4
offset 12 23
hitflash flash3
burn 4 1 18 24 35 1 0 0 5 10
dropv 3 3 0
@cmd stop
@cmd randomteleonscreen
@cmd antiwallRandom 1
@cmd dasher 0 -4 0
@cmd spawn01 "po" 0 20 0
sound data/sounds/missile2.wav
frame data/chars/brand/misc/bomb00.png
@cmd spawn01 "po" 0 22 0
frame data/chars/brand/misc/bomb01.png
@cmd spawn01 "po" 0 20 0
frame data/chars/brand/misc/bomb02.png
@cmd spawn01 "po" 0 22 0
frame data/chars/brand/misc/bomb00.png
@cmd spawn01 "po" 0 20 0
frame data/chars/brand/misc/bomb00.png

#|edited by openBor Stats v 0.67

EDIT: I think I found the culprit - its this function (both entities uses it):

void randomteleonscreen()
{// Randomly teleports onscreen

    void self = getlocalvar("self"); //Get calling entity
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int Screen = openborvariant("hResolution"); // Get screen width
  int Width = openborvariant("PLAYER_MAX_Z") - openborvariant("PLAYER_MIN_Z"); // Get width
  int iRx = rand()%(Screen/2) + Screen/2 ;
    int iRz;

    iRz = rand()%(Width/2) + Width/2 ;

    changeentityproperty(self, "position", iRx + XPos, iRz + openborvariant("PLAYER_MIN_Z")); //Randomly teleport
}

Since the MIN_Z and MAX_Z are the same, thre Width value is ZERO. At iRZ, we are dividing ZERO/2.

I'vbe tried to change to " iRz = rand()%(Width+1/2) + Width+1/2 ;" but isn't working.
 
BINGO: the problem was the random function.

I solved changing the function to this:

Code:
void randomteleonscreen()
{// Randomly teleports onscreen

    void self = getlocalvar("self"); //Get calling entity
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int Screen = openborvariant("hResolution"); // Get screen width
    int Width = openborvariant("PLAYER_MAX_Z") - openborvariant("PLAYER_MIN_Z"); // Get width
    int iRx = rand()%(Screen/2) + Screen/2 ;
    int iRz;

	if (Width>0){
    iRz = rand()%(Width/2) + Width/2 ;
	}

    changeentityproperty(self, "position", iRx + XPos, iRz + openborvariant("PLAYER_MIN_Z")); //Randomly teleport
}
 
Back
Top Bottom