First Aid skill usable only once after one battle?

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
The title of the thread is almost self-explanatory: in a world where the practice of magic is forbidden, the player is not allowed to use Heal skills so I was thinking of a First Aid skill instead. Question is: how to implement such a thing?

Obviously, this skill shouldn't be usable in battle, but Only from the Menu – this part is done.

In order to avoid the player uses this skill several times in a row and heal completely a wounded character at no cost, I'd like to make this skill usable only once after a battle – like a physician or a nurse would partially heal wounds to stop bleeding for example... In other words: this skill could be used only after a battle where at least one member of the party was wounded.

Thoughts?

(Otherwise, I already envisaged to provide some bandages and cataplasms to the party but these items cannot come infinitely either...)
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
You could have two versions of the skill that are identical, except one is usable (and runs a common event), the other is not. At the end of each turn in battle, check whether an actor has taken damage, and if yes, forget the unusuable First Aid and add the usable.

In the common event, forget the usable one, learn the unusable again.

That's how I would do it. It's a little bit of work adding the "End Turn" common event to each enemy troop, but once you have set it up, I'm sure you can find additional uses for it. :) For example, an accessory that does something at the end of each turn. So, what I mean is, it could be very useful to set this stuff up, not only for First Aid.
 
  • Like
Reactions: Gui

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Turn a switch ON at the beginning of every battle (using a Common Event or by scripting it into the existing Start-of-Battle methods).  If you don't know how to do this, I could show you how.

Give your First Aid Skill a formula like "if $game_switches[39]; heal = (formula); $game_switches[39] = false; else; heal = 0; end; heal" - it will only heal if the skill hasn't already been used since you were last in battle.  OR, script changes into the "Is the skill/item usable?" method to enable/disable the skill based on the switch.
 
  • Like
Reactions: Gui

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The problem with only wanting it to be available if someone has suffered damage is that end of battle is detected and battle exits prior to running any turn-based event pages. So if none of your characters are injured except on the very last turn, the switch won't be on. If you turn it on at the start of battle and none of your characters are injured, the skill will be available when there's no need for it to be.

Using a common event attached to the skill, which is always available (via the menu only), that does something like this:

Conditional Branch: Script: $game_party.members.any? {|actor| actor.hp < actor.mhp} ... do healing stuff ...Else Show Text: Nobody needs to be healedBranch Endmight suffice. No need for switches or for checking what's going on during battle.The above would check ALL party members, in the event you want it to heal everyone. If you want to target a specific actor and only heal that one person, the above would have to change a little (it'd be $game_party.menu_actor or something like that - I don't have Ace in front of me so can't check, but someone asked very recently in the Ruby/RGSS Questions That Don't Deserve Their Own Thread topic how to identify which party member an item [or skill] was used on).
 
  • Like
Reactions: Gui

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
Thanks everyone for the input, much appreciated  :)

[...]

Using a common event attached to the skill, which is always available (via the menu only), that does something like this:

Conditional Branch: Script: $game_party.members.any? {|actor| actor.hp < actor.mhp} ... do healing stuff ...Else Show Text: Nobody needs to be healedBranch Endmight suffice. No need for switches or for checking what's going on during battle.

[...]
Sorry for the ultra-noob question but how am I supposed to attach a common event to a skill?

I could find the Common Events tab in the database, but what after that? Something to do with inserting a Change Skills command from the Actor tab of the Event Commands list, or not? And where do I have to insert the Conditional Branch you provided?

Thanks in advance for any additional input: I'm completely lost here...
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Sorry for the ultra-noob question but how am I supposed to attach a common event to a skill?
It's one of the "Effects" you can add to the skill (middle, right-hand side of the Skills tab).
 
  • Like
Reactions: Gui

captainproton

