Mystic Software Forums
Mystic Software => General Discussion => Topic started by: Tough Dragon on July 23, 2005, 01:27:41 PM
-
How do I make it so I can press a button and I fight or run or use a item. This is what I did so far. Sad
#Bitmap("testbkg.jpg")
#Put(8, 10, "Pictures.tst001")
#Put(7, 10, "Pictures.tst002")
#Put(9, 10, "Pictures.tst002")
#Put(8, 11, "Pictures.tst003")
I don't know what I'm doing.
-
That is probably the best battle system I've ever seen. Smile
-
Now this
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#Mwin(1 - Fight)
#MWin(2 - Special Moves)
#MWin(3 - Item)
#MWin(4 - Run)
#Wait()
******************************
#if(4)
#Send("start.brd", 8, 11, 1)
*******************************
-
No no no no. That won't work.
It should be this...
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#Mwin(1 - Fight)
#MWin(2 - Special Moves)
#MWin(3 - Item)
#MWin(4 - Run)
#Wait(a$)
******************************
#if (a$=="4")
#Send("start.brd", 8, 11, 1)
******************************
-
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#battledone!=0
#while(battledone! == 0)
{
#mwincls
#Mwin(1 - Fight)
#MWin(2 - Special Moves)
#MWin(3 - Item)
#MWin(4 - Run)
#Wait(a$)
******************************
#if (a$=="4")
{
#battledone! = 1
#Send("start.brd", 8, 11, 1)
}
******************************
}
Heh, now someone else. Let's all add a piece.
-
Well, I remember matt72186 giving me some tips about a BS one time:
I suggest you put everything in arrays
an array for each character/character stats
an array for each item
an array for each move in the game
an array for each enemy/enemy stats
it's up to you what variables you want to store for every game, for example
character[0]["name"]$ = "bob"
character[0]["health"]! = 100
item[0]["title"]$ = "sword"
specialmove["level"]$ = "fierce"
specialmove["power"]! = 100
Then when you go in your battle system it's all a matter of loading the data and deciding what you want to do with it, like for an attack you can do
damage! = character[cnum!]["attack"]! - enemy[enum!]["defense"]!
enemy[enum!]["health"] -= damage!
For implementing it you have a program, call it something like "battle.prg" and make it a thread, what it should do is generate a random number over and over again, and depending on your chance of getting in a battle, it may or may not run the battle() command (that you make)
chance! = Random(1000)
if(chance! <= 50)
{
// Do battle
}
So if chance is 1-50 you get into a battle, but if it's 51-1000 it does nothing
-
Aminaga how do you use your programs give an example of what you just showed?
-
Okay. Hang on one second...
EDIT: Done.
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#battledone!=0
#while(battledone! == 0)
{
#mwincls
character[0]["name"]$ = "bob"
character[0]["health"]! = 100
#Mwin(1 - Fight)
#MWin(2 - Special Moves)
#MWin(3 - Item)
#MWin(4 - Run)
#Wait(a$)
******************************
#if (a$=="1")
{
damage! = character[cnum!]["attack"]! - enemy[enum!]["defense"]!
enemy[enum!]["health"] -= damage!
}
******************************
******************************
#if (a$=="2")
{
More text goes here.
}
******************************
******************************
#if (a$=="3")
{
More text goes here.
}
******************************
******************************
#if (a$=="4")
{
#battledone! = 1
#Send("start.brd", 8, 11, 1)
}
******************************
Please keep in mind all of this is un-tested, and you may have to change some of the stuff.
-
Tough Dragon, are you using RPGToolkit 2 or 3?
-
Tough Dragon, are you using RPGToolkit 2 or 3?
Toolkit 2.
-
Fixed the fight command. It's untested, but I think that should work better than Aminaga's. Wink
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#battledone!=0
#while(battledone! == 0)
{
#mwincls
character0[name]$ = "Bobbert"
character0[health]! = 100
#Mwin(1 - Fight)
#MWin(2 - Special Moves)
#MWin(3 - Item)
#MWin(4 - Run)
#Wait(a$)
******************************
#if (a$=="1")
{
#castlit(cnum!,cnum$)
#castlit(enum!,enum$)
#code$="#damage! = character"+cnum$+"[attack]! - enemy"+enum$+"[defense]!"
#rpgcode(code$)
#code$="#enemy"+enum$+"[health]!=enemy"+enum$+"[health]!-damage!"
#rpgcode(code$)
}
******************************
******************************
#if (a$=="2")
{
More text goes here.
}
******************************
******************************
#if (a$=="3")
{
More text goes here.
}
******************************
******************************
#if (a$=="4")
{
#battledone! = 1
#Send("start.brd", 8, 11, 1)
}
******************************
}
-
but I think that should work better than Aminaga's.
Why thank you, Number Eight. Now, let's see if we can get some more variables into this Battle System we have.
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#battledone!=0
#while(battledone! == 0)
{
#mwincls
#mediaplay("music.mid")
character0[name]$ = "Bobbert"
character0[health]! = 100
character0[attack]! = 25
character0[defense]! = 10
enemy0[name]$ = "Your Mom"
enemy0[health]! = 100
enemy0[attack]! = 25
enemy0[defense]! = 10
specialmove["level"]$ = "fierce"
specialmove["power"]! = 100
#Mwin(1 - Fight)
#MWin(2 - Special Moves)
#MWin(3 - Item)
#MWin(4 - Run)
#Wait(a$)
******************************
#if (a$=="1")
{
#castlit(cnum!,cnum$)
#castlit(enum!,enum$)
#code$="#damage! = character"+cnum$+"[attack]! - enemy"+enum$+"[defense]!"
#rpgcode(code$)
#code$="#enemy"+enum$+"[health]!=enemy"+enum$+"[health]!-damage!"
#rpgcode(code$)
}
******************************
******************************
#if (a$=="2")
{
More text goes here.
}
******************************
******************************
#if (a$=="3")
{
More text goes here.
}
******************************
******************************
#if (a$=="4")
{
#battledone! = 1
#Send("start.brd", 8, 11, 1)
}
******************************
}
Also, I tested the BS, and Number Eight's fight code didn't work.
-
So the battle system should look something like this.
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#battledone!=0
#while(battledone! == 0)
{
#mwincls
#mediaplay("music.mid")
#character1[name]$ = "Bobbert"
#character1[health]! = 100
#character1[attack]! = 25
#character1[defense]! = 10
#enemy1[name]$ = "Your Mom"
#enemy1[health]! = 100
#enemy1[attack]! = 25
#enemy1[defense]! = 100
#specialmove["level"]$ = "fierce"
#specialmove["power"]! = 100
{
#Mwin(1 - Fight)
#MWin(2 - Special Move)
#MWin(3 - Run)
#Wait(a$)
*************************************
#if (a$=="3")
{
#battledone! = 1
#Send("start.brd", 8, 11, 1)
*****************************************
}
#if (a$=="1")
(
damage! = character[cnum!]["attack"]! - enemy[enum!]["defense"]!
enemy[enum!]["health"] -= damage!
{
-
No, no, and no.
-
Why thank you, Number Eight. Now, let's see if we can get some more variables into this Battle System we have.
#Bitmap("testbkg.jpg")
#Put(15, 5, "char.tst005")
#Put(1, 5, "char.tst015")
#battledone!=0
#while(battledone! == 0)
{
#mwincls
#mediaplay("music.mid")
character0[name]$ = "Bobbert"
character0[health]! = 100
character0[attack]! = 25
character0[defense]! = 10
enemy0[name]$ = "Your Mom"
enemy0[health]! = 100
enemy0[attack]! = 25
enemy0[defense]! = 10
specialmove["level"]$ = "fierce"
specialmove["power"]! = 100
#Mwin(1 - Fight)
#MWin(2 - Special Moves)
#MWin(3 - Item)
#MWin(4 - Run)
#Wait(a$)
******************************
#if (a$=="1")
{
#castlit(cnum!,cnum$)
#castlit(enum!,enum$)
#code$="#damage! = character"+cnum$+"[attack]! - enemy"+enum$+"[defense]!"
#rpgcode(code$)
#code$="#enemy"+enum$+"[health]!=enemy"+enum$+"[health]!-damage!"
#rpgcode(code$)
}
******************************
******************************
#if (a$=="2")
{
More text goes here.
}
******************************
******************************
#if (a$=="3")
{
More text goes here.
}
******************************
******************************
#if (a$=="4")
{
#battledone! = 1
#Send("start.brd", 8, 11, 1)
}
******************************
}
Also, I tested the BS, and Number Eight's fight code didn't work.
Make enum! and cnum! equal zero first. Otherwise, it may be something weird with the rpgcode command. That happens. Or maybe I made a mistake, but I don't think I did...