PDA

View Full Version : Dark Link Help



Tamamo
11-28-2015, 01:46 PM
He freezes the game when he attacks and I don't know why. :banghead:
http://pastebin.com/WTfwT9BP

Code is 22808 characters at 808 lines, and the post limit is 15000 wow. Longest script ever award?

Tamamo
11-28-2015, 04:57 PM
Okay I need some serious help here. We have a stack overflow error. What do?

FFC script 1 (Darklink): Invalid ZASM command 65535 reached
http://img2.wikia.nocookie.net/__cb20140215035349/creepypasta/images/6/6b/That_really_rustled_my_jimmies.jpg

SUCCESSOR
11-29-2015, 02:33 AM
I don't know if that is a stack overflow. Try breaking up the script into two and see if that helps.

Gleeok
11-29-2015, 03:07 AM
I'm a little confused as to how 65535 was run since it's not even a valid command. 0xFFFF is basically reserved. You used to get a "Stack over or underflow" error so I'm not so sure that's what it is. Hmm...



Longest script ever award?

Nope. In GRIKARUGUN the basic 1x1 enemy script alone is over 2100 lines and most of it looks like this:

if(tx<120)dir=3;if(tx>120)dir=2;init=true;enemy->CSet=6;this->CSet=6;enemy->HP=enemyHP;this->Vx=0; //etc...

If I ran it through a code formatter it would probably be around 10,000. ;)

Tamamo
11-29-2015, 09:51 AM
I'm an idiot. That error means you have an infinite loop, and since I didn't have a jump sound nothing was playing.

SUCCESSOR
11-29-2015, 06:31 PM
I'm an idiot. That error means you have an infinite loop, and since I didn't have a jump sound nothing was playing.

That doesn't sound right. Are you saying you found and fixed the issue? Can you elaborate?

Tamamo
11-29-2015, 07:03 PM
SUCCESSOR
Very well, I shall elaborate.

void Dodge(ffc this, npc ghost)
{
Ghost_Data=GetComboOffset(this, DARKLINK_CMB_DODGE);
float linkangle=ArcTan(DLCenterX()-CenterLinkX(),DLCenterY()-CenterLinkY());
Ghost_Jump=2.8;
Game->PlaySound(ghost->Attributes[DARKLINK_ATTR_SFX_JUMP]);
while(Ghost_Z>0 || Ghost_Jump>0)
{
Ghost_MoveAtAngle(linkangle,DARKLINK_JUMP_STEP*(gh ost->Step/100),3);
Ghost_ForceDir(OppositeDir(RadianAngleDir4(linkang le)));
//Missing a waitframe.
}
}
void Jump(ffc this, npc ghost)
{
int dir=JumpDirection();
if(dir==-1)
{
Dodge(this,ghost); //this happens vary rarely
return;
}

Ghost_Jump=DARKLINK_JUMP_VELOCITY;
Game->PlaySound(ghost->Attributes[DARKLINK_ATTR_SFX_JUMP]);
while(Ghost_Z>0 || Ghost_Jump>0)
{
Ghost_Move(dir,DARKLINK_JUMP_STEP*(ghost->Step/100),3);
Ghost_ForceDir(OppositeDir(dir));
//Missing a waitframe.
}
}


This caused an infinite loop, more so the sword sprite was blank so it didn't appear so I was mistaken which part was causing the problem.