Battle System
Displaying 1-9 of 9 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
hammrock2005

does anyone know how to program a battle system because I'm making an rpg game and i need a battle system for my demo. if you have any help, please REPLY!



Posted on 2000-12-16 17:21:53

Khross

I don't know how experienced a coder you are, but I got the impression you want someone to do the whole battle system for you. I can't do that, but I can offer some advice. :)

You'll want a function that continually loops until a) all your characters are dead, or b) all the enemies are dead. Something like this:

#define MAXCHARS 3
#define MAXENEMIES 3
//the defines are just for convience.
//ok, we'll need an array to store your party's hp.
global int curhp[MAXCHARS], maxhp[MAXCHARS];
//now, for the enemy...
global int e_curhP[MAXENEMIES], e_maxhp[MAXENEMIES];

void MainBattleLoop()
{
while(curhp[MAXCHARS]=1 || e_curhp[MAXENEMIES]=1)
/* Ok, this probably looks complicated. It's basically saying "keep looping while one party or the other has a member with at least 1 HP left." */
{
PlayersTurn();
/* Standard "Attack,Magic,Run" menu. */
EnemiesTurn(); //take a wild guess ;)
}
if(!e_curhp[MAXENEMIES]) //if the enemy hp = 0...
GiveXP(); /* Here you can give xp and mapswitch, or whatever. */
}

Ok! How about that menu? Well... I'm feeling generous, so here's some more crappy examples.

void PlayersTurn()
{
local int i,x,done; //misc ints
local int cy,cimage; //for the cursor
i=fontheight(0);
cimage=LoadImage("CURSOR.GIF"); //loads image
unpress(0); //clear keyboard presses
cy=0;
done=0;
while(!done)
{
Render(); //draw the screen
Setlucent(1); /* not nessicary, makes things transparent. */
Rectfill(20,screeny-(screeny/4),screenx/4,screeny/2,138);
/* icky math. Basically draws a blue box at the screen's bottom. */
GotoXY(screenx/4,screeny/2); Printstring(0,"Attack");
GotoXY(screenx/4,screeny/2+i); Printstring(0,"Magic");
GotoXY(screenx/4,screeny/2+15); Printstring(0,"Run");

/* this part might require keys.vc. Get it at http://www.vergesource.com */
if(up && c0) { unpress(0); cy++; }
if(down && c



Posted on 2000-12-16 22:42:10

Khross


if(down && c



Posted on 2000-12-16 22:44:38

Khross




if(down && c



Posted on 2000-12-16 22:51:06

Khross




if(down && c



Posted on 2000-12-16 22:58:11

Allan

No fucking text. Damn shit.



Companions the creator seeks, not corpses, not herds and believers. Fellow creators the creator seeks--those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest.

Posted on 2000-12-16 23:21:50

Hatchet

I'm makin' an independant battle system demo, based off of Earthbound's for simplicity. I'm makking it for tVS as a tutorial. It's not done yet but I can send you what I have if you want, and you might be able to learn somethin' from it...

-Hatchet



-Hatchet

Posted on 2000-12-17 00:41:31

hammrock2005

If you could that would be great! All I want is either a learning guide or a real working one! Thanks! ^_^



what is wrong with these people!

Posted on 2000-12-17 17:49:46

Hatchet

What's your e-mail so I can send you what I have, if you want it now, unless you want to wait 'till I'm done. E-mail me at hatchvcc@home.com

-Hatchet



-Hatchet

Posted on 2000-12-18 19:32:53


Displaying 1-9 of 9 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.