A character that does no damage to a specific monster

cbmarcilio

Star Carrier
Member
Joined
May 10, 2017
Messages
15
Reaction score
2
First Language
Português PT-BR
Primarily Uses
RMMV
(so ok, because i'm poor i just buyed rpg maker vx ace in last Steam Winter Sale, now i'm working in my game and i need help in a specific part) Is there any way to make a party member do no damage to a specific monster?

For example, there are boars, bats, rats and slimes, the protagonist manages to deal damage to all of them normally, but one of the allies can not deal damage in slimes.

Is there any way for me to do this? Even if it is by script or something else
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA

I've moved this thread to RPGMaker ACE. Please be sure to post your threads in the correct forum next time. Thank you.


Where you posted it is for sharing resources for the engine that you've made with others.

The feature you ask for might require a script, but I'll put it here for now as it might be doable without a script.
 

cbmarcilio

Star Carrier
Member
Joined
May 10, 2017
Messages
15
Reaction score
2
First Language
Português PT-BR
Primarily Uses
RMMV
[move]RPGMaker ACE[/move]
Where you posted it is for sharing resources for the engine that you've made with others.

The feature you ask for might require a script, but I'll put it here for now as it might be doable without a script.
oh, ok, thanks
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
It might be doable without a script, but that depends on details you didn't give in your question.

You need to keep in mind the sequence how the engine works.

Actors use skills, and skills damage enemies.

It is relatively easy to make skills that don't damage specific enemies - can be done with elemental rate or with if-conditions in the damage formula or a few other ways.
But those skills are isolated and below the actor selection level - it won't be the actor but the skill that does no damage.

So if you can give that specific actor that should not damage a specific type of enemy its own skills, then this is easy.
If the actor has to be able to use the same skills as the other actors, and those other actors could use the skills to do damage, then you'll be better searching for or requesting a plugin, especially if there are a lot of those conditions in your project.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
If the OP wants his/her actor to be able to use the same skill as the other actors shouldn't something like this in the damage formula work?
Code:
r = your_damage_formula_goes_here; (a == $game_actors[id]) ? r*b.element_rate(n) : r
In this case n is the element rate for slimes which should be 0 if the actor should deal no damage at all, but it can be something different if the damage should be altered in another way.

Of course this must be included in EVERY shared skill and is VERY tedious but it allows the OP to achieve what he wants without having to look for a script.

@cbmarcilio be aware of the fact that since in VX Ace (unlike in MV) your damage formula box only allows a very limited ammount of characters. That said if you need a lot of conditions and/or you want to use that condition in a skill which already has a very long damage formula you won't be able to do it and you need a script. A fast way to overcome this is to use something like this:
Code:
module CSM # Custom Skill Multiplier
    def self.slime_mult(formula, a, b)
        if (character == $game_actors[id]) #change id with the id of the actor which should not be able to damage slimes
            formula * b.element_rate(n) #change n with the element rate you are going to use for slimes (slimes should have element_rate(n) = 0)
        else
            formula
        end
    end
end
Copy/paste it in your project then set your skill formulae to be like this:
Code:
r = your_skill_formula_goes_here; CSM.slime_mult(r, a, b)
This is no way less tedious than te previous method but it allows you to use it for skills with long damage formulae. If you want to spare few characters in your damage formula box you can even do something like this:
Code:
CSM.slime_mult((your_formula_goes_here), a, b)
While the 1st method will work for sure I am not sure I made no mistake in this code. It should work but you have to test it out.

If what you need is more complicated than this and/or you don't want to spend too much time setting up your skills then you shuld follow Andar's advice and ask for a script. I hope this helps :)

EDIT:
@cbmarcilio the code below can be edited to let it work in other situations as well. Of course you have to give us detailed informations if you want something different. That code is supposed to work for your example but not for everything.
 

cbmarcilio

Star Carrier
Member
Joined
May 10, 2017
Messages
15
Reaction score
2
First Language
Português PT-BR
Primarily Uses
RMMV
If the OP wants his/her actor to be able to use the same skill as the other actors shouldn't something like this in the damage formula work?
Code:
r = your_damage_formula_goes_here; (a == $game_actors[id]) ? r*b.element_rate(n) : r
In this case n is the element rate for slimes which should be 0 if the actor should deal no damage at all, but it can be something different if the damage should be altered in another way.

Of course this must be included in EVERY shared skill and is VERY tedious but it allows the OP to achieve what he wants without having to look for a script.

@cbmarcilio be aware of the fact that since in VX Ace (unlike in MV) your damage formula box only allows a very limited ammount of characters. That said if you need a lot of conditions and/or you want to use that condition in a skill which already has a very long damage formula you won't be able to do it and you need a script. A fast way to overcome this is to use something like this:
Code:
module CSM # Custom Skill Multiplier
    def self.slime_mult(formula, a, b)
        if (character == $game_actors[id]) #change id with the id of the actor which should not be able to damage slimes
            formula * b.element_rate(n) #change n with the element rate you are going to use for slimes (slimes should have element_rate(n) = 0)
        else
            formula
        end
    end
end
Copy/paste it in your project then set your skill formulae to be like this:
Code:
r = your_skill_formula_goes_here; CSM.slime_mult(r, a, b)
This is no way less tedious than te previous method but it allows you to use it for skills with long damage formulae. If you want to spare few characters in your damage formula box you can even do something like this:
Code:
CSM.slime_mult((your_formula_goes_here), a, b)
While the 1st method will work for sure I am not sure I made no mistake in this code. It should work but you have to test it out.

If what you need is more complicated than this and/or you don't want to spend too much time setting up your skills then you shuld follow Andar's advice and ask for a script. I hope this helps :)

EDIT:
@cbmarcilio the code below can be edited to let it work in other situations as well. Of course you have to give us detailed informations if you want something different. That code is supposed to work for your example but not for everything.
First of all i just wanted to say thanks for trying to help me, like, really thanks, but continuing, now i have a couple of questions because i really didn't understand some stuff.

First of all, i used that first damage formula and simple, all characters can't do damage in all enemies, explaining better my request, in the begining of the game, there will be two characters in the party, the protagonist and the ally, the protagonist can deal damage to the slimes but the ally can't
i put some prints in the imgur if you want to see it

(and i really didn't understand too well the stuff of "(a == $game_actors[id]) ? r*b.element_rate(n)", i'm really new in rpg maker)
 

cbmarcilio

Star Carrier
Member
Joined
May 10, 2017
Messages
15
Reaction score
2
First Language
Português PT-BR
Primarily Uses
RMMV
Oh, no need to answer, I found a way, but still thank you for helping me, really <3
(one of yanfly scripts do exactly what i needed)
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
I am happy you found a solution to your problem. Anyway, if you are interested in how it works you can press F1 in your editor and read something about ruby syntax. You will find your answer there. However it was tested so I am quite sure you didn't set it up properly because in my fresh game it worked perfectly.

However, I am glad Yanfly has the script you need =)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,231
Members
137,607
Latest member
Maddo
Top