Hi,
so i'm trying to learn how to use RMMV and i'm trying to create a test shot for a specific encounter. So first off I will list that i'm currently running the trial version but will be buying the full version soon, also, i'm using alot of Yanfly's Plugins like the Party System, etc.So onto my question.
I'm wanting to create a trigger encounter where it asks if you want to fight the person. However, the battle that takes place should initiate a 1 on 1 battle with the enemy and a specific character in the party (in general). does anyone how how to make this possible?
Thanks,
Kaze
You would need to remove all the other actors from your party, and add them back again later.
Unfortunately, you're using a plugin for a party system, so while I could tell you the easiest way to do this with the default scripts, it may not work with the plugin.
See if there's a way provided by the plugin to put all your party members except that one into a different party, have the battle, and then merge the parties again.
Script: $gameVariables.setValue(x, $gameParty.members());
use the Change Party command to remove all actors except the one you want to stay - if you're not sure who will be in the party at this time, just remove them all except the one you want to keep there. Nothing bad happens if you try to remove an actor who's not there (I say this based on the default scripts - again, the plugin you have might have issues with this)
Call Battle
Script: $gameParty._actors = $gameVariables.value(x)
where x is a variable id.
However, if you're using a party system, you risk messing it up by doing this.
If you remove a party member through the change party event and then after the event you change it again to add them back in, will they still have everything that was on them when they left?
You are not going to be adding them back with the Change Party command. What you're doing is saving away the actor objects, in the correct order, into a variable. Then you're putting that variable back. The party will be exactly the same as it was before you removed them.
I said you won't use Change Party Member to add the actors back. The script does that for you. So remove all the Change Party Member commands to add the characters back.
For the victory screen, I don't know - none of this would affect that. I suggest you copy and paste the event page (after removing those extra commands), then modify the second one to remove everything but the battle. See if it gives you the victory screen. When you're done testing you can delete the second page and just go back to the original one. I suspect you've got something else happening (plugin, probably) that is causing the victory screen to not appear.
Are you using variable 2 for anything else? Try a reasonable variable id - 2666777 is just way too big. The engine has 2000 by default, I think, so try 500 or something.
In the last script call, add a second line with $gameParty.refresh() and see if that makes a difference.
as far as I know I wasn't using 2 for anything else, so i changed it now to 505. added that script and still got the same error with no victory screen.
EDIT: i even tried it on a blank one that would give a victory screen (which it does) but i'm getting the same error.
please provide screenshots of the console after the error occurs.
Screenshots of the console. Play game, get error, hit F8, click Console tab.
Can you try this ...
replace the first script call with the following:
$gameVariables.setValue(505, $gameParty.members().slice(0))
and replace the second script call with this:
$gameParty._actors = $gameVariables.value(505).slice(0)
If that also throws an error, please screenshot the console again.