Attacking specific party member?

Crifmer

Villager
Member
Joined
Sep 18, 2014
Messages
20
Reaction score
1
First Language
English
Primarily Uses
Hi guys,
 
I just picked up VXAce this past week and I'm having a lot of fun.  I did the awesome tutorial by Kelsper (you can find it here but I stopped polishing and balancing so I could move on to a game of my own for more learning) and have been going through the forums and reading stuff and playing unencrypted games so I could figure out stuff on my own, but I do have a question I haven't been able to figure out yet:
 
I want to create a skill that allows the party a guaranteed escape (even in "unescapable" battles), but the enemies will attack the user.
 
I set up the skill (Distraction) to call a common event which forces all the battlers to attack, throws up some text ("You escape!") and then aborts the battle.
 
For the life of me, I can't figure out how to get the battlers to consistently attack the person using the skill.  I set up a state called Target which increases the user's TGR by 1000%, but I don't think it's getting applied.  It looks like the common event is getting called before the state gets applied.  Here's what I've got so far:
 
Skill:

State:

Common Event:

I played around with trying to use "Last Target," but that doesn't work.  The closest I've come is increasing the Target value and hoping the user gets targeted.  It's still not guaranteed that the user will be the one attacked, though.

A related issue is that it seems that the state is not getting applied before the event is called.  I'm not seeing the state message or icon before the enemies attack.

I want to be sure that the baddies attack the person providing the distraction, no matter where in the formation he is.

The only thing i can think of is using a script to get the user's formation ID, then have the battlers attack that formation ID.  But I can't find anywhere that showed me how to find the formation ID of the acting character.  I'm familiar with programming, but not with Ruby, so I can more or less understand what I'm reading, but I wouldn't know how to write it.

Thanks for any and all help. :)

-C
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
TRG is TP regeneration rate


TGR is target rate


You increase the wrong parameter, check the help file for more info
 

Crifmer

Villager
Member
Joined
Sep 18, 2014
Messages
20
Reaction score
1
First Language
English
Primarily Uses
TRG is TP regeneration rate

TGR is target rate

You increase the wrong parameter, check the help file for more info
You didn't look at the screenshot.  It's TGR.  I fixed my typo.  That still doesn't help me figure out why the state doesn't seem to be getting applied.  Even if I did apply the wrong parameter, the "fell in state" message and state icon should show up, showing that the state is getting applied..  They don't.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I can't see anything that would prevent that state from being applied - please check if the actor or class has a state rate for that state as a feature. That would be the only thing I can think of to prevent that state from being applied.


Do you have any scripts added? Check if such a skill and state works in a new project with everything else default...
 

Crifmer

Villager
Member
Joined
Sep 18, 2014
Messages
20
Reaction score
1
First Language
English
Primarily Uses
I can't see anything that would prevent that state from being applied - please check if the actor or class has a state rate for that state as a feature. That would be the only thing I can think of to prevent that state from being applied.

Do you have any scripts added? Check if such a skill and state works in a new project with everything else default...
Herein lies my problem.  I have not added that state to anything except the skill.  There are no custom scripts.  This should work, yet it doesn't.

Thus my question:  How do I get a battler to attack a specific enemy?

EDIT:  Okay, I made a stupid mistake.  I needed to change the scope of the skill to "The User."  Now the state is getting applied.  So now my user is getting attacked the majority of the time, but I would like to make certain that he and only he gets attacked.  I have an idea of what scripts to look at to try and help me find an answer, but like I said, I don't know Ruby, so I don't even know what I need to add if I just cut and paste stuff.  I have a feeling that this is something that needs a script, unfortunately.

Edit 2:  Weird again.  The screenshots above didn't work originally.  I think while I was messing around, I changed from "User" to "None."  I just changed it back to "User" and it works now.
 
Last edited by a moderator:

Crifmer

Villager
Member
Joined
Sep 18, 2014
Messages
20
Reaction score
1
First Language
English
Primarily Uses
All right, I've figured it out using two common events.  It's by no means an elegant solution, but it works.

The first event searches through all the actors to find the one with the Target state.  I did this as a separate event so when the actors get changed, I only need to change one event.

Find Target Event:

