Status
Not open for further replies.

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
So, I've been trying to figure these out myself to no avail...

Problem 1: How can I set a variable for a player where if a party member equips a weapon, a variable changes according to what weapon is equipped to that actor. For example, we equip a fire sword, variable Actor0Element would equal "Fire". But then that same actor switches to an ice weapon, variable Actor0Element would now be equal to "Ice". This way I can properly show animations for skills all actors share, but they'd have a special effect depending on an actors variable.

Problem 2: How can I create a function where if variable "Stylish Evasion = 1", each time an actor evades, an animation plays on that actor and their attack increases by +1, but once they're hit, that additional attack resets.

Problem 3: How can I create a function where if variable "Lone Wolf = 1", a state given to the last actor alive where that actor gains special buffs, however, once a party member is revived, this buff is removed from all actors.

Please, pleaaaase give me some solutions. I've been haven't a hard time figuring these out and they're definitely core features that I need, and the best part is that Problems 2 and 3 can be modified and reused for different types of things.


If it turns out to be something too difficult to where it must be commissioned, let me know...
 
Last edited:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,934
Reaction score
8,857
First Language
English
Primarily Uses
RMMV
I'll just say, it's best to not pm solutions. No one else can learn from this thread if it is discussed in a pm. Please post solutions here.
 

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
I'll just say, it's best to not pm solutions. No one else can learn from this thread if it is discussed in a pm. Please post solutions here.
It's not against the rules though, so what's wrong with simply PM'ing me? Plus it's my thread. If anyone has a question they can just post their own.

*Edit*
Please PM solutions.
 

dnel57

dnel57
Veteran
Joined
Sep 12, 2015
Messages
144
Reaction score
16
First Language
English
Primarily Uses
This may work for #1


conditional Branch.png
 

dnel57

dnel57
Veteran
Joined
Sep 12, 2015
Messages
144
Reaction score
16
First Language
English
Primarily Uses
That's an awful lot of weapons for one character but, it seems you will need some kind of variable for each. Good luck with your project. I'm interested to see what you find out; curious.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,877
Reaction score
14,525
First Language
English
Primarily Uses
RMMV
what's wrong with simply PM'ing me?

What's wrong with just PMing you is that you don't know if the person knows what they are talking about. If they post something that just won't work in the forum, others will be able to say it won't work and explain why. If they PM you, nobody else will know what you've been told, so if it's wrong, you will waste your time trying to get it to work, then going back and forth with someone who doesn't really know what they're doing, and you'll achieve nothing and be right back where you started, minus the time you spent on it. And probably more than slightly frustrated as well.

Why is it so important to get PM responses? You can just flag the topic to watch it and you'll still get notifications/emails of responses.

However, if you wish to receive replies via PM, please say so and we'll close the thread so nobody can reply here.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
724
Reaction score
386
First Language
English
Primarily Uses
RMMV
Plus, a huge amount of the knowledge I have about RPG Maker comes from Googling and finding threads where people were discussing a similar thing. I can't think of any way using PMs is specifically beneficial to you, so it seems vaguely rude to the community to not show in public what other people have done to help you.

In that vein, I am pretty sure I've seen your question 3 come up before and someone posted a way to do it using Yanfly's Buffs or States. I'll do a little search and let you know if I find it.

Edit: I haven't found the old thread, but off the top of my head, you'd use Yanfly's Buffs and States Core. Give Knockout a Custom Apply Effect, and have the script within loop through the party members; if there's only 1 that's alive, and your Lone Wolf variable is on, give him the state with the buffs. Similarly, give Knockout a Custom Remove Effect that removes the lone wolf buff state from all party members.
 
Last edited:

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
Plus, a huge amount of the knowledge I have about RPG Maker comes from Googling and finding threads where people were discussing a similar thing. I can't think of any way using PMs is specifically beneficial to you, so it seems vaguely rude to the community to not show in public what other people have done to help you.

In that vein, I am pretty sure I've seen your question 3 come up before and someone posted a way to do it using Yanfly's Buffs or States. I'll do a little search and let you know if I find it.

Edit: I haven't found the old thread, but off the top of my head, you'd use Yanfly's Buffs and States Core. Give Knockout a Custom Apply Effect, and have the script within loop through the party members; if there's only 1 that's alive, and your Lone Wolf variable is on, give him the state with the buffs. Similarly, give Knockout a Custom Remove Effect that removes the lone wolf buff state from all party members.
Sweet, that makes sense, how do I check each party member using a loop?
 

Kyuukon

主人公
Veteran
Joined
Aug 22, 2013
Messages
2,256
Reaction score
1,116
First Language
Spanish
Primarily Uses
RMMV
if($gameParty.aliveMembers().length == 1){ $gameParty.aliveMembers()[0].addState(X); //or just turn ON Lone Wolf switch }

maybe?
 

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
Hmm, do I just add another <Custom Apply Effect> ?
I already have a Custom Apply Effect in the KO notetag... not sure if having another custom apply will not work

*Edit*
Awesome, problem 3 solved. :^)
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,877
Reaction score
14,525
First Language
English
Primarily Uses
RMMV
How does that remove the state from the actor once another party member is revived?
 

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
How does that remove the state from the actor once another party member is revived?
I tried fiddling a bit thinking this would work but it doesn't.