Dangerously Nifty
Veteran
Joined
Dec 20, 2013
Messages
1,276
Reaction score
570
First Language
english
Primarily Uses
Wouldn't healing items be simpler? They're nonmagical, disposable, and can be set to be From Menu only.
 

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
I already did that, through bandages and cataplasms, but I'd like to provide an additional skill aswell, for when there isn't any of these items available any more: in fact, the party will soon have to cross a desert filled with various beasts and creatures which don't possess any items, obviously, and where there isn't any shops to buy some from, so I want to give them a possibility to get to the other side of the area in as less pieces as possible...  :)

It's one of the "Effects" you can add to the skill (middle, right-hand side of the Skills tab).
Alright, thanks for the info. However, some things remain a bit blurry... I mean, once I've named my Common Event, I right-click in the Contents field and choose Event Commands -> Conditional Branch, then on the fourth tab I check the Script box, paste the "$game_party.members.any? {|actor| actor.hp < actor.mhp}" part of the code in the field and press OK. But what should I put in the first line of the branch, the one corresponding to "... do healing stuff ..."? Is this a Change HP command for the entire party to retrieve some health, or Change Skills event for the PC to get the First Aid skill, or anything else?

Sorry again for another noob question but anything related to coding always sounds like chinese to me... :o
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
I just wanted to point out that if you are going with Shaz' solution, the skill will always be available (that is: clickable), but will only do something if the conditions are met. I'm not sure if you want that. I, personally, like skills to be greyed out when they are not usable, and as far as I know you can only achieve that with an additional script (that lets you set the skill usage conditions) or with two identical-looking skills, one usable, one not, that you exchange in the right situation.
 

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
Well, frankly, it is a bit the same thing to me, for I use RPG Maker since a few month only and almost everything which is not part of the default basic features looks like voodoo to me; I mean, I've read again your very first post in this topic and I have to say that I didn't get a thing from it – so unless you care to explain in details, whose I'll perfectly understand you do not have the time and/or energy to do, I'll stick with Shaz' solution which is something I can copy/paste into my project without having to wonder too much...

Otherwise, no, it isn't a real issue to have the skill available all the time, as long as a message is displayed after each combat to inform the player that he/she can't use the skill because no one is wounded – I mean, it is the lesser evil. As for requesting a custom script: not only it may be a lot of work from someone who doesn't owe me a thing, but it could also make incompatibilities with some other ones that I really need, and all that for a rather secondary feature, so if I can avoid it, I'll prefer to do so.

But in the worst case scenario, I can stick with bandages and cataplasms, so it is not a big issue to begin with: don't worry then  :)
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
1. Create the skill "First Aid" twice. Let's call it "First Aid (1)" and "First Aid (2)" for the time being.

2. Name an empty common event "First Aid used".

2. "First Aid (1)" has all the features you want. Only usable from the menu, restores HP. It also calls "First Aid used" (in the Features list, last tab).

3. "First Aid (2)" should be set to never be usable. It's therefore always greyed out in the menu.

4. Now the common event. Put two commands here: a) The actor who can use "First Aid (1)" forgets "First Aid (1)", and B) said actor learns "First Aid (2)".

5. Have a second common event "Enable First Aid" which does the opposite.

Now you need to figure out where to put "Enable First Aid". My suggestion would be to enable it via your enemy troops. In all of them, you'd need an event page with "At the end of the turn" that checks whether your actor has taken damage. Set variables to the actor's HP and max HP and subtraction the HP from the max HP. Then use a Conditional Branch. If the variable is 1 or higher, call "Enable First Aid".

That's the basic way of doing it. It is much simpler if you have visual encounters, so sprites on the map that trigger the battle, then you can put the stuff from the troops event in there after the battle.

There is one problem, however: RPG Maker VX Ace doesn't run any battle events once all enemies are defeated. That means if you take damage in the same turn you defeat the last enemy, your "Enable First Aid" won't be triggered. So if you have random encounters, you'll need a script to make the engine check for battle events to run even at battle end. :/

Well, I hope you at least got the general idea. Maybe you can do something with it. :) Feel free to ask if you have more questions.

EDIT: Oh, right, and at the end, remove the "(1)" and "(2)" from the skills' names, of course! We only put them there to make referring to them easier.
 
Last edited by a moderator:
  • Like
Reactions: Gui

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top