Pokemon style battle system RPG questions

Started by Akumayo, Wed 26/05/2004 23:54:37

Previous topic - Next topic

Akumayo

Okay, I am starting a Pokemon style RPG, and I have some problems, Help would be appreciated.
1. How exactly do you think I should set up the monsters, like, say your facing MONSTERA and you catch it, how exactly could you make it be with you?  I have though mabye I could have only one enemy character, named MONSTER, and every time you get into a battle MONSTER's view is changed to match that of the enemy, as well as all of MONSTER's stats (which are global variables) then when you catch it, YOURMONSTER gets it's view and stats changed as well.  Pretty choppy plan huh?  Any suggestions???

2. How can you script a random monster to appear when you go over a hotspot, but with a certain percent chance, like:  50%-MONSTERA, 30%-MONSTERB, 20%-MONSTERC  . Is there a way to run a random like this, and if so, is there a simple way to run a random script???  Like Random(RunFunction, a-c) Or something like that???

Please, any help at all is highly appreciated!!!
"Power is not a means - it is an end."

Moox

1)Inventory items or following you

2)look at the random()script, it gives a random number between 0 and what you choose that you can store as a global int

maybe something like if the int less then 20 attack etc...

stuh505

I made a game with pokemon style battles...(didnt finiish it but i made the battles part)...

I recommend using overlays for the background, characters, damage, and attack effects, and a GUI for the fighting options.

some of these functions will be helpful:


use the slide function to make the pokemon slide in from the side (or slide any way you want...)

function LW_SlideOverlay(int overlayID, int x, int y, int newx, int newy, int step, int delay){
// can only slide vertically or horizontally
// step MUST BE > 0
  if (x<newx){ //if moving right
    while (x<newx){
      MoveOverlay(overlayID,x+step,y);
      x = x+step;
      Wait(delay);
    }
  } else if (x>newx){ //if moving left
    while (x>newx){
      MoveOverlay(overlayID,x-step,y);
      x=x-step;
      Wait(delay);
    }
  }

  if (y<newy){ //if moving down
    while (y<newy){
      MoveOverlay(overlayID,x,y+step);
      y=y+step;
      Wait(delay);
    }
  } else if (y>newy){ //if moving up
    while (y>newy){
      MoveOverlay(overlayID,x,y-step);
      y=y-step;
      Wait(delay);
    }
  }
}

//use this functoin to shake an overlay

function LW_ShakeOverlay(int overlayID, int x, int y, int amount, int delay, int repeat, int pause){
  int loop=0;

  while (loop<= repeat){
     MoveOverlay(overlayID, x-amount,y-amount);
     Wait(delay);
     MoveOverlay(overlayID, x-amount,y+amount);
     Wait(delay);
     MoveOverlay(overlayID, x+amount,y-amount);
     Wait(delay);
     MoveOverlay(overlayID, x+amount,y+amount);
     Wait(delay);
     MoveOverlay(overlayID, x-amount,y-amount);
     Wait(delay);
     MoveOverlay(overlayID, x-amount,y+amount);
     Wait(delay);
     MoveOverlay(overlayID, x+amount,y-amount);
     Wait(delay);
     MoveOverlay(overlayID, x+amount,y+amount);
     Wait(delay);
     Wait(pause);
     loop++;
  } 
}

//similarly, if you want to shake an object...
function LW_ShakeObject(int object, int amount, int repeat, int pause){
  int objX = GetObjectX(object);
  int objY = GetObjectY(object);
  int loop = 0;
  int speed = 25;
 
  while (loop <= repeat){
    while(IsObjectMoving(object)==1)
      Wait(1);
     
    MoveObjectDirect(object,objX-amount,objY-amount,speed);
   
    while(IsObjectMoving(object)==1)
      Wait(1);
     
    MoveObjectDirect(object,objX-amount,objY+amount,speed);
   
    while(IsObjectMoving(object)==1)
      Wait(1);
     
    MoveObjectDirect(object,objX+amount,objY-amount,speed);
   
    while(IsObjectMoving(object)==1)
      Wait(1);
     
    MoveObjectDirect(object,objX+amount,objY+amount,speed);
   
    while(IsObjectMoving(object)==1)
      Wait(1);
     
    MoveObjectDirect(object,objX,objY,speed);
   
    loop++;
   
    Wait(pause*20);
  }
}

you wont use this, but this is the function i used to start a fight sequence.. yours could be very similar.

function LW_Fight(int sprite, string name, int cs, int ep, int immune_mindb, int can_evade, int cs_penalty, int windest, int losedest){
  int flee=0; //do not flee right away
  string buffer;
 
  LW_ENEMY_CS = cs;
  LW_ENEMY_EP=ep;
  LW_CAN_EVADE = can_evade;
  LW_IMMUNE_MINDB = immune_mindb;
  LW_CS_PENALTY = cs_penalty;
  LW_LOSEDEST = losedest;
  LW_WINDEST = windest;
 
  //start fight music
  SetMusicVolume(3);
  PlayMusic(2);
 
  //draw fight background
  LW_FIGHTSCREEN_OVERID = CreateGraphicOverlay(0,0,46,0);
 
  GUIOn(FIGHT);
 
  if (LW_CAN_EVADE==0){
    SetButtonPic(FIGHT, 10, 1, 51); //disable evade button if cannot evade
    SetButtonPic(FIGHT, 10, 3, 51);
  }
 
  //update cs/ep statistics for lw/enemy
  StrFormat(buffer,"%d",LW_ENEMY_CS);
  SetLabelText(FIGHT,8,buffer);
 
  StrFormat(buffer,"%d",LW_ENEMY_EP);
  SetLabelText(FIGHT,9,buffer);
     
  StrFormat(buffer,"%d",LW_GetCurrentCS(immune_mindb));
  SetLabelText(FIGHT,4,buffer);
 
  StrFormat(buffer,"%d",LW_GetCurrentEP());
  SetLabelText(FIGHT,5,buffer);
     

  //draw combatants
  LW_ENEMY_OVERID = CreateGraphicOverlay(400, 1, sprite, 1);
  LW_OVERID = CreateGraphicOverlay(-200,1,LW_SPRITE,1);
 
  Wait(30);
 
  //move combatants into position
  LW_SlideOverlay(LW_OVERID, -200, 1, -10, 1, 10, 0);
  LW_SlideOverlay(LW_ENEMY_OVERID, 400, 1, 100, 1, 10, 0);
 
  LW_OVERID_X = -10;
  LW_OVERID_Y = 1;
  LW_ENEMY_OVERID_X = 100;
  LW_ENEMY_OVERID_Y = 1;
 
 
 

}

SMF spam blocked by CleanTalk