Dark Age Games
Home Dark Age EX Dark Age 2 Message Board Fan Art FAQ Kelzar Mage DALpedia MS Forum
Board Index Dark Age General Bug Report Website Off Topic Register User Edit User User List Search

In reply to: wait... -- William 12:38:59 08-01-2004

Need Help!
Posted by: William
15:33:34 08-01-2004

I need help form you Xorlak because you are the best programmer and you respond quick. There is just one enemy that move after the character, and I'm not sure why. Is there any buggs in the for loop? Try to check it out or tru it. This is the code:



*****
*This part is just for try, you can erase it if you like to put
*a for loop instead.
#slot!=1
#enehp[slot]!=10
#enefp[slot]!=10
#enetst[slot]$="melle.tst"
#enex[slot]!=4
#eney[slot]!=1
#slot!=2
#enehp[slot]!=10
#enefp[slot]!=10
#enetst[slot]$="melle.tst"
#enex[slot]!=4
#eney[slot]!=2
#slot!=3
#enehp[slot]!=10
#enefp[slot]!=10
#enetst[slot]$="melle.tst"
#enex[slot]!=4
#eney[slot]!=3
#slot!=4
#enehp[slot]!=10
#enefp[slot]!=10
#enetst[slot]$="melle.tst"
#enex[slot]!=4
#eney[slot]!=4

#animation$="Sword.tst"

*****

