Jump to content
kal

Ruby/RGSS3 questions that don't deserve their own thread

Recommended Posts

OK... so, I have a skill that deals damage to all enemies. That part works fine for obvious reasons. I also want this same skill to then execute some healing on all living party members. Creating a common event within the skill to execute the healing skill afterwards is causing the enemies to actually be healed, rather than damaged! LOL.

 

Is there any possible way to use custom damage formula to execute this healing after the damage is dealt? I have tried using $game_party.battle_members[0].hp += 80, for example, and so on for the other battle members, but it actually doesn't count it as "executing damage" so no actual healing pops up, but it DOES restore the HP. The bad part? The skill returns damage of 0 on the enemies, for whatever reason. My guess is that the damage of the first skill is not being processed, because of being somehow overwritten by the skill caused by the common event. There must be a way around this, though.

Share this post


Link to post
Share on other sites

That would work for a flat HP heal, but when it's based on a damage formula (like mine), that won't fly. :(

 

Perhaps there's just a snippet I could add that ensures abilities with common events process the ability first, and the common event afterwards?

Share this post


Link to post
Share on other sites

@WCouillard

Ok, so i think i kinda got it how you wanted it, but i did it in RPGmaker MV, but i think i know what you need to change for it to work in VX/ace:
You need two skills, one variable, and one common event. 

The first skill is the multi damage skill like this: 

(open spoiler to see image)

Spoiler

image.thumb.png.1c454f5234e534a23acd723723b2f62e.png

 

 

The important part is in the formula: since i use MV, it looks like this: $gameVariables.setValue(1,a.actorId()); a.agi

Here the $gameVariables.setValue(1,a.actorId()); is a piece of code to set variable 1 to the value of the actor ID, and the a.agi is the actual formula for damage calculation, which can be whatever.

If you want to use this in VX/ace you have to change:  $gameVariables.setValue(1,a.actorId()); into: $game_variables[1] = a.id; and still add the formula after like this:

$game_variables[1] = a.id; a.agi

In the effect you add the common event you want to use to call the healing of the party. Remember to set the scope to all enemies.

 

for the next part, we make the mass healing spell:

(open spoiler to see image)

Spoiler

image.thumb.png.9386f9370c05221f78123173ec6ca033.png

 

Here there are no special stuff, just make the scope all allies, and make sure the formula is whatever you want it to be, i use the same for healing and damage.

Keep in mind that this is where i might differ from your vision, as this will not heal the exact damage done, but rather heal using the same formula used for the damage(unless you want it different)

 

The last part of this skill(s) is the common event:

(open spoiler for image)

 

Spoiler

image.thumb.png.d44b12952e4af3e702bef4f28245694c.png

 

Here i have one conditional branch for each actor you have in your database (disregard the first one that is 0, that was just a test), i have 4 actors: harold, Therese, Marsha and Lucius, you might have more or less.

For each branch, check the number of the variable you chose in the first skill, and just match it with the actor using the force action-> use skill.

 

This is done so that the healing spell is used by the same character that used the damage spell, so that the numbers are calculated using the correct stats.

 

This was written pretty fast, so if there is something you dont understand let me know :) Also if i completely missed the mark i'm up for trying different methods.

 

 

Edited by lazyV

Share this post


Link to post
Share on other sites

Doesn't look like it. There are no properties to change anything about the shadow. You could probobly cheat and make a fake shadow by drawing the text twice at slightly different locations if you needed to though.

 

Note: The shadow effect is actually fairly subtle and you might actually want to change the outline instead.

Edited by Kayzee

Share this post


Link to post
Share on other sites

Hello!
Question: Is there any way to check if a ruby method is running? Something akin to, "method.is_running?"

 

I have a script that affects event # 1's move route, but event # 1's move route is being controlled by a separate event, event # 2. Because of this, the script doesn't take priority and event #1 will only carry out event #2's commands. This doesn't happen if event #1 is controlling its own move route, but for reasons I can't do that.

So I want to check if the script is running so I can disable event #2.

Edited by Zen Blood
clarify

Share this post


Link to post
Share on other sites

Uhhh... It doesn't really work like that. Scripts and events don't really run in the background. Events use fibers, but that's more a way to 'pause' some code and 'unpause' it later. I think you can create threads but... threads are stupidly complicated and not really too useful for VX Ace so just forget I said anything about them. Really.

 

You could make the script set a variable somewhere to tell event #2 it ran this frame, and reset the variable on frames it doesn't run. Though if the script runs every frame that would be pretty pointless.

Share this post


Link to post
Share on other sites

Thank you, @Kayzee, not only for explaining that to me but for your speedy response too!

 

I did end up finding a work around by temporarily deactivating the event page the script is called in and reactivating it after event #2 started executing its commands. Since it was activated last, it now it takes priority! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×