@>Conditional Branch: [0001] is [Target] inflicted   @>Control Variables: [000#:Target] = 1

   @>Exit Event Processing

   @>

:  Else

   @>

:  Branch End

@>Conditional Branch: [0002] is [Target] inflicted

   @>Control Variables: [000#:Target] = 2

   @>Exit Event Processing

   @>

:  Else

   @>

:  Branch End

Rinse and repeat for each actor in order.  I can't figure out how to use variables to turn this into a loop.
Attack Target Event:

@>Call Common Event: [Find Target]@>Control Variables [000#:Current Player] = Member #1's Actor ID

@> Conditional Branch: Variable [000#:Target] == Variable [000#:Current Player]

   @>Force Action: [1.], [Attack], Index 1

   @> (Repeat above command for up to 8 battlers.  I only did three for now since I have no troops with over three battlers.)

   @>

:  Else

   @>

:   Branch End

@>Control Variables: [000#:Current Player] = Member #2's Actor ID

@>Conditional Branch: Variable [000#:Target] == Variable [000#: Current Player]

   @>(Same as above, but for Index 2)

Repeat for Index 3 and 4.  If we could use a variable for the target ID, we could do this in a loop, but we have to do this manually, unfortunately.
It's rather clunky, and not at all dynamic, but it works without resorting to scripting, and it should be adaptable to almost any situation that requires a specific target in battle.  I thought I'd post my solution here in case anyone else might find it useful.  If anyone's got a better way, I'd love to see it.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
I believe you could do it a lot smoother by just adding TGR * 0% states to the other party members.
 

Crifmer

Villager
Member
Joined
Sep 18, 2014
Messages
20
Reaction score
1
First Language
English
Primarily Uses
I believe you could do it a lot smoother by just adding TGR * 0% states to the other party members.
I just opened RPG Maker to check this method out...

You can only have one scope at a time for a skill, so the skill can either add a state to one party member, or the whole party.  It can't add a state to the user and also add a different state to the rest of the party.  Sorry, talking it through here... I just spent a moment goofing around in RPG Maker...

You can call a common event which would apply the 0% TGR to the whole party, and apply the 100% TGR to the user within the state, so the state features would be

Common Event (apply 0% APR)

SP-Parameter TGR 100%

And the distraction skill event would simply force all the baddies to attack.

I'll test that out, but it should work.  Much more elegant, thank you. :)

I do think my events above have merit, but I think this is the nice easy general solution I was looking for while mine could be good for highly specific situations.  I've only been using RPG Mker for under a week, so I'm not yet familiar with all the features and I'm groping blindly in the dark mot of the time.

Thanks again, Wavelength.  Much better way to do it.
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Yeah, you apply the state to the other party members (be careful about applying it to the party member that used the skill since I think having both a 0% and a 100% would multiply to 0.00 * 1.00 = 0%; let me know if you need help avoiding that party member when applying states) in a common event, OR you could do it in the formula box itself (which is an even more elegant solution) once you get comfortable with Ruby syntax.

Glad you like the solution.  Let us know if it works.
 
Last edited by a moderator:

Crifmer

Villager
Member
Joined
Sep 18, 2014
Messages
20
Reaction score
1
First Language
English
Primarily Uses
Yeah, you apply the state to the other party members (be careful about applying it to the party member that used the skill since I think having both a 0% and a 100% would multiply to 0.00 * 1.00 = 0%; let me know if you need help avoiding that party member when applying states) in a common event, OR you could do it in the formula box itself (which is an even more elegant solution) once you get comfortable with Ruby syntax.

Glad you like the solution.  Let us know if it works.
So I guess I should ask how you avoid that party member.  Seems like the way I described above isn't quite right since you're right about the multiplying.

Would you mind giving an example?  Like I said, I don't know Ruby at all so I've been trying to figure this out via events for now.  I"m sure there's a very good way via scripting, but that's beyond me.

Edit to add:  I just tried it out, and it's not working.  The common event is not applying the safe state to the party.  I only have the one line for it:

@>Change State: Entire Party, + [safe]

The Safe state has TGR applied at 0%

The skill calls the Safe event, then removes the Safe state, then calls the Attack event.  The scope is set to The User.

Not sure why this isn't working.  The attack event just forces the baddies to attack a random target, which should be the user since everyone else lost their target rate.  I also have "fell in to" messages and icons picked out so I can see the states being applied and removed, and those are not popping up.
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
So I guess I should ask how you avoid that party member.  Seems like the way I described above isn't quite right since you're right about the multiplying.
If you don't want to use any scripting whatsoever, then make sure the skill is applying some sort of "target me" state to the user (like you were doing before), and then modify your common event as such:

First, add the 0% state to the entire party.  Then, create a conditional branch for each possible party member: IF that party member has the "target me" state applied, REMOVE the 0% state from that party member.  Then, do whatever other eventing you have to do in the Common Event.

So like this:

Add State "hidden" to the entire party

Conditional Branch: Alice has "target me" inflicted

    Remove State "hidden" from Alice

End

Conditional Branch: Bob has "target me" inflicted

    Remove State "hidden" from Bob

End

Conditional Branch: Charlie has "target me" inflicted

    Remove State "hidden" from Charlie

End

(etc.)

(Other Event Processing)

This should work.  But if it doesn't, let me know.
 

Crifmer

Villager
Member
Joined
Sep 18, 2014
Messages
20
Reaction score
1
First Language
English
Primarily Uses
That works fine, but you still have to do it for every actor since you can't use party member ID for a conditional branch.  It's less clunky by bringing it down to one event, but still could get unwieldy if you're going to have a lot of actors in the game.  It's pretty much what I did above in my "Find Target" event.  I just separated it into two events in case I wanted to do more than just force attacks.  I'd have to write a new event for each forced action.

Removing the Safe state within the skill should work.  The hurdle is I don't think the common event is actually applying it to the party.  I'm not sure why or how to check beyond putting the messages and icon into the state.  I still think you gave me the simple answer, but I don't know why it's not working.

Here's what I've got:

 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top