#RealTime()
#Method RealTime()
{
#Battle!=0
#GetStats()

#slot!=1
#GetBoardTile(enex[slot]!,eney[slot]!,1,cover[slot]$)
#LayerPut(3,4,1,melle.tst1)

#slot!=2
#GetBoardTile(enex[slot]!,eney[slot]!,1,cover[slot]$)
#LayerPut(6,4,1,melle.tst1)

#slot!=3
#GetBoardTile(enex[slot]!,eney[slot]!,1,cover[slot]$)
#LayerPut(enex[slot]!,eney[slot]!,1,melle.tst1)

#slot!=4
#GetBoardTile(enex[slot]!,eney[slot]!,1,cover[slot]$)
#LayerPut(enex[slot]!,eney[slot]!,1,enetst[slot]$)

#wait()

#for(slot!=1;slot!<5;slot!=slot!+1)
{
#GetBoardTile(enex[slot]!,eney[slot]!,1,cover[slot]$)
#LayerPut(enex[slot]!,eney[slot]!,1,enetst[slot]$)
}

#TargetLocation(x!,y!)
#While(battle!=0)
{
#Attack!=0
#Get(a$)
#if(a$="UP"){#Push("N")}
#if(a$="DOWN"){#Push("S")}
#if(a$="LEFT"){#Push("E")}
#if(a$="RIGHT"){#Push("W")}
#if(a$="A"){#Attack!=1}*Attack
#if(a$="S"){#Attack!=2}*Food
#if(a$="D"){#Attack!=3}*Run
#if(a$="Q"){#dos()}*quit

#If(Attack!=1)
{
#Attack!=0
#GetStats()
#TargetLocation(x!,y!)
#GetDirection(Direction$)
#for(slot!=0;slot!<5;slot!=slot!+1)
{
#If(enehp[slot]!>0)
{

#If(Direction$="EAST")
{
#x[slot]!=enex[slot]!
#x[slot]!=x[slot]!-1
#If(x!=x[slot]!)
{
#TileNum!=1
#Branch(:down)
}
}

#If(Direction$="WEST")
{
#x[slot]!=enex[slot]!
#x[slot]!=x[slot]!+1
#If(x!=x[slot]!)
{
#TileNum!=2
#Branch(:down)
}
}

#x[slot]!=enex[slot]!

#If(Direction$="NORTH")
{
#y[slot]!=eney[slot]!
#y[slot]!=y[slot]!-1
#If(y!=y[slot]!)
{
#TileNum!=3
#Branch(:down)
}
}

#If(Direction$="SOUTH")
{
#y[slot]!=eney[slot]!
#y[slot]!=y[slot]!+1
#If(y!=y[slot]!)
{
#TileNum!=4
#Branch(:down)
}
}

}*If EneHp End*
}*For Loop End*
#Branch(:evendown)
:down
#enehp[slot]!=enehp[slot]!-fp!
#If(enehp[slot]!<0){#enehp[slot]!=0}

#If(TileNum!=1){#x!=x!-1}
#If(TileNum!=2){#x!=x!+1}
#If(TileNum!=3){#y!=y!-1}
#If(TileNum!=4){#y!=y!+1}

#GetBoardTile(x!,y!,1,cover$)
#Castlit(TileNum!,TileNum$)
#FightTile$="Sword.tst"+TileNum$
#LayerPut(x!,y!,1,FightTile$)
#ShortDelay(0)
#ShortDelay(0)
#If(enehp[slot]!>0){#LayerPut(x!,y!,1,enetst[slot]$)}
#Branch(:DeadOrNot)
:evendown
#GetDirection(Direction$)
#If(Direction$="South")
{
#TileNum!=3
#y!=y!+1
}
#If(Direction$="North")
{
#TileNum!=4
#y!=y!-1
}
#If(Direction$="West")
{
#TileNum!=1
#x!=x!-1
}
#If(Direction$="East")
{
#TileNum!=2
#x!=x!+1
}

#GetBoardTile(x!,y!,1,cover$)
#Castlit(TileNum!,TileNum$)
#FightTile$=animation$+TileNum$
#LayerPut(x!,y!,1,FightTile$)

#ShortDelay(0)
#ShortDelay(0)
:DeadOrNot
#EnemyDead!=0

#for(slot!=0;slot!<5;slot!=slot!+1)
{
#If(enehp[slot]!<1){#EnemyDead!=EnemyDead!+1}
}
#If(EnemyDead!=4){#EnemyDead()}

}*If Attack 1 End*

#If(Attack!=2)
{
#If(Food!>0)
{
#food!=food!-1
#GiveHP(TARGET,75)
#Attack!=0
}
}*If Attack 2 End

#If(Attack!=3)
{
#Random(10,random!)
#Attack!=0
#If(Random!=1){#BattleOverNotWin()}
}*If Attack 3 End*

#If(Attack!=0)
{
#EnemyTurn!=EnemyTurn!+1
#If(EnemyTurn!=100)
{
#EnemyTurn!=0
#GetStats()
#TargetLocation(x!,y!)
#for(slot!=0;slot!<5;slot!=slot!+1)
{
#If(enehp[slot]!>0)
{
#charx!=x!
#charx!=charx!-1
#If(enex[slot]!=charx!){#Branch(:down1)}

#charx!=x!
#charx!=charx!+1
#If(enex[slot]!=charx!){#Branch(:down1)}

#charx!=x!
#chary!=y!
#chary!=chary!-1
#If(eney[slot]!=chary!){#Branch(:down1)}

#chary!=y!
#chary!=chary!+1
#If(eney[slot]!=chary!){#Branch(:down1)}
}
}

#for(slot!=0;slot!<5;slot!=slot!+1)
{
#If(enehp[slot]!>0)
{
#LayerPut(enex[slot]!,eney[slot]!,1,cover[slot]$)
#GetBoardTile(enex[slot]!,eney[slot]!,1,cover[slot]$)

#x[slot]!=enex[slot]!
#x[slot]!=x[slot]!-1
#GetBoardTileType(x[slot]!,eney[slot]!,1,dest1$)

#x[slot]!=enex[slot]!
#x[slot]!=x[slot]!+1
#GetBoardTileType(x[slot]!,eney[slot]!,1,dest2$)

#x[slot]!=enex[slot]!

#y[slot]!=eney[slot]!
#y[slot]!=y[slot]!-1
#GetBoardTileType(enex[slot]!,y[slot]!,1,dest3$)

#y[slot]!=eney[slot]!
#y[slot]!=y[slot]!+1
#GetBoardTileType(enex[slot]!,y[slot]!,1,dest4$)

#If(enex[slot]!>x!)
{
#If(dest1$="NORMAL")
{
#enex[slot]!=enex[slot]!-1
#EnemyStyle!=7
#Branch(:walk)
}
}

#If(enex[slot]!<x!)
{
#If(dest2$="NORMAL")
{
#enex[slot]!=enex[slot]!+1
#EnemyStyle!=10
#Branch(:walk)
}
}

#If(eney[slot]!>y!)
{
#If(dest3$="NORMAL")
{
#eney[slot]!=eney[slot]!-1
#EnemyStyle!=4
#Branch(:walk)
}
}

#If(eney[slot]!<y!)
{
#If(dest4$="NORMAL")
{
#eney[slot]!=eney[slot]!+1
#EnemyStyle!=1
#Branch(:walk)
}
}


:walk
#EnemyMove!=EnemyMove!+1
#If(EnemyMove!=3){#EnemyMove!=0}
#EnemyDir!=EnemyMove!+EnemyStyle!
#CastLit(EnemyDir!,EnemyDir$)
#EnemyDir$=enetst[slot]$+EnemyDir$
#LayerPut(enex[slot]!,eney[slot]!,1,EnemyDir$)
}
}

#Branch(:evendown1)
:down1
#enefp!=enefp[slot]!
#enefp!=enefp!-dp!
#If(enefp!<2){#enefp!=2}
#start[health]!=start[health]!-enefp!

#if(start[health]!<1){#CharDead}
:evendown1

}*If EnemyTurn 5 End*
}*If Attack 0 End*

}*While Loop Battle End
}*Method RealTime End*


#Method GetStats()
{
#GetHP(TARGET,hp!)
#GetMaxHP(TARGET,maxhp!)
#getfp(TARGET,fp!)
#getdp(TARGET,dp!)
#GetLevel(TARGET,level!)
#GetSMP(TARGET,smp!)
#GetMaxSMP(TARGET,maxsmp!)
}

#Method CharDead()
{
#Empty()
#Over()
#Reset()
}

#Method EnemyDead()
{
#Battle!=0
#dos()
*etc...
}

#Method BattleOverNotWin()
{
#Battle!=0
#dos()
*etc...
}

#Method ShortDelay(delay!){#Delay(delay!)}


Thanks, I hope you can help me.

_______________
Fan of DA. Keep it going.

Working on other things now. Trying to get my life to pieces.
That was a long time ago I wrote this:
Project: Marovia
Finished: 32%
Edit Post