Ok, here's my problem. I am trying to make a BS. Again. <_< The problem(s) are this: 6 safety nets appear right before the battle, the main character's in two places, and DrawText does not seem to be working at all (I found the error of this one while putting in the comments here). I am using G's Misc Plugin, Triuken's Plugin, and Juicy. Here is the code, commented to the best of my ability. As you may or may not be able to tell, it is not finished. I am just trying to make sure everything works right.
*FightBattle - Includes needed files, and calls
*all the pretty methods that we need to run.
*
*CacheScreens:
*
*0-Initial state; board is only drawn
*1-Characters and enemies have been drawn
*2-Info stat command display mabobers have been drawn
*3-Text has been placed into the stat boxes.
#Method FightBattle(en[1]$, en[2]$, en[3]$, bkg$, canrun!)
{
#include("enemylib.prg")
#GetVariables
#SetStats
#Send(bkg$, 19, 5)
#forceredraw
#CacheScreen(0)
#DrawScreen(0)
#system.pause
}
*GetVariables - stores the important info that we need
*once the battle is over.
#Method GetVariables
{
#playerx[0]! = originalx!
#playery[0]! = originaly!
#playerlayer[0]! = originall!
#GetBoardName(originalboard$)
#FontProperties("Arial", 10)
}
*SetPlayerStats - Puts the player stats into variables that
*will be used in the BS. Yes, I know experience is wrong.
*I changed its variable in the player editor. Enemy var's
*are the same, but with e's instead of p's.
#Method SetPlayerStats(playernum!)
{
#If(playerhandle[playernum!]$ ~= "")
{
#p_handle[playernum!]$ = playerhandle[playernum!]$
#GetHP(p_handle[playernum!]$, p_hp[playernum!]!)
#GetMaxHP(p_handle[playernum!]$, p_mhp[playernum!]!)
#GetSMP(p_handle[playernum!]$, p_mp[playernum!]!)
#GetMaxSMP(p_handle[playernum!]$, p_mmp[playernum!]!)
#GetFP(p_handle[playernum!]$, p_fp[playernum!]!)
#GetDP(p_handle[playernum!]$, p_dp[playernum!]!)
#GetLevel(p_handle[playernum!]$, p_level[playernum!]!)
#GetGP(gold!)
#p_exp[playernum!]! = exp[p_handle[playernum!]$]!
}
}
*CheckPlayerDead - Checks to see if a player's dead. Duh.
#Method CheckPlayerDead(playernum!)
{
#p_dead[playernum!]! = 0
#if(p_hp[playernum!]! < 1)
{
#p_dead[playernum!]! = 1
}
#if(p_handle[playernum!]$ = "")
{
#p_dead[playernum!]! = 1
}
}
*CheckEnemyDead - Take a guess.
#Method CheckEnemyDead(enemynum!)
{
#if(e_hp[enemynum!]! < 1)
{
#p_handle[enemynum!]$ = ""
}
}
*CheckBattleOver - Checks to see if the battle's over,
*returns 1 if the good guys win, returns 2 if the bad
*guys win.
#Method CheckBattleOver(battleover!)
{
#pdeadall! = p_dead[0]! + p_dead[1]! + p_dead[2]!
#if(pdeadall! = 3)
{
#battleover! = 2
#Return(battleover!)
}
#if(e_handle[1]$ = "")
{
#if(e_handle[2]$ = "")
{
#if(e_handle[3]$ = "")
{
#battleover! = 1
#Return(battleover!)
}
}
}
}
*SetEnemyStats - Calls a method that sets the stats
*for an enemy.
#Method SetEnemyStats(enemynum!)
{
#If(en[enemynum!]$ ~= "")
{
#code$ = "#e_" + en[enemynum!]$
#RPGCode(code$)
#Kill(code$)
}
}
*SetStats - Take a look.
#Method SetStats
{
#SetPlayerStats(0)
#SetPlayerStats(1)
#SetPlayerStats(2)
#SetEnemyStats(1)
#SetEnemyStats(2)
#SetEnemyStats(3)
#CheckPlayerDead(0)
#CheckPlayerDead(1)
#CheckPlayerDead(2)
#CheckEnemyDead(1)
#CheckEnemyDead(2)
#CheckEnemyDead(3)
}
*DrawPlayerStats - Houston, we have a problem here.
*The plugin refuses to draw anything, and... Whoops!
*Well, anyways, it draws the stats in a little box thingy.
#Method DrawPlayerStats(playernum!)
{
#if(p_handle[playernum!]$ ~= 0) <~~~ Rofl. Found it.
{
#color(15)
#hori! = playernum! * 100 + 307
#DrawText(p_handle[playernum!]$, hori!, 389)
#DrawText("HP: <p_hp[playernum!]!>/<p_mhp[playernum!]!>", hori!, 409)
#DrawText("MP: <p_mp[playernum!]!>/<p_mmp[playernum!]!>", hori!, 420)
#hori2! = hori! + 80
#fdraw! = p_fury[playernum!]! / 260 * 80
#color(13)
#fillrect(hori!, 440, fdraw!, 460)
#drawrect(hori!, 440, hori2!, 460)
#kill(hori!)
#kill(hori2!)
#kill(fdraw!)
}
}
*DrawScreen - This pretty thingy draws the players, enemies,
*And stat info display command selector thingies.
*
*Modes:
*
*0 - Draw Everything.
*1 - Draw Players and enemies
*2 - Draw Stat indicator info command display selector thingy-mabobbies.
#Method DrawScreen(mode!)
{
#If(mode! = 0)
{
#flipscreen(0)
#for(temp! = 0; temp! < 4; temp! = temp! + 1)
{
#If(p_handle[temp!]$ ~= "")
{
#vert! = temp! * 2 + 5
#eraseplayer(p_handle[temp!]$)
#putplayer(p_handle[temp!]$, 19, vert!)
#if(p_dead[temp!]! = 0)
{
#stance(43, p_handle[temp!]$)
}
#if(p_dead[temp!]! = 1)
{
#stance(30, p_handle[temp!]$)
}
#kill(vert!)
}
}
#for(temp! = 1; temp! < 4; temp! = temp! + 1)
{
#if(en[temp!]$ ~= "")
{
#if(e_handle[temp!]$ ~= "")
{
#hori! = 2
#vert! = temp! -1 * 4 + 4
#if(vert! = 12)
{
#hori! = 7
#vert! = 10
}
#drawenemy(e_file[temp!]$, hori!, vert!)
#kill(hori!)
#kill(vert!)
}
}
}
#CacheScreen(1)
#setimagetranslucent("mwin.jpg", 0, 379, 100, 100)
#setimagetranslucent("mwin.jpg", 307, 379, 300, 100)
#color(15)
#drawrect(0, 379, 100, 479)
#drawrect(307, 379, 407, 479)
#drawrect(407, 379, 507, 479)
#drawrect(507, 379, 607, 479)
#CacheScreen(2)
#DrawPlayerStats(0)
#DrawPlayerStats(1)
#DrawPlayerStats(2)
#CacheScreen(3)
#kill(temp!)
}
#if(mode! = 1)
{
#FlipScreen(0, 0, 0, 640, 379)
#for(temp! = 0; temp! = 2; temp! = temp! + 1)
{
#If(p_handle[temp!]$ ~= "")
{
#vert! = temp! * 2 + 5
#eraseplayer(p_handle[temp!]$)
#putplayer(p_handle[temp!]$, 8, vert!)
#if(p_dead[temp!]! = 0)
{
#stance(43, p_handle[temp!]$)
}
#if(p_dead[temp!]! = 1)
{
#stance(30, p_handle[temp!]$)
}
#kill(vert!)
}
}
#for(temp! = 1; temp! = 3; temp! = temp! + 1)
{
#if(en[temp!]$ ~= "")
{
#if(e_handle[temp!]$ ~= "")
{
#hori! = 2
#vert! = temp! * 4 + 4
#if(vert! = 16)
{
#hori! = 7
#vert! = 10
}
#drawenemy(e_file[temp!]$, hori!, vert!)
#kill(hori!)
#kill(vert!)
}
}
}
#CacheScreen(1)
#kill(temp!)
}
#if(mode! = 2)
{
#FlipScreen(2, 380, 640, 480)
#DrawPlayerStats(0)
#DrawPlayerStats(1)
#DrawPlayerStats(2)
#CacheScreen(3)
}
}