Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

HP to SP convertion system

Hello there!
I would like to ask for some help in a HP->SP skill convertion system...
The plan is as the following:

  • the ground state for each character would be maximum HP and zero for SP (MP).
  • each actor/monster would have a new parameter, that could be called "convertion rate" for example.
  • that new parameter would (could) be a 3 decimal float ranging from 0.000 to 1.000.
  • upon using a skill named "focus" (again, just an example), the character would self inflict HP damage.
  • the damage times the convertion rate of the user would be the SP gain converted from the HP loss.

I thought of making a new element name called "focus" and make skills with diferent power for more or less convertion, and having the parameters read from an .rgss file. Would that do?
A help for the scripting would be just great!

This would be the main part of the system and for later I was thinking of adding stuff like
  • display of the new parameter in the status menu
  • having this parameter altered by itens and other skills
  • walking on map would slowly decrease SP
  • HP as a "main parameter" would influence on attack power
  • maybe other stuff...

And I would really appreciate if anyone would help me out here in the start!!!
thanks!
 
this is REALLY confusing me, but i think i can help:

under Game_Actor, locate the definitions of each stat, under SP, start a new line, then insert this:

#--------------------------------------------------------------------------
# ● Base Conversion Rate
#--------------------------------------------------------------------------
def base_convrate
return $data_actors[@actor_id].parameters[1, @level] / 1000.000
end
this will create your parameter: conversion rate, by making conv. rate = whatever you type after RETURN. Keep in mind that SP itself does not have to equal what you put in the database, merely find base_maxsp and under RETURN replace it with something.

So, in other words, when your editing SP in the database, it isn't even effecting maxsp, but convrate!

now, i want you to find base_maxsp, and after return, edit it to say be
return $data_actors[@actor_id].parameters[0, @level] * base_convrate

so it should look like this:
#--------------------------------------------------------------------------
# ● Max SP
#--------------------------------------------------------------------------
def base_maxsp
return 0 + $data_actors[@actor_id].parameters[0, @level] * base_convrate
end

alright, now all you do, is when you want the player to gain SP, is have the skill add 1-1000, and it should work

edit: damn...just figured out there is no skill option for gaining SP.
alas, i have brain freeze on this one!

well, like i said, im not too good at scripting, but that line of code for convrate, keep. and leave return at 0 for now.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top