/battle-engine

RPG Battle Engine for Renpy

Primary LanguageRen'PyMIT LicenseMIT

RPG Battle Engine for Ren'Py

Table of contents

Features

  • 3 player slots and 8 monster slots
  • Monsters split between two rows (you can't attack a monster in the back row if there's another one in front of it)
  • Active and passive skills
  • Player skills can target enemies (one, more or all), allies (one or more), k.o. allies (to revive them) and themselves
  • Monsters can use skills too (attack only)
  • "Attack", "Defend" and "Use Item" commands
  • Damage, accuracy, experience and leveling formulas
  • Randomized monster selection and slot position
  • In-battle inventory system
  • Player selection screen
  • Mouse-following Tooltips
  • Message box at the top of the screen
  • ATL for players, monsters and damage display
  • Animated hp and mp bars

Screenshots

screenshot screenshot screenshot screenshot

Documentation

Create new character:

  1. Open scripts/define/char_def.rpy and scroll to the bottom
  2. Use this template and follow the previous examples to define a new character:
define character.var = Character("Name", image="")
default var = Char("Name", img="", skills=[], p_skills=[], equip={'hand': None, 'head': None, 'chest': None, 'accs': None})
  1. Open scripts/define/assets/images.rpy and define the battle avatar, either following the examples or using this more basic template:
image char_battle = "images/char/char_battle.png"
  1. Add the character sprite/s to the images/char folder
  2. You can now add it to the party_list list: $ var.append(party_list)

Create new monster:

  1. Open scripts/define/monsters_def.rpy and look for the load_monsters label
  2. Use this template and follow the examples to define a new monster:
monster_var = Monster(name, hpmax, atk, dfn, exp, lvl, img, sfx_atk, anim, skills)
  1. Add the monster sprite to the images/monsters folder
  2. You can now add it to the wild_monsters list: $ monster_var.append(wild_monsters)

Create new skill:

  1. Open scripts/define/battle_def.rpy and look for the other skills defined at the bottom
  2. Follow the examples and use the respective template depending if it's a passive or active skill:
default skill_var = ActiveSkill(name, pwr, mp_cost, sfx, targ, targs, type='active', trans=None, img=None, back_row=False)`
default skill_var = PassiveSkill(name, sfx=None, img=None, trans=None, lvl=0)
  1. You can now append it to a character: $ skill_var.addSkill(a)

Create new item:

  1. Open scripts/define/items_def.rpy and look for the load_items label
  2. Use this template and follow the examples to define a new item:
item_var = Item(name, desc, icon=False, value=0, act=Show("inventory_popup", message="Nothing happened!"), type="item", recipe=False, tags={})
  1. Add the item sprite to the images/inv folder
  2. You can now append it to your inventory, indicating the quantity: $ player_inv.take(item_var,2)

battle.rpy:

  • Battle setup
  • Player select screens
  • Tooltip screen
  • Player and monster display screens
  • Message screen
  • "label battling": switchs between player and monsters turns
  • "label end_battle"

player_actions.rpy:

  • "label turn_actions": handles player turn phases
  • "label player_skill": handles the type of action that was selected (skill, item, defend, etc.)
  • Skill select screen
  • Target select screens (enemy, ally, row, etc.)
  • Damage animation screens

Credits

Scripts

Sprites

Sound effects