Code:
<Custom Remove Effect>
if($gameParty.aliveMembers().length >= 2 && $gameVariables.value(301) === 1)
{
if(($gameActors.members().filter( function (actor) { return actor.isStateAffected(62); } ).length > 0) === 1)
{    
     actor.removeState(62);
     actor.startAnimation(54);
}
}
</Custom Remove Effect>

So basically I tried checking if there was 2 or more actors alive and if Lone Wolf Skill was active. If those are true, then it's supposed to check if an actor has state 62, once it returns true, then remove the state and play an animation on that actor.
 

Kyuukon

主人公
Veteran
Joined
Aug 22, 2013
Messages
2,256
Reaction score
1,116
First Language
Spanish
Primarily Uses
RMMV
if(($gameParty.members().filter( function (actor) { return actor.isStateAffected(62); } ).length > 0) === 1)

Pretty sure you have to remove the text in red..


if($gameParty.aliveMembers().length >= 2 && $gameVariables.value(301) === 1){ $gameParty.members().forEach( function (actor) { if(actor.isStateAffected(62)){ actor.removeState(62); actor.startAnimation(54); } } ); }
maybe?
 
Last edited:

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
if(($gameActors.members().filter( function (actor) { return actor.isStateAffected(62); } ).length > 0) === 1)

Pretty sure you have to remove the text in red..
Now I tried this and it still doesn't work:

Code:
<Custom Remove Effect>
if($gameParty.aliveMembers().length > 1 && $gameVariables.value(301) === 1){
if(($gameActors.members().filter( function (actor) { return actor.isStateAffected(62); } ).length > 0)
{
     actor.removeState(62);
     actor.startAnimation(54);
}}
</Custom Remove Effect>
 

Kyuukon

主人公
Veteran
Joined
Aug 22, 2013
Messages
2,256
Reaction score
1,116
First Language
Spanish
Primarily Uses
RMMV
it should be $gameParty , not $gameActors. Missed that typo. But actor is still not defined. Try code I posted above.

Edit: I also don't understand why that code should be inside <Custom Remove Effect>. It should be in a common event that you call when you use a revival spell or at the end of each turn for safe measure.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,352
Reaction score
8,080
First Language
German
Primarily Uses
RMMV
How can I set a variable for a player where if a party member equips a weapon,
please check here:
one of the plugins listed does what you want, running code or common event on equip. I haven't used it myself however, and it appears to be one of those plugins that react to wrong order and other requirements, so you'll have to experiment a bit.
so what's wrong with simply PM'ing me?
that means that you'll be the only one who can read the solution.
everyone helping here does so in their free time, and while I have no problems spending my time helping others, I don't want the results to vanish with a single person.
So I absolutely refuse to give answers by PM, I only answer by forum post.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
724
Reaction score
386
First Language
English
Primarily Uses
RMMV
Edit: I also don't understand why that code should be inside <Custom Remove Effect>. It should be in a common event that you call when you use a revival spell or at the end of each turn for safe measure.
Is there some way to revive a party member in battle that doesn't involve removing the Knockout state? That's what a revival spell does, for sure.

The only trick I can think of is how he wants this to interact with battle ending and starting with only one living party member. There should probably be a script/event stuck at the beginning and end of every troop to check for it.
 

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
Okay, problem 3 is solved and I don't wish to resolve problem 1 anymore, bumping.
 

Kyuukon

主人公
Veteran
Joined
Aug 22, 2013
Messages
2,256
Reaction score
1,116
First Language
Spanish
Primarily Uses
RMMV
Eh, this may be ugly but try adding this as a plugin:

(function() { var variableId = 0; // change var id var stateId = 0; // change state id var animationId = 0; //change animation id var AG_EvasionState_Game_Actor_performEvasion = Game_Actor.prototype.performEvasion; Game_Actor.prototype.performEvasion = function() { AG_EvasionState_Game_Actor_performEvasion.call(this); if($gameVariables.value(variableId) === 1){ this.addState(stateId); this.startAnimation(animationId); } }; })();

I haven't tested this code ingame but you do for me x)
Make the State in database have 100% chance to be removed upon taking damage and you can use some other plugin that allows stackable states? I don't know, I'm too lazy to do with Buffs, sorry. Good luck lol.
 
Last edited:
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Definitely glad I haven't released a few of my plugins that are technically done. As I learn more, I find ways to make my code more efficient, and in one case so far, discovered an existing function that did EXACTLY what I created my own function to do.
So I was kinda recommended a manga to learn a few drawing tips, I dunno if it will actually work, but I'm liking the story lol
M745veO.jpg
RPG Maker News #12 | Control Zooming, Customize Bush Effect, Causality & Happy Bones on Steam
Episode 16 let's go! We're making an RPG in RPG Maker MZ! This week... even more mapping, we're almost done with all the mapping for our first dungeon!

I have big news. I just got hired at a Mexican restaurant! They're like Chipotle but a bit different... and my job will be taking orders some days, delivering food other days, and of course, making customers happy. My orientation is on Tuesday. Once I start, I might disappear from here sometimes, but I'll always try to come back!

Forum statistics

Threads
110,448
Messages
1,053,398
Members
143,530
Latest member
CaptainCanuck
Top