Hello gang, I was just wondering if any kind soul here knew of a script call I can use in a condition branch that checks if,
"Any" characters certain stat has reached a set amount? Not one for each actors id.
My idea is similar to the Disgaea reward system where if any characters stat hits a mark it would add a reward to be picked up at an npc. I hope to make it so that anytime any characters certain stat hits say 100 a reward is added. Then each time another characters stat hits 100 the reward is added again. Making it possible for multiple rewards to be waiting at the npc for hitting the stat level.
Thanks for taking the time to have a look I hope can help with this one. Be well kind RPGers.
Sorry about the lack of detail there, I want it to check for Magic attack which I have changed but I don't think that matters. So I tried it out like this,
$gameParty.members().some(function(actor) { return actor.mat; })
and I think thats right but how would I get it to check the amount? So when any characters mat hits say 100 the check goes off.
EDIT
Upon furthur review I believe it should be something like,
$gameParty.members().some(function(actor) { return actor.param(4); })
But I am still having trouble setting it to check for the amount.
EDIT 2 🙂
Ok I figured out why it wasn't working it seems it has to be either >= or <= when what I need is =, so this works sort of
$gameParty.members().some(function(actor) { return actor.param(4) >= 100; })
If there is a way to do only = that would be great but if so I think I have another issue. I noticed when practicing with the above script that when more than 1 character hit 100 at the same time only 1 prize was added when it should have been equal to the amount of people who hit 100 then.
If this is an issue I think I could work the system so it calculates all members into a total amount and then goes off that amount rather than each time someone hit the amount. This would probably work better but I don't know if theres a script that can return total of all members magic attack. Sorry to be such a pain.
Oh putting a condition branch with
$gameParty.members().some(function(actor) { return actor.param(4) >= 100; })
then another condition branch inside that one with
$gameParty.members().some(function(actor) { return actor.param(4) <= 100; })
This works to limit it to the number I want but I am having a weird issue with that setup. What happens is it seems to work fine but then when I recruit a new member it acts like conditions are met when the new recruits magic attack is well below the requirement, and no one for that matters number is equal to the required amount. When the new recruit goes over the required amount however it works properly again.
I am starting to really hope there's a way to just take the combined total magic attack of all members and check against that number as it seems that would be much more simple.
You can find out the total magic simply by eventing.
Set var -> Actor 1 Magic
Add var -> Actor 2 Magic
Etc. Or script for party members rather than specific actors.
Yep that's working thank you very much Shaz. 🙂 I hadn't seen the == anywhere. It all seems to work perfectly except I need to figure out how to limit it so that when say a character is still 100 mat they can't spam the npc for more rewards but as soon as another character hits 100 the reward is available again, and then there's also the issue with if say 4 characters are all at 100 at the same time then only 1 reward is received instead of the 4 it should be. I didn't think this method would be so complicated🙂. Just curious Shaz do you happen to know if there is a Script call for the total mat of all party members? Either way I am super grateful for your help, thank you very much.
EDIT
The first issue was no problem I just made it so when the reward is received a +1 mat comes along with it to the whole party thus moving them past the spamming issue. The other issue seems like it may be a big problem though, being if multiple characters have the same amount they only get 1 reward currently. That only works if its running off of the total mat rather than individual.
That code sounds amazing but its a little beyond my knowledge level unfortunately. First off you said have each party member if mat >= 100 increase a variable. For that I believe you mean use the original script I had been working with from Shaz and just add a variable addition rather than a prize. Which I believe I did, the variable goes up when character hits 100 but it only goes up 1 at this point instead of what should have been 4, being the number of actors who hit 100 all at once.
Now that code, wow 🙂 I believe I add it through the script command in my common event for this. And I set the variable ID for the first line. From there I am a bit clueless where this goes exactly. Or does it go in as a plugin? Sorry for my lack of knowledge here, I know it's annoying🙂
Edit
Ok I figured out what I was doing wrong. I am testing with a mat of 8 even though I was using 100 in my example, I set the 100 to 8 in your code and bam it worked. One thing I am trying to figure out though is it is adding an extra 1 to the variable when it goes off so I have 4 party members total all hit 100 at the same time but we get 5 rewards. And one other question, if I may. This is looking great but how will I go about adding more reward checkpoints like say rewards at 100 mat, 200 mat and so on?
Edit 2
Ok this code is perfect thank you so very much. I had added it to the common event with original formula I was using and a variable tag to add +1 to the reward variable. I had misunderstood what you meant, I didn't realize your code did it all. So Everything is better than great. Just the one question still though how would I go about adding more parameter checkpoints like also at 200 mat? I'm thinking it may be best to have a separate common event for each tier or like at 100, 200 so on. Then I could easily assign different reward tiers based on higher mats. And again thank you so much.🙂
I only plan on using this for Magic Attack. I didn't need that stat so I changed it to Fame and it goes up at a controlled rate. The reward system is just one of the things I want Fame to affect but its a big one. I will probably have a lot of tiers but I know nothing about arrays in coding or setting any of that up and you have been more than helpful so this system is better than I had expected, I don't need to trouble you with this any further. You rock thanks again very much. This was super helpful.
This should work: set up another variable, add to its value all available rewards , and display it.
That sounds like what I've spent most of my day trying to do.🙂 I am back on the hunt for how to do this now that I know that is the correct method but wow the Internets vague on that one. I've been googling everything about adding variables I could think of. Thanks for pointing me in the right direction though I'll figure out how that's done. Have a good one Astfgl66
EDIT
Well I figured out how to do it but the reason I didn't think it was working was because I was checking it with yanflys actor variables plugin which displays current variable numbers. If the variable info is in the call event info then it works because it then sets the variables, not when I actually have the stats go over, so it doesn't update the plugin info. until after I know whats there. I can set it up as a parallel event but I'd rather not have this all as a parallel just to keep that info updated so I think I am going to have to give up on this last bit. No worries though this system is still perfect for my needs.
Let take my two tiers as an example.
First tier rewards are stored into game variable 1, second into game variable 2.
Lets store the total amount of rewards in variable 3.
Just do:
Control variables > Variable 3 > Add > Variable > Variable 1.
Repeat for the second tier changing variable 1 to 2.
Success! Variable 3 now contains the total.
This is pretty basic use of variables, if it gives you trouble you should look at tutorials about them. There's a whole lot of them lying around.
Yeah that works for me now but the variable 3 doesn't update until the event call is made. Because of that the info in the plug in window doesn't update until after the event call is made, which is a shame because when it was just one variable the plugin info window worked properly. I edited my previous post I think I did it after you read it though I was able to figure out why it hadn't been working for me. It was due to the fact I was reading the variable state off of yanflys actor variables plugin. It would work as a parallel event but I'd rather not run it as parallel just to get the info in the plugin window so I think I'm going to have to give up on that aspect of the system no biggie though.