Hi everybody,
Sorry if this has been asked already; I tried different search inputs, yet couldn't find anything, but I'm not sure those search inputs would be the right ones if such a thread did already exist...
Anyway, I'm trying to set a "sacrifice" skill, which would deal damages to a predefined ally (always the same character) in order to deal damages to an enemy. I just don't find anyway to get that done.
I'm using a lot of Yanfly's plugins, especially those, whom I think would be pertinent to this request:
Battle Engine Core http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
Action Sequence Pack 1 http://yanfly.moe/2015/10/11/yep-4-action-sequence-pack-1/
Action Sequence Pack 2 http://yanfly.moe/2015/10/12/yep-5-action-sequence-pack-2/
Action Sequence Pack 3 http://yanfly.moe/2015/10/12/yep-6-action-sequence-pack-3/
And Target Core http://yanfly.moe/2016/02/26/yep-74-target-core/
Do you think it is possible, and if so, how?
Thank you very much!
Sacrifice skill: hurt an ally in order to attack an enemy
● ARCHIVED · READ-ONLY
-
-
Hi everybody,
Sorry if this has been asked already; I tried different search inputs, yet couldn't find anything, but I'm not sure those search inputs would be the right ones if such a thread did already exist...
Anyway, I'm trying to set a "sacrifice" skill, which would deal damages to a predefined ally (always the same character) in order to deal damages to an enemy. I just don't find anyway to get that done.
I'm using a lot of Yanfly's plugins, especially those, whom I think would be pertinent to this request:
Battle Engine Core http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
Action Sequence Pack 1 http://yanfly.moe/2015/10/11/yep-4-action-sequence-pack-1/
Action Sequence Pack 2 http://yanfly.moe/2015/10/12/yep-5-action-sequence-pack-2/
Action Sequence Pack 3 http://yanfly.moe/2015/10/12/yep-6-action-sequence-pack-3/
And Target Core http://yanfly.moe/2016/02/26/yep-74-target-core/
Do you think it is possible, and if so, how?
Thank you very much!
<Custom Target Eval>
for (var i = 0; i < friends.aliveMembers().length; ++i) {
var member = friends.aliveMembers();
if (member._actorId != user._actorId) {targets.push(member);targets.push(b);break;}
}
</Custom Target Eval>
just put this in skill notetag -
Thanks @Isabella Ava ,
Tried it; got this error message when testing in "test" or gameplay battle:
I got this error message in the console; I don't understand what it means, so I don't know if it is related:
I just copied-pasted what you gave me in the skill notebox; do I have to change something? Moreover, don't I need to identify the ally that will suffer the damages in the script?
Edit: Inserted the images correctly. -
Oh somehow i mistyped it
Code:<Custom Target Eval> for (var i = 0; i < friends.aliveMembers().length; ++i) { var member = friends.aliveMembers()[i]; if (member._actorId != user._actorId) {targets.push(member);targets.push(b);break;} } </Custom Target Eval> -
Hey, thanks again @Isabella Ava ,
Now the game works properly. Maybe I wasn't clear enough when I explained what I wanted though; the skill now attacks a selected enemy, and another random one. What I would like is for the skill to attack an enemy while dealing some damage to an ally, always the same... (Three female dark elves and a male; the priestess deals damages to an enemy with her sacrifice skill by dealing damages to the male member of her group... Yup, drow priestesses can be very mean to their male counterpart!)
Do you think this is possible? -
Hey, thanks again @Isabella Ava ,
Now the game works properly. Maybe I wasn't clear enough when I explained what I wanted though; the skill now attacks a selected enemy, and another random one. What I would like is for the skill to attack an enemy while dealing some damage to an ally, always the same... (Three female dark elves and a male; the priestess deals damages to an enemy with her sacrifice skill by dealing damages to the male member of her group... Yup, drow priestesses can be very mean to their male counterpart!)
Do you think this is possible?Code:Replace if ([1,2,3,4].contains(member._actorId)) {<Custom Target Eval> for (var i = 0; i < friends.aliveMembers().length; ++i) { var member = friends.aliveMembers()[i]; if (member._actorId != user._actorId) { if ([1,2,3,4].contains(member._actorId)) { targets.push(member);targets.push(b);break; }}} </Custom Target Eval>
with indexes of the Actors that may take damage. ex: if ([15,22].contains(member._actorId)) { -
Sorry to bother you again, @Isabella Ava ...
Here's what I pasted/replaced:
<Custom Target Eval>
for (var i = 0; i < friends.aliveMembers().length; ++i) {
var member = friends.aliveMembers();
if (member._actorId != user._actorId) {
if ([2].contains(member._actorId)) {
targets.push(member);targets.push(b);break;
}}}
</Custom Target Eval>
I put a "2" instead of "1,2,3,4", as the sacrificed ally is actor 0002 in the database, but then, nothing happens when I use the skill, be it in battle testing or actual play... Did I make a mistake while replacing? Thanks again.
Edit: layout corrections -
It won't work if Actor2 is the skill's User; or if Actor2 is dead or not in Fight Party
Else it should work fine
Code:<Custom Target Eval> for (var i = 0; i < friends.aliveMembers().length; ++i) { var member = friends.aliveMembers()[i]; if (member._actorId != user._actorId) { if ([2].contains(member._actorId)) { targets.push(member);targets.push(b);break; }}} </Custom Target Eval> -
And yet, after the casting animation, nothing happens, even though actor 2 is in the party and alive... I tried with the other actors too, but the problem is the same. No error message in the console.
Just in case, here's a screenshot of the skill in the database:
-
Edit: As you always answered rapidly, @Isabella Ava , I now guess I need to directly refer to you for you to see this. -
Bump. Anyone?
-
I think you both are over complicating things.
Can you explain to me exactly how the skill work? Like, the damage the party actor receive is the user? or is another ally? if so, is it always the same ally? varies? After the damage is done to the party actor, the enemy receive extra damage because of the sacrifice? how much extra? and so on... -
Ok, @Magusalfador , thank you for your help. I'll try to make this as precise as I can:
- Actor 3 has as a skill named Sacrifice. This skill deals physical damages to any single enemy selected by the player. I would also like it to deal physical damages to actor 2 too, and always to actor 2.
- We don't have to bother about the skill being usable when actor 2 isn't int he party, because actors 2 and 3 will always be in the party at the same time.
- The damages dealt can be fixed (200 to the selected enemy and actor 2), or based on the same formula for both the enemy and actor 2 (I don't care, so I would go for the simplest of the two options).
- The skill costs some MP to cast.
- Actor 3 has as a skill named Sacrifice. This skill deals physical damages to any single enemy selected by the player. I would also like it to deal physical damages to actor 2 too, and always to actor 2.
-
Nah its pretty clear and simple. You are using Yanfly´s scripts right? And if you are not, do you mind using them? I can do the skill for you.
EDIT: Nm, I see you are using the Yanfly´s plug ins I need for the skill. -
Here you go. Tell me if you need anything else. Just place the code on the skill notebox and give the skill to your actor 3. In the skill damage formula box, place 200 and set variance to 0% if you want the same damage of 200 dealt to both actor 2 and enemy target.
Spoiler<Setup Action>
display action
wait: 40
</Setup Action>
<Whole Action>
</Whole Action>
<Target Action>
MOVE user: character 2, FRONT BASE, 30
wait for movement
animation 58: character 2
wait: 20
HP -200: character 2, true
wait: 60
MOVE user: target, FRONT BASE, 20
MOTION SWING: user
wait: 30
action effect
</Target Action>
<follow action>
CLEAR BATTLE LOG
MOVE user: RETURN, 20
</follow action>
<Finish Action>
</Finish Action> -
@Magusalfador
Ok, so, if I understand correctly, I just need an action sequence? I tested it, and it looks great! For some reasons, actor 2 doesn't suffer the 200 HP damage, though, and I can't understand why (I plan to learn and understand everything about action sequence soon, but I'm not there yet...).
So, if you could check for what's going on, it would be really appreciated, but if not, I guess I'll be ok sometime soon. -
Hmm, It does suffer it on my test. This line "HP -200: character 2, true" makes it so. Can you check that maybe, the popup damage is not showing but the actor 2 is actually being damage, check his HP and tell me. I know it sounds dumb but trust me, it happened to me so many times before .
EDIT: With actor 3 and actor 2 Im referring the ID on the database on the "ACTORS" tab...not on the position on the battle field. is your Actor 2 on the battle field the Actor 2 on the database? -
@Magusalfador Yes, I was also refering to the ID on the database.
And after checking, actor 2 does indeed suffer the damages; the popup is just not shown. Anyway to fix that?
Edit: And thanks again! -
You can accomplish this quite easily using variables.
Write your damage formula as such:
Code:(v[x] == 0) ? 200 : a.atk* 4
Where x = an empty variable that you can use.
This will do the following:
If Variable X = 0, you will do 200 damage.
If Variable X = anything other than zero, you will do attack power * 4.
Then in your Action Sequence, instead of writing
Code:HP -200: character 2, true
Write
Code:Action Effect: Actor 2 Change Variable x = 1 wait: 10 Action Effect: Target Change Variable x = 0
That should work. -
I remember I encountered the same problem about some damage pop ups not showing but I dont remember how I fix it.
Try adding:
eval: $gameActors.actor(2).startDamagePopup();
just under: HP -200: character 2, true
so ti looks like this
<Target Action>
MOVE user: character 2, FRONT BASE, 30
wait for movement
animation 58: character 2
wait: 20
HP -200: character 2, true
eval: $gameActors.actor(2).startDamagePopup();
wait: 60
MOVE user: target, FRONT BASE, 20
MOTION SWING: user
wait: 30
action effect
</Target Action>
If that doesn't work, try it again, but this time change the true to false on HP -200: character 2, true. -
Hey there.
I tried Magusalfador's solution first because it was the simplest, and it worked! I didn't need to change "HP -200: character 2, true" to false; damages are now showing during the skill use. Thank you so much all of you, @Isabella Ava , @Magusalfador and @boikish ; your help has been sincerely appreciated.
Also, although Magusalfador's action sequence is great, it of course doesn't perfectly fit my needs concerning my project. Thus, once I've learned enough about action sequence programming, I will tweak it to fit those needs (while still keeping you to my credits, of course). If you're interested, I will post it here or in the action sequence sharing post: https://forums.rpgmakerweb.com/index.php?threads/pre-made-yanflys-action-sequence-sharing-and-discussions.46691/']https://forums.rpgmakerweb.com/inde...ction-sequence-sharing-and-discussions.46691/
Edit: Error correction in the cited url.