Maximus32

Absolute Genius
Veteran
Joined
Feb 20, 2014
Messages
81
Reaction score
27
First Language
English
Primarily Uses
N/A
Hello.

So, this is sort of a weird problem. Two problems, actually.

FIRST PROBLEM:

I want to create an attack that does damage to another battler, but then self-inflicts an effect upon the user. More generally, I would like to create a move that targets both the opposition and the user with different affects for each target. My current method of doing this is, when an attack is executed, calling on a Common Event to set off a switch that determines that battler's next move as affecting itself. But this spans two turns, not one. Besides, there is probably a much more efficient way to do it with scripting.

SECOND PROBLEM:

I want to create a "consumption" move for enemies that eat each other to regain HP. Implementing it is pretty easy, except that when there is only one enemy left, the enemy eats itself and restores its own HP. I know, counterproductive, right? I realize that you can set attack requirements for each battler (i.e. only use this attack if party contains more than 1 battler), but here's the catch: I need to set TWO requirements for this attack. Specifically, the user needs to be afflicted by a certain status condition AND there needs to be more than one battler in their party in order for this attack to work properly.  Common events sound like they would be a pain for something like this. Any ideas on how to do it with scripts?

I know it's a lot. But I don't necessarily need answers: suggestions of action are helpful as well.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
Use the damage formula to damage the user

like

Code:
a.hp -= self_damage;damage_to_enemy
as for the second one, try Yanfly's Cost Manager so that you can set custom requirements
 

Maximus32

Absolute Genius
Veteran
Joined
Feb 20, 2014
Messages
81
Reaction score
27
First Language
English
Primarily Uses
N/A
Use the damage formula to damage the user

like

a.hp -= self_damage;damage_to_enemyas for the second one, try Yanfly's Cost Manager so that you can set custom requirements
Hrm... Where exactly would I put that line of code? In the comments?

a.hp -= self_damage;damage_to_enemyI'm not too sure.

As for Yanfly's Cost Manager, it worked out great: I added a little script to create a list of live enemies in the Game_Troop class and created a custom cost for the move specifying that it's length had to be greater than 1. Thanks!   :)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
On the damage formula of course...

As for Yanfly's Cost Manager, it worked out great: I added a little script to create a list of live enemies in the Game_Troop class and created a custom cost for the move specifying that it's length had to be greater than 1. Thanks!
nice... :)
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,340
Reaction score
8,077
First Language
German
Primarily Uses
RMMV
Hrm... Where exactly would I put that line of code? In the comments?
No, the line for the damage formula of a skill is editable, just place that line into that part of the skill definition top right.
 

Maximus32

Absolute Genius
Veteran
Joined
Feb 20, 2014
Messages
81
Reaction score
27
First Language
English
Primarily Uses
N/A
Ah, okay, I see! Very nice. Now, is there a way that I could change this so that it inflicts a status ailment upon the user instead? I don't think the damage formula has a parameter for statuses...
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
@Maximus - there is a thread here where you can find lots of examples and discussions on what you can do with the damage formula. You can actually make the damage formula do anything that RGSS3 will allow you to call
 

Maximus32

Absolute Genius
Veteran
Joined
Feb 20, 2014
Messages
81
Reaction score
27
First Language
English
Primarily Uses
N/A
@Maximus - there is a thread here where you can find lots of examples and discussions on what you can do with the damage formula. You can actually make the damage formula do anything that RGSS3 will allow you to call
Okay, so I found a script be Hime Works that allows one to set additional formulae executed on attacks that may use virtually any scripts, like you mentioned. I simply set a new effect that adds a state to the user.

With that, it looks like both of my problems have been solved. Thank you very much Adiktuzmiko, Andar, and Hime Works!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
You can even do that without Hime's script you know... assuming it should only be applied if the skill hits, it can be done via the damage formula itself... now if it's applied even if the skill misses, then yes you'd need Hime's script (or my new one for Skill/Item Apply)
 
Last edited by a moderator:

Maximus32

Absolute Genius
Veteran
Joined
Feb 20, 2014
Messages
81
Reaction score
27
First Language
English
Primarily Uses
N/A
Oh... Well, I guess I DO need to experiment with the damage formula a little more before I start jumping into scripts I don't understand...

However, using Hime's script is quite easy. When I type the code:

a.add_state(7)It works fine. But when I paste this into the damage formula,, nothing happens in the battle...

I think I'll go and find some topics on using the damage formula on the forum.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
Eh? that's weird... I use that quite a number of times and it works fine...
 

Maximus32

Absolute Genius
Veteran
Joined
Feb 20, 2014
Messages
81
Reaction score
27
First Language
English
Primarily Uses
N/A
Ah, interesting. You are totally right: I looked up a tutorial on the damage formula and managed to place a lot of my effects into the formula using proper notation and semicolons. For example, the a.add_state(7) worked fine. I must not have been doing it correctly before.

In which case, Hime's script is not the only way to customize enemy attacks. Thanks!
 

Latest Threads

Latest Profile Posts

Kind of relieved that I had medibang installed when I need to edit Sprite I was about to download gimp but I remember I had medibang installed lol
Voting for the first round of the Map Madness Tournament is now live! Vote for your favorite in each matchup!

Finally started working on Grim Trigger episode 2 today :LZScat: it's half comic/half visual novel!

GfY3Rwj.png
Is it interesting to get more backstory on villains? A key moment in their past, their childhood, or maybe something that shows they've always been that way? To see or not to see?
"Everything tastes like chicken until it's chicken, then it doesn't taste like chicken."
Context: chicken samosas do not taste like chicken. I thought it was veggie samosas.
Just another ordinary evening.

Forum statistics

Threads
110,366
Messages
1,052,630
Members
143,398
Latest member
Rintosi
Top