Battle System Programmer Needed!!!

Ideas and games that are not yet publicly in production. This forum also contains the pre-2012 archives of the Works in Progress forum.
Message
Author
Thaius
Regular
Posts: 44
Joined: Mon Feb 02, 2009 6:52 pm
Contact:

Re: Battle System Programmer Needed!!!

#16 Post by Thaius »

Okay, I inserted it and it worked great: did 10 more damage and everything. Thank you. But something else was still wrong. Of course, lol.

Looking at the battlesetup and comparing it with the rest of the code, I assumed that the numbers shown after each keyword (or whatever you call those) were the amount of whatever they represented. In-game, both you and your enemy have 100 HP, and the math plays out between attack and defense. But using grenades never depleted the amount of grenades I had: they were infinite. After some experimentation (I'm a noob, I know), I figured out to make this.

Code: Select all

      "Grenade %(grenade)s" if grenade > 0:
        $ grenNumber = playerATK - enemyDEF + 10
        "You throw grenade for %(grenNumber)s damage!"
        $ enemyHP -= grenNumber
        $ grenade -= 1
The %(grenade)s in the first line makes it so the number of grenades you have are shown in the menu, and the last line takes away one grenade each time one is used. Once there are no more grenades, the button disappears and all that is in the item menu is "Potion."

I feel proud of myself right now, lol.

Anywho, now I get how it works a bit better. Can I count on your help developing a magic system, as well as the rest of the battle system? I have some pretty cool ideas, and I'm starting to see how it's possible. Interested?
~ If logic is nothing more than believing in fact, are we truly thinking logically or just blindly believing what seems to be true?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Battle System Programmer Needed!!!

#17 Post by JQuartz »

Okay
Thaius wrote:Can I count on your help developing a magic system, as well as the rest of the battle system? I have some pretty cool ideas, and I'm starting to see how it's possible. Interested?
I'm interested, I guess. Do you have a timeline when you need this game/project to be finished?
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Thaius
Regular
Posts: 44
Joined: Mon Feb 02, 2009 6:52 pm
Contact:

Re: Battle System Programmer Needed!!!

#18 Post by Thaius »

The end of the semester, basically. And really, I don't need a full game by then: just a working demo, pretty much. Of course, I'm really starting to enjoy this, and I think my friend and I developed a great story, so the project will probably continue on to become a full game, but at that point there won't be any pressure. The time limit basically just dictates that I have a working demo, so by the end of the semester I'll need to have the basic components. It shouldn't be too difficult. In fact, I'm already kind of figuring out how the magic works.

This is what I did to add a magic magic system. I've tested it, and it works. I suppose one could conceivably add status effects and elemental weaknesses and such. Here's what I've got. Of course any declaration under "init:" are not used, but whatever.

Code: Select all

init:
    $ m = Character('Me', color="#c8c8ff")
    
label start:
    
label battleSetup:
  $ enemyHP = 100
  $ playerHP = 100
  $ enemyATK = 20
  $ enemyDEF = 5
  $ playerATK = 20
  $ playerDEF = 7
  $ playerMP = 50
  $ enemyMP = 50
  $ playerMAG = 30
  $ enemyMAG = 30
  $ playerMAGDEF = 5
  $ enemyMAGDEF = 5
  $ fire = 5
  $ potion = 10
  $ grenade = 3


label battleLoop:
  menu:
    "What will you do? HP:%(playerHP)s/MP:%(playerMP)s ------ Enemy HP: %(enemyHP)s"

    "ATTACK":
      "You attack"
      
      $ tempNumber = playerATK - enemyDEF 
      "You do %(tempNumber)s damage!"
      $ enemyHP -= tempNumber
      
    "Magic":
      menu:
        "Fire - 5":
         $ fireATK = playerMAG - enemyMAGDEF
         "You attack with fire for %(fireATK)s damage!"
         $ enemyHP -= fireATK
         $ playerMP -= 5
        "Thunder - 5":
         $ thunderATK = playerMAG - enemyMAGDEF
         "You attack with thunder for %(thunderATK)s damage!"
         $ enemyHP -= thunderATK
         $ playerMP -= 5
        
      
    "Use item":
      menu:
       "Potion %(potion)s" if potion > 0:
        "You heal 50 hp!"
        $ playerHP += 50 
        $ potion -= 1
       "Grenade %(grenade)s" if grenade > 0:
        $ grenATK = playerATK - enemyDEF + 10
        "You throw grenade for %(grenATK)s damage!"
        $ enemyHP -= grenATK
        $ grenade -= 1

  if enemyHP < 1:
    "You win!"
    jump endBattle

  "You take damage!"

  $ tempNumber = enemyATK - playerDEF

  "Hit for %(tempNumber)s damage!"
  $ playerHP -= tempNumber

  if playerHP < 1:
    jump loseBattle
  jump battleLoop
label endBattle:
  "You rock!"

  return

label loseBattle:
  "You're defeated!" 
  return
I also added some more displays, such as MP and enemy HP. As of right now, there's nothing to stop magic from being used after MP reaches zero, but that's actually part of a plan I have yet to implement. First I have to figure out how, lol. If you want to help, I'll welcome it, and I won't take up too much of your time. I also understand if you don't want to: it's fine.
~ If logic is nothing more than believing in fact, are we truly thinking logically or just blindly believing what seems to be true?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Battle System Programmer Needed!!!

#19 Post by JQuartz »

When is your semester going to end? Based on my experience with course work, the final week before passing up the project is the one most work is done so I don't want to that week to clash with any of my plans. Anyway here the way to prevent the player from using magic if there's not enough mp:

Code: Select all

"Magic":
      menu:
        "Fire - 5":
         if playerMP>=5:
             $ fireATK = playerMAG - enemyMAGDEF
             "You attack with fire for %(fireATK)s damage!"
             $ enemyHP -= fireATK
             $ playerMP -= 5
         elif playerMP<=4:
             "You don't have enough mp."
             jump battleLoop
        "Thunder - 5":
         if playerMP>=5:
             $ thunderATK = playerMAG - enemyMAGDEF
             "You attack with thunder for %(thunderATK)s damage!"
             $ enemyHP -= thunderATK
             $ playerMP -= 5
         elif playerMP<=4:
             "You don't have enough mp."
             jump battleLoop
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Thaius
Regular
Posts: 44
Joined: Mon Feb 02, 2009 6:52 pm
Contact:

Re: Battle System Programmer Needed!!!

#20 Post by Thaius »

The last day of school for me is April 24th. Quite early, compared to all the schools I know of.

Thanks for the MP limit.
~ If logic is nothing more than believing in fact, are we truly thinking logically or just blindly believing what seems to be true?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Battle System Programmer Needed!!!

#21 Post by JQuartz »

Thaius wrote:The last day of school for me is April 24th.
It's April 24th of this year, right? If the game needs to be finished within 2 month (and a few days), I'll be your programmer (I prefer the word coder though because programmer just seems to me to be a bit too experienced in making software....). So what do you need to be done?
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Thaius
Regular
Posts: 44
Joined: Mon Feb 02, 2009 6:52 pm
Contact:

Re: Battle System Programmer Needed!!!

#22 Post by Thaius »

Yes, this year. Thank you: your help is much appreciated.

I'll PM you with the details.
~ If logic is nothing more than believing in fact, are we truly thinking logically or just blindly believing what seems to be true?

wulfsaga
Regular
Posts: 29
Joined: Thu Feb 05, 2009 9:40 am
Contact:

Re: Battle System Programmer Needed!!!

#23 Post by wulfsaga »

whew this realy useful thread! :mrgreen: :mrgreen:
i wonder is there any more tutorial on RPG system for renpy?
Image

Thaius
Regular
Posts: 44
Joined: Mon Feb 02, 2009 6:52 pm
Contact:

Re: Battle System Programmer Needed!!!

#24 Post by Thaius »

I haven't found anything. That's why I turned to the threads: there aren't any official documents about making battle systems. It's cool how much you can do, though.
~ If logic is nothing more than believing in fact, are we truly thinking logically or just blindly believing what seems to be true?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Battle System Programmer Needed!!!

#25 Post by JQuartz »

(To Thaius):And what do I you want me to do first? Or when do you want me to start work?
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Post Reply

Who is online

Users browsing this forum: No registered users