This one is the easiest - just open the 'game' folder in the battle engine distribution, and copy the following things to your project's game directory:shahab96 wrote: 3) If i need to import your engine into my game what code should I use?
for example in java you would use import (package.*)
in c++ you would use #include <whatever>
- the 'BattleEngine' folder (the scripts for the engine itself)
- the 'gfx' folder (the example graphics)
- the 'audio' folder (the example sounds and music)
- the 'assets.rpy' file (sprites, animations, styles and skills set-up for the examples)
(If you're on a Mac, you'll need to download the Windows or Linux distribution of the game as well to get at the source files, because Macs package everything up inside an .app, and while it's quite possible to get files out it's not trivial to explain.)
Stick these things inside your game folder, and you should have access to the battle engine in your game.
You don't need to jump to a label - rather, you create a python object and call a method on it. This is done in each of the demo files. So you shouldn't need to add any kind of reference; just having the files in a sub-folder of your game folder will allow Ren'Py to load them.shahab96 wrote: 2) When I want to start a battle in my game how will I give renpy the reference so that it know where to load your engine from? Should i make it a label or do you have one premade that i can jump to?
In the demo project, there's three files with code in to start battles: active_demo.rpy, grid_demo.rpy and path_demo.rpy. Check which kind of battle you want to run in your game, and copy the whole python block - from the first 'python:' up to just before the 'jump start' at the end - into your game script, at the point that you want the battle to run. You'll then need to modify the scripts if you want to change the names of the fighters, their stats, or anything like that. (Modify the code you copy/pasted to change fighter names and stats, modify the assets.rpy file to change grpahics or skills/spells.)shahab96 wrote: 1) I need to know which files I need to copy paste and where to do them.
I'd recommend starting with active_demo.rpy, because that's the simplest one and thus the easiest to understand. Each of the demo files is thoroughly commented, but I don't repeat comments on things I've already described, and I'm expecting people to read the active one first, then grid, then path.
One final note - for the purposes of testing, feel free to keep using the graphics from the 'gfx' folder and the music from the 'audio' folder while you get to grips with the engine and fit it into your game. However, please don't release a game using these assets. Before you release, you should replace the graphics and the music with your own, because I don't give a license to use my graphics - I'd like to use some of them in a game of my own, in fact - and my brother hasn't given a license for anyone to use his music. (The sound effects are all from FlashKit.com, so long as you display the same credits you should be OK to use those if you want.)