Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
Hey! I'm using YEP_TargetCore and I need help on making a <Custom Target Eval>. I want the skill to affect all alive allies if the user has State 134. However, if user hasn't got State 134, the skill will affect a single alive ally.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
Code:
<Custom Target Eval>
targets=[];
if (user.isStateAffected(134))
    targets=$gameParty.aliveMembers();
else
    targets.push($gameParty.aliveMembers()[Math.randomInt($gameParty.aliveMembers().length)]);
</Custom Target Eval>
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
Code:
<Custom Target Eval>
targets=[];
if (user.isStateAffected(134))
    targets=$gameParty.aliveMembers();
else
    targets.push($gameParty.aliveMembers()[Math.randomInt($gameParty.aliveMembers().length)]);
</Custom Target Eval>
How can I make it so you can choose the alone targeted ally? Right now it's random...
Also, I'd need some help with the <Custom Target Text>. I don't know why this little script doesn't work:

<Custom Target Text>
if user.isStateAffected(134) {
text = 'Todos los Aliados';
} else {
text = 'Un objetivo';
}
</Custom Target Text>
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
How can I make it so you can choose the alone targeted ally? Right now it's random...
Please be more specific with how your skill is written. In fact, please just post a picture of your skill in the database. I assumed since an option was for it to target the party that it had a scope of All Allies.

Also, I'd need some help with the <Custom Target Text>. I don't know why this little script doesn't work:
The conditional after "if" needs to be in parentheses.

And the braces are not necessary since you're only executing one code statement.
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
Please be more specific with how your skill is written. In fact, please just post a picture of your skill in the database. I assumed since an option was for it to target the party that it had a scope of All Allies.


The conditional after "if" needs to be in parentheses.

And the braces are not necessary since you're only executing one code statement.
I guess the picture must be in english for you to understand right? Tell me and I'll change my RPG Maker MV languague if needed. My skill description is written like this:

"Heals a great amount of HP to a targeted ally over 3 turns. If the caster is on Zen Mode (State), this spell affects all allies instead, including himself. This spell uses the element Water"

I'll attach the Console Log error for the <Custom Target Text>
 

Attachments

  • customtargettexterror.PNG
    customtargettexterror.PNG
    72.7 KB · Views: 3

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
I guess the picture must be in english for you to understand right?
That's not super important, but I don't see any screenshot of your skill in the database attached to your post.

I'll attach the Console Log error for the <Custom Target Text>
I don't understand why your target text is going through the Event Copier plugin.

You might be getting an error if you're trying to use that code outside of battle, but again, that goes to actually seeing your skill settings.
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
That's not super important, but I don't see any screenshot of your skill in the database attached to your post.


I don't understand why your target text is going through the Event Copier plugin.

You might be getting an error if you're trying to use that code outside of battle, but again, that goes to actually seeing your skill settings.
I'm using the skill in battle. Here you have the screenshot:
 

Attachments

  • skillshot.PNG
    skillshot.PNG
    111.1 KB · Views: 4

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
Okay, so the scope of the skill is set to all allies. So:
How can I make it so you can choose the alone targeted ally? Right now it's random...
how can you do that? If you have the scope set to all allies, there is no "alone targeted ally."

You would need to change the scope to 1 Ally and then modify it with a custom target notetag. Or combine this with notetags from Selection Control.

I'm using the skill in battle. Here you have the screenshot:
Then I'm not sure why you'd get an error about "user" being undefined - did you fix your code like I said in post #4? The screenshot doesn't show it.
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
Okay, so the scope of the skill is set to all allies. So:

how can you do that? If you have the scope set to all allies, there is no "alone targeted ally."

You would need to change the scope to 1 Ally and then modify it with a custom target notetag. Or combine this with notetags from Selection Control.


Then I'm not sure why you'd get an error about "user" being undefined - did you fix your code like I said in post #4? The screenshot doesn't show it.
OK, I'll change it to 1 ally. Can you help me scripting the rest, please? Selection Control is confusing.

And yeah, I fixed the code. Right now it's like this:
<Custom Target Text>
if (user.isStateAffected(134))
text = 'Todos los Aliados';
else
text = 'Un aliado';
</Custom Target Text>
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
I was unable to get the crash that you got from your Custom Target Text. However, I did find an error in the plugin getting it to show. So you need to open the Target Core in a text editor, go to line 929 and change it to say:
Code:
    var user=BattleManager.actor();

