rune
Burger Head
Posts: 22
|
Post by rune on Aug 27, 2019 13:31:17 GMT -5
Hello, I'm still learning how to use BEX. My question is how to program an RPG battle, considering the following example: Hero (Level 1) Attack: 14 (Damage 6) Defense 8 (- Damage) HP: 20
Monster Attack: 6 (Damage 4) Defense: 3 HP: 11
Forgive me for not submitting an already assembled example. I'm really starting. I wanted the look of the battle to look similar to Phantasy Star II, but if I need to do it like Final Fantasy or Arabian Nights. Thanks!
|
|
|
Post by tiberiyltim on Aug 27, 2019 16:30:30 GMT -5
|
|
|
Post by alexmega on Aug 29, 2019 17:24:22 GMT -5
very cool
|
|
rune
Burger Head
Posts: 22
|
Post by rune on Sept 1, 2019 18:33:45 GMT -5
Oh Thanks!
I think to make a simple system, in which when opting for attack, there is a chance of the enemy to escape the blow according to the defense (armor). The game is based in my book "O Devaneio de Rute". =)
|
|
|
Post by tiberiyltim on Sept 3, 2019 6:41:31 GMT -5
Oh Thanks! I think to make a simple system, in which when opting for attack, there is a chance of the enemy to escape the blow according to the defense (armor). The game is based in my book "O Devaneio de Rute". =) Dungeon crawler or Battle system like jRPG (Phantasy Star)? ?
|
|
rune
Burger Head
Posts: 22
|
Post by rune on Sept 14, 2019 17:54:05 GMT -5
A JRPG. If I have difficulty building as PS 4, I will do as PS 1 without 3D mazes. When I have sprites ready I will show.
|
|
rune
Burger Head
Posts: 22
|
Post by rune on Oct 4, 2019 13:52:15 GMT -5
I found on a brazilian site how the battles of Phantasy Star work. I guess make similar:
1- Get the ATK value of the attacking character;
2- Adjusts the ATK value using a randomly generated value. This adjustment is made to reduce the ATK value randomly so that it remains at least 3/4 of the original value. 3- 3- Assuming an ATK of 180, 3/4 of this value is 135, so the ATK value to be used to calculate enemy damage will be somewhere between 135 and 180, randomly recalculated each time the character attacks;
4- Get the DEF value of the enemy receiving the attack;
5- Adjusts the value of DEF using a randomly generated value. This adjustment is made to reduce the DEF value randomly so that it remains at least 3/4 of the original value. The rule is identical to the one used to calculate the character's ATK;
6- Using the adjusted values, do the DEF-ATK account;
7- If ATK> DEF subtracts the HP difference from the enemy;
8- If (DEF-ATK) <16, the game generates another random number for the adjusted ATK. This generated value will be at most the character level value and at least zero. Then the new value is subtracted from the enemy's HP;
9- If (DEF-ATK)> = 16, the game checks whether the difference is even or odd. If odd, the same process of recalculating the ATK with values between zero and the character level is performed. If the result is an even number, the monster defends the attack;
10- If the enemy's HP becomes zero, the enemy dies.
I believe the random number can be achieved with the "For" command.
I am trying to understand how I do random encounters. If a character walks on icy terrain, for example, he can find monsters 6,7,8 on my list.
|
|
|
Post by tiberiyltim on Oct 5, 2019 16:16:13 GMT -5
ATKtemp=99 Randomizer=RND(ATKtemp)
DEF=DEF-Randomizer
It gamedesign...
|
|
rune
Burger Head
Posts: 22
|
Post by rune on Oct 7, 2019 18:12:45 GMT -5
I will try and return if it works. Thanks!
|
|
rune
Burger Head
Posts: 22
|
Post by rune on Nov 9, 2019 12:28:43 GMT -5
I am setting up the battle system, I am creating the levels, but one detail I forgot while testing. Create the order of actions of PC's and NPC's according to an Agility value. How do I do that? Thank you!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 14, 2019 16:32:33 GMT -5
You should use data statements and either a set of variables or an array (a collection of variables) to make coding your engine easier.
Let's set up 3 monsters, using the following data: MonsterID, MonsterLevel, MonsterHP, MonsterAtk, MonsterDef
MonsterData: Data 0,3,15,4,5 Data 1,1,6,1,2 Data 2,2,13,3,3
Note: Data statements can only handle values from 0 to 255. If you use higher numbers, you have to use DataInt
Here's how to read the data into variables:
For i = 0 To 2 ' Monster ID range Reload MonsterData,i*5 Read MonsterID, MonsterLvl, MonsterHP, MonsterAtk, MonsterDef Print MonsterID;":" Print "Level: "; MonsterLvl; ", HP: "; MonsterHP; ", Atk: "; MonsterAtk; ", Def: "; MonsterDef
Next
If you make those variables into arrays, you can use the variable "i" as the index, so it would be MonsterID(i), MonsterLvl(i), etc.
|
|