Hey Everyone.
I've been given the task of making a game using scratch.
Asking around i was given the idea of making a pokemon style game (ftw?) and i found that there isn't many full pokemon games (unless i missed them)
So here i am programming my game, i have it so stepping on the grass has a 1 in 3 chance of giving you a battle, if it doesn't then the script will wait then try again.
Now, I've got my sprites rolling in from the side when the battle starts, and it turns to me that i don't have much of an idea for the battle system...
Can anyone give me ideas on how i would go about writing this turn based battle idea? I know that (for now) i will just have one attack, and that will do between a certain amount of damage (depending on level). How can i make it so that the opponent attacks when it should? And how could i eventually make it so the opponent can choose which move?
Please help.
Thanks,
~Buggy
P.S. I may need some beta testers for once i have the main stuff out the way and need some testing...Please tell me if your interested
Offline
There's a few Pokemon RPG's, but it'd probably be hard to explain how to make a full one over the forums
However Archmage made some RPG's which might help if you were to download the projects and look at the scripts
http://scratch.mit.edu/projects/archmage/182422
http://scratch.mit.edu/projects/archmage/98362
Last edited by 06dknibbs (2010-06-21 15:59:23)
Offline
Thanks for the links, I'll be checking them out soon
And i don't need to know how to make a whole RPG, just some ideas on how to make the computer wait until it's turn and such. Sorry if you don't get it...watch a pokemon battle on youtube and you'll get it i think
Thanks,
~Buggy
Offline
Here is some psuedocode from http://www.kirupa.com/forum/showthread.php?t=97237
In pseudocode an attack might go
- Gamestate = Your turn
- All user controls for attacking are now enabled
- Select an attack
- Select a target and click 'Attack' button
- Set gamestate to = You attacking (all controls disabled)
- Run animation for current attacker moving in and attacking
- Run animations for bad guy reactions (probably triggered from raising events or targetting the object through the base class)
- Calculate attack power/damage etc through stats and show appropriate damage symbols etc (these can loop and animate independantly of the gamestate)
- Set gamestate to = You finished attacking
- Run jump back animations to reset your character to their position
- Set gamestate to = Enemies turn
This is how most turn based RPG battle systems work. The only diffrence is the battle forumla which you can make up or if you really want it to be perfect you can google search the battle forumla for pokemon and put it in. Mine has a simple made up forumla for the battle engine.
PS: Heres some neat info for random encounters. You said that you give the user a 33% chance to fight an enemy, but in that case the user can face monsters one after another which never happens in real RPGs. What some games like final fantasy do is have a "danger" value for each zone where monsters are. When a player enters a zone with enemies a number is generated equal to a random value between the danger number and the danger number times 1.5. When the player takes an amount of steps equal to the generated number they face a monster.
Last edited by archmage (2010-06-21 16:55:16)
Offline
Thanks for the danger zone idea, but in Pokemon you can face monsters one after another (Unless i've misread what you've wrote, in which case i'm sorry XD ) and I think i already have a battle formula
But your instructions at the top have really made it clear to me so far, i think i might be able to do it! Thanks so much!
~Buggy
Offline
Sorry For the double post, but i thought it better than to make a new topic when it's sort of linked to the battle...
I have a script so when my monster attacks it does damage based on atk*2 - enemy def.
But that leaves me with a positive number, so if i put in change enemy HP then it'd add on to the HP .
How would i make it so that It'd take off from the enemies HP?
Thanks,
~Buggy
Offline
Buggy132KX wrote:
Sorry For the double post, but i thought it better than to make a new topic when it's sort of linked to the battle...
I have a script so when my monster attacks it does damage based on atk*2 - enemy def.
But that leaves me with a positive number, so if i put in change enemy HP then it'd add on to the HP.
How would i make it so that It'd take off from the enemies HP?
Thanks,
~Buggy
Instead of changing the Hp by a positive number like 5 when the enemy is hit, change it by a negative number like -5
Also, it's fine to post something different that's on topic. ^^
Last edited by 06dknibbs (2010-06-22 10:06:43)
Offline
I got that bit, it's just... Well, I'll get detailed XD
My Battle system has:
Hp
Atk
Sp. Atk
Def
Sp. Def
Level.
Everything is decided by a random number then by it's level.
So Let's say My enemies HP is 13.
The Attack is based on:
My Atk*2-Enemy Def
BUT
That formula will leave me with a positive number.
So Let's say my atk is 10, the enemy def is 9.
The formula would enter 11 into the dmg variable.
But I want to make it so i have HP - Dmg. If I put Change HP by Dmg It'll leave me with 24 instead of 2.
How do i change the dmg variable from positive to negative without recoding all the stats?
Thanks,
~Buggy
Offline
Hmmm, It'll probably work.
But is there no way to have it so a number changes from positive to negative? Because I may (in future versions) add a stats page, but It'll look weird if it says -10...
Thanks,
~Buggy
Offline
Then you could keep the original formula, and change HP - Dmg to HP - Dmg*-1
Which should change the 11 to -11 and then take it from the HP while leaving the normal damage as 11
And actually, this would probably be easier than the other formula xD
Last edited by 06dknibbs (2010-06-22 10:42:02)
Offline
Ah, now that's what I'm looking for!
Thanks so much, and for sticking with me when i weren't explaining very well
Your the best,
~Buggy
Offline
Errm, sorry, but it doesn't appear to be working XD.
My Code:
<forever>
<if><<State = 0 <and>Attack No. = 1 >>
[Un Important Stuff Here]
<change{ Enemy Hp }by( My Atk*1.5 *-1 + enemy Def )
<end>
The State Is whose turn It is, the Attack No. Is which Attack.
I multiplied the attack by -1 and added enemy defence.
In My trial The enemy had 24 HP, I attacked and it had 32.0.
Please Help,
~Buggy
Offline
Your scripts slightly different than I thought . So..
The problem there is, the change block changes by whatever number is left at the end. So if a positive number is left, the enemy gains HP.
Try replacing the "Change: Enemy HP with another variable called damage.
Then, set the "Damage" to My Atk*1.5 - Enemy Defence.
Then add "Change: Enemy HP" by "Damage*-1"
And that should hopefully work XD
Offline
Ok, I'll set onto that now.
Thanks so much!
~Buggy
Offline
Sorry for the revival, but I'm having even MORE problems XD
I've just decided to post the game up, as i don't even know what went wrong...never mind how to fix it
http://scratch.mit.edu/projects/Buggy132KX/1148110
(Press Play, go into the top right area...Credits are still old and need updating, ignore them...)
On the script it'll say
Set Snot attack to Pick Random 1 to 1.
That was because I wanted to test it out to see if i could have a turn based battle...It'll be changed to however many moves he'll have
Thanks so much,
~Buggy
Offline
You have <set{ Snot damage }to( (( (( (( snot damage <*> 2.5 )) <-> <pick random( (( <{ level }> <*> 1 )) )to( (( level <*> 3 )) )) <-> <{ snipah def }> ))
Shouldn't it be:
<set{ Snot damage }to( (( (( (( snot ATK <*> 2.5 )) <-> <pick random( (( <{ level }> <*> 1 )) )to( (( level <*> 3 )) )) <-> <{ snipah def }> ))?
Offline
...
EPIC FACEPALM MOMENT!!!XD
How did i not see that?
Thanks so much!
Tested and working,
~Buggy
Offline
Buggy132KX wrote:
Hey Everyone.
I've been given the task of making a game using scratch.
Asking around i was given the idea of making a pokemon style game (ftw?) and i found that there isn't many full pokemon games (unless i missed them)
So here i am programming my game, i have it so stepping on the grass has a 1 in 3 chance of giving you a battle, if it doesn't then the script will wait then try again.
Now, I've got my sprites rolling in from the side when the battle starts, and it turns to me that i don't have much of an idea for the battle system...
Can anyone give me ideas on how i would go about writing this turn based battle idea? I know that (for now) i will just have one attack, and that will do between a certain amount of damage (depending on level). How can i make it so that the opponent attacks when it should? And how could i eventually make it so the opponent can choose which move?
Please help.
Thanks,
~Buggy
P.S. I may need some beta testers for once i have the main stuff out the way and need some testing...Please tell me if your interested![]()
I'm seeing you a lot on the forums. I think a mod should make you a member soon
Offline
Awww, thank you
I'm just trying to get me known as someone who's active and polite
~Buggy
P.S.
Mike, I'm hoping to have it done within a week, maybe shorter, as I may be allowed to work on this during my IT lessons at school ..
Offline
Ach, Even more problems
I'm planning on having a healing system, so in between fights you can heal your guy.
I had a script that said
<When I recieve battle> Battle Starts
<Set Full HP to HP> Set the Full HP variable to your guys current health.
Then at the end of a battle (just coding it at the end atm so it's sorted and i can just move the scripts.
<Set HP to Full HP>
But when i go into a battle again it isn't set as it should be.
What's wrong with my script?
~Buggy
Offline
to calculate damage go here: http://www.upokecenter.com/games/dungeon2/guides/damage.php
Offline
Buggy132KX wrote:
Ach, Even more problems
![]()
I'm planning on having a healing system, so in between fights you can heal your guy.
I had a script that said
<When I recieve battle> Battle Starts
<Set Full HP to HP> Set the Full HP variable to your guys current health.
Then at the end of a battle (just coding it at the end atm so it's sorted and i can just move the scripts.
<Set HP to Full HP>
But when i go into a battle again it isn't set as it should be.
What's wrong with my script?
~Buggy
According to what you have said your script is fine. You either need to give more details or upload your project.
Offline
*sigh*
O.K. Then
I have no idea what else i could add to make it more detailed about the HP.
It'll be uploaded by the time this is posted.
Thanks for still being helpful!
~Buggy
P.S Link Is http://scratch.mit.edu/projects/Buggy132KX/1155084
P.S.S . MarioBrosRule, Thanks, but i already have an idea for a simplistic yet still pokemon-like battle system.
P.S.S.S Is it P.S.S or P.P.S?
Offline