No damage dealt if unarmed.

ReiDaCocada

Just another NPC.
Member
Joined
Jun 15, 2012
Messages
3
Reaction score
0
First Language
Portuguese-BR
Primarily Uses
Hi everyone, I need a script that make any unarmed character deal 0 Damage to an enemy, like in the RPGXP, but, as my project have multiple Classes, I want to make only class x  be able to deal damage if unarmed, like a bare hand-fighter.

So, my request is:
1º Make characters with no weapon equipped deal 0 Damage.
2º Make only Class X be able to deal damage unarmed.

That's all. Any help will be appreciated.  :)  
(Sorry for my bad English ;-; )
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You can do this without a script.


In your attack skill, put this:

a.weapons.empty? && a.class_id != # ? 0 : a.atk * 4 - b.def * 2but where I put # in the formula, you put the class id (no leading zeros) of the class you want to be able to deal damage without a weapon equipped.
So that says, if the actor has no weapons and they are not in the "special" class, damage is 0, otherwise use the regular formula.


So if your class that can deal damage without having a weapon equipped is class 7, you'd put this:

Code:
a.weapons.empty? && a.class_id != 7 ? 0 : a.atk * 4 - b.def * 2
 
Last edited by a moderator:

ReiDaCocada

Just another NPC.
Member
Joined
Jun 15, 2012
Messages
3
Reaction score
0
First Language
Portuguese-BR
Primarily Uses
You can do this without a script.

In your attack skill, put this:

a.weapons.empty? && a.class_id != # ? 0 : a.atk * 4 - b.def * 2but where I put # in the formula, you put the class id (no leading zeros) of the class you want to be able to deal damage without a weapon equipped.So that says, if the actor has no weapons and they are not in the "special" class, damage is 0, otherwise use the regular formula.

So if your class that can deal damage without having a weapon equipped is class 7, you'd put this:

a.weapons.empty? && a.class_id != 7 ? 0 : a.atk * 4 - b.def * 2
Thanks for the reply, it really worked, but now, whenever an enemy attack, he deal 0 damage, even if I put 999 ATK points for them. X_X
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
ah, yeah - forgot enemies use the same skill

Code:
a.actor? && a.weapons.empty? && a.class_id != # ? 0 : a.atk * 4 - b.def * 2
hopefully that'll all fit in the available space
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
If you're lazy to do that to ALL of your skills, then this should do

class RPG::UsableItem::Damage alias no_damage_eval eval def eval(a, b, v) return 0 if a.actor? && a.class_id != 7 && a.weapons.empty? return no_damage_eval(a,b,v) endendNote: Untested
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I assumed it was only the attack skill, since the rest are actually skills, used from the Skill menu. Didn't even consider that it referred to all of them. If that's the case then, yeah, a script to do it would be better.
 

ReiDaCocada

Just another NPC.
Member
Joined
Jun 15, 2012
Messages
3
Reaction score
0
First Language
Portuguese-BR
Primarily Uses
ah, yeah - forgot enemies use the same skill

a.actor? && a.weapons.empty? && a.class_id != # ? 0 : a.atk * 4 - b.def * 2hopefully that'll all fit in the available space
Thank you very much, it worked like I wanted :D  

If you're lazy to do that to ALL of your skills, then this should do

class RPG::UsableItem::Damage alias no_damage_eval eval def eval(a, b, v) return 0 if a.actor? && a.class_id != 7 && a.weapons.empty? return no_damage_eval(a,b,v) endendNote: Untested
It worked too like the formula provided by Shaz, but this script affect enemies too, they only deal 0 Damage x-x

But I think I will not need the formula to work on Skills, so, thanks for both of you  :)  

EDIT: Sorry TheoAllen, the script worked to, I  configured wrong the Database, so, sorry and thanks again for both :D
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top