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: Xorlak, problems with bs.. -- William 15:07:42 12-14-2004

Okay...
Posted by: Xorlak
16:55:00 12-14-2004

First, some minor things.  Have you confirmed that the following work for you?

#If(a$="UP"){#If(x!=stonex1!){#If(y!=stoney1!){#y!=y!+33}}}

#If(grid!=0){#SetImage("BattleBoardCover.bmp",174,0,466,332)     #SetImage("arrows.bmp",0,0,145,98)}


From past experiences with trans2, I don't think I was able to get more than one command to work in a single-line if statement (could have been an older version though).

As for your question, I think you want your code to be structured like this:

#battleover!=0
#while(battleover!=0)
{
  #characterturn()
  #for(i!=0;i!<3;i!=i!+1)
  {
    #enemyturn(i!)
  }
}

#method enemyturn(slot!)
{
  #checkifenemycanattack(slot!,canattack!) *make this return 1 for 'canattack!' if it finds that the enemy can attack
  #if(canattack!=1)
  {
    #enemyattack(slot!)
  }
  #if(canattack!=0)
  {
    #enemymove(slot!)
  }
}


Obviously this'll require a rewrite/tweaking of your methods.

Note that all those method calls will actually slow down your battle system.  But use them until you get it working, then worry about merging methods or putting the code from the method itself inside the loop for a speed gain.

----------
-Xorlak
Edit Post