OK, I'll change it to 1 ally. Can you help me scripting the rest, please? Selection Control is confusing.
If you changed it to 1 ally, I can't think off the top of my head how to make the actual selection change between selecting all allies and selecting just one.

You would make the scope of the skill 1 ally then just a slight modification to what I provided to you in my first response:
Code:
<Custom Target Eval>
if (user.isStateAffected(134))
    targets=$gameParty.aliveMembers();
</Custom Target Eval>

That way the player will select one target, and if the actor has state 134 it will end up affecting everyone instead.
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
I was unable to get the crash that you got from your Custom Target Text. However, I did find an error in the plugin getting it to show. So you need to open the Target Core in a text editor, go to line 929 and change it to say:
Code:
    var user=BattleManager.actor();


If you changed it to 1 ally, I can't think off the top of my head how to make the actual selection change between selecting all allies and selecting just one.

You would make the scope of the skill 1 ally then just a slight modification to what I provided to you in my first response:
Code:
<Custom Target Eval>
if (user.isStateAffected(134))
    targets=$gameParty.aliveMembers();
</Custom Target Eval>

That way the player will select one target, and if the actor has state 134 it will end up affecting everyone instead.
Everything is seemingly solved! Just one issue... The single-target effect doesn't work. It does let me select the target, however, it doesn't matter which target I choose, the skill just doesn't work at all. I've attached how it looks before confirming the action. In the screenshot, I've selected the enemy as u can see, but both of the actors are buged

Also, when having the state on, I still can select a enemy, however it doesn't do anything to the enemy and it does the effect perfectly on both actors
 

Attachments

  • singletargeterror.PNG
    singletargeterror.PNG
    1.7 MB · Views: 2

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
Why are you selecting an enemy? Your first post says the skill is supposed to be affecting either all allies or one ally.

And your translated description in post #5 is talking about allies.
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
Why are you selecting an enemy? Your first post says the skill is supposed to be affecting either all allies or one ally.

And your translated description in post #5 is talking about allies.
Just to find bugs and show u that the single target doesn't work and show the markers that say those two actors are being selected
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
I understand. I thought the notetag returned the default target, but it doesn't. So modify it:
Code:
<Custom Target Eval>
if (user.isStateAffected(134))
    targets=$gameParty.aliveMembers();
else
    targets.push(target);
</Custom Target Eval>
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
I understand. I thought the notetag returned the default target, but it doesn't. So modify it:
Code:
<Custom Target Eval>
if (user.isStateAffected(134))
    targets=$gameParty.aliveMembers();
else
    targets.push(target);
</Custom Target Eval>
the skill now works, but it still shows both of the actors being targeted and it should show only one.
 

Attachments

  • singletargeterror2.PNG
    singletargeterror2.PNG
    1.7 MB · Views: 3

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
I can't speak to that, whatever you're using to show those cursors isn't a part of the Target Core.

In my test project the one target you're selecting is highlighted normally.
Screenshot 2023-03-23 164304.png
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
And does the actor whose turn it is have state 134 on? Because if yes, that's correct - both of those actors (the whole party) are going to be affected by the skill.
 

Danitinkis

Deadly and sexy
Veteran
Joined
Dec 31, 2016
Messages
146
Reaction score
89
First Language
Spanish
Primarily Uses
RMMV
And does the actor whose turn it is have state 134 on? Because if yes, that's correct - both of those actors (the whole party) are going to be affected by the skill.
No, the actor doesn't have that state.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
I can't duplicate the bug. I'm using the exact same notetag that I gave you above and the cursor correctly displays over one person for me.

Screenshot 2023-03-23 194832.png
 

Latest Threads

Latest Profile Posts

Am I the only one that thinks diablo 4's werebear form is atrocious o.0
Back from my short, self-imposed timeout with another picture of my collection of Snorlax mascots for my class. Another class starts on Friday.
Mascots.jpg

Forum statistics

Threads
131,607
Messages
1,221,527
Members
173,322
Latest member
hchomd
Top