Battle Parallel Process Common Event Won't Run

theolis-wolfpaw

Villager
Member
Joined
Jan 4, 2016
Messages
22
Reaction score
4
First Language
English
So, this is almost literally making me tear my hair out. I have set up a common event called Track Enemies to run on a parallel process with a switch. This switch is something I turn on at the start of battle, turn 0. In theory it is supposed to count the number of each type of enemy, so that I can use that for Yanfly's Enemy AI plugin in. I have another common event that runs on a parallel process called Track Player, it is turned on, on the first screen of gameplay, on the map. It is meant to track the player's coordinates and map ID. It runs, Track Enemies does not, at all.

I have turned off all the plugins, I have tried removing everything but the show text command (so I know it's working) from Track Enemies, (I even checked to see if show text was the problem by putting it into Track Player, but that worked), I have tried setting different switches, I have tried setting it to autorun just to see if it would run once, I tried copying it to another database number, and nothing ever changes. It just does not run and I have no idea what I am doing wrong. If anyone can help, please. I am at my wits end with this.

EDIT: So it appears parallel processes are only valid on the map, which leaves me with a different question. How do I work around this limitation.
 
Last edited by a moderator:

Kenen

Veteran
Veteran
Joined
Apr 3, 2012
Messages
262
Reaction score
155
First Language
English
Primarily Uses
RMMV
You're asking for help, but you haven't specifically identified what you need help with. You mention your Track Enemies / Track Player events, but you don't explain what their purpose is.

In cases like this, it's actually more helpful for you to spell out exactly what you want to accomplish, step by step, as opposed to iterating what you've already tried or what doesn't work. I've read your post, and have absolutely no idea of what you're ultimately trying to accomplish outside of the fact that your events aren't working properly. 

Please liststep by stepwhat you want to do.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Tsukihime (I think) wrote a script for Ace for common events in battle. You could search to see if there's a similar plugin for MV
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
EDIT: So it appears parallel processes are only valid on the map, which leaves me with a different question. How do I work around this limitation.
That is correct, parallel processes cannot work on any screen by default, and that includes the battlescreen.
There are several solutions to it (most requiring scripts/plugins), but I'm wondering - why don't you use a troop event set to run every turn?
 

theolis-wolfpaw

Villager
Member
Joined
Jan 4, 2016
Messages
22
Reaction score
4
First Language
English
That is correct, parallel processes cannot work on any screen by default, and that includes the battlescreen.

There are several solutions to it (most requiring scripts/plugins), but I'm wondering - why don't you use a troop event set to run every turn?
You're asking for help, but you haven't specifically identified what you need help with. You mention your Track Enemies / Track Player events, but you don't explain what their purpose is.

In cases like this, it's actually more helpful for you to spell out exactly what you want to accomplish, step by step, as opposed to iterating what you've already tried or what doesn't work. I've read your post, and have absolutely no idea of what you're ultimately trying to accomplish outside of the fact that your events aren't working properly. 

Please liststep by stepwhat you want to do.

 
@Andar: Well, the problem is, that wouldn't update nearly often enough. Which I guess means I should definitely explain what I'm doing in detail, as per Kenen's suggestion, so here goes. 

I have a hornet enemy that has a skill called Rally the Hive. The idea is that the skill causes all of the hornets in the troop to attack a single target with another skill called Swarm Attack, which is basically a weakened normal attack. I've got that part, mostly working. (Swarm Attack is meant to be a free action, but in Yanfly's CTB, which I'm using, it ends up costing them their turn. I would also like a solution for this, but that's not the point of this topic right now.) Of course, I want to make them smart enough to not use the skill if there is only one hornet left. In that vein I wrote this piece of code:

$gameVariables.setValue(22, 0);for (var i = 0; i < $gameTroop.members().length; i++) {if ($gameTroop.members().isStateAffected(190) == true) {$gameVariables.setValue(22, $gameVariables.value(22) + 1); } }State 190 is a passive state that identifies the enemy as a Hive Insect (so that I can have different type of hornets reacting to the same command, if I so choose) and game variable 22 records the number of Hive Insects. Under the hornet's AI tag I have them set to only use Rally the Hive, if there is more than one Hive Insect. All of this works, I know because when I wrote that script I stuck it in the Hive Insect state's Start Action Effect (using Yanfly's Buffs and States Core), the problem there was that on their first turn they would never use Rally the Hive and on their first turn after all but one hornet was left it would still use Rally the Hive (for testing purposes I set their AI to 100, so they'll always use Rally the Hive if the conditions are met). So in other words, the state's action start effect is occuring after they've chosen their attack.

So in turn, I need a place to stick this code, so that it runs often enough to update before the hornet's choose their attack. I did think to stick in a battle event when the enemy's health is >= 0%, but I do plan on having bosses that summon more hornets, so I don't think that would work properly. (It might, I haven't tested, but I know it won't work if I set it once per battle, and if I set it for moment I don't think I could figure out how to set it up without it just freezing the battle, and I don't think one turn would update often enough, due to the CTB stuff). So, I was thinking a parallel process event would be what I want. So that's when I created the Track Enemies common event, I mentioned in the original post.(Track Player was completely unimportant to this issue and was only mentioned because I hadn't yet realised parallel common events only work on the map and was using it as a proof that they weren't completely bugged) Of course, after a night's rest, I'm not 100% sure a parallel process would work with that code without some tweaking, but the only other thing I can think of doing is making a passive state that every actor and enemy has that runs this code after each action, which feels really inelegant (this is also something I only realized this morning). So, hence why I'm wondering if there's a better way of doing this.

Tsukihime (I think) wrote a script for Ace for common events in battle. You could search to see if there's a similar plugin for MV
This seems like the best place to start, so here's hoping it exists and it does what I want. Still asking for solutions in the meantime, though.
 

snafets

Villager
Member
Joined
Jan 8, 2016
Messages
6
Reaction score
0
Primarily Uses
I run into a similar problem, my parallel (common) event get trigger after every attack and ignore the switch that suppose to control it. Outside of battle it work as intended. I can start and stop the event with the switch. It looks like a bug for me or is there any point I'm missing?

edit: BTW, as work around you have to place the event in a branch then checks the switch again

edit: ups messed it up my self
 
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
I run into a similar problem,
snafets, do not hijack other people's problem topics but make your own topic. Even if something looks similiar at first glance it often has different causes, and mixing up descriptions will only cause additional problems in finding a solution.
When you make your own topic, please make sure to include screenshots of your events, because from what you said I'm pretty sure the problem is something entirely different and lies in your event code.
 

snafets

Villager
Member
Joined
Jan 8, 2016
Messages
6
Reaction score
0
Primarily Uses
edit: sorry I guess you can read it both ways

I run into a similar problem, my parallel (common) event get trigger after every attack and ignore the switch that suppose to control it. Outside of battle it work as intended. I can start and stop the event with the switch. It looks like a bug for me or is there any point I'm missing?

or

I run into a similar problem, my parallel (common) event get trigger after every attack and ignore the switch that suppose to control it. Outside of battle it work as intended. I can start and stop the event with the switch. It looks like a bug for me or is there any point I'm missing?

I want to show that the parallel common event get trigger in battle and ignore the switch.
 
Last edited by a moderator:

theolis-wolfpaw

Villager
Member
Joined
Jan 4, 2016
Messages
22
Reaction score
4
First Language
English
edit: sorry I guess you can read it both ways

I run into a similar problem, my parallel (common) event get trigger after every attack and ignore the switch that suppose to control it. Outside of battle it work as intended. I can start and stop the event with the switch. It looks like a bug for me or is there any point I'm missing?

or

I run into a similar problem, my parallel (common) event get trigger after every attack and ignore the switch that suppose to control it. Outside of battle it work as intended. I can start and stop the event with the switch. It looks like a bug for me or is there any point I'm missing?

I want to show that the parallel common event get trigger in battle and ignore the switch.
I'm not 100% sure if you're experiencing the same problem I was, but if you are trying to run a common event in battle, that is marked as parallel process or autorun under the trigger it won't run, regardless of if the switch is on or not. That's not a bug, it's, for whatever reason, a feature of RPG Maker. If you hover your cursor over where it says Trigger: a pop-up explains just that. I missed that last night. I also was unable to find a plug-in that overrides that feature.

On another note, I managed to work around it. If anyone's curious I ended up making a null state that is applied at the start of battle to the entire troop and to the entire party (I made the state disappear after battle, though this is probably unnecessary). With the use of Yanfly's States and Buffs Core I put this in the state's notetag:

<Custom Turn End Effect>$gameVariables.setValue(22, 0);for (var i = 0; i < $gameTroop.members().length; i++) {if ($gameTroop.members().isStateAffected(190) == true && $gameTroop.members().isAlive() == true) {$gameVariables.setValue(22, $gameVariables.value(22) + 1);}}</Custom Turn End Effect>I also had this code run at the start of battle. So now it's counting enemies at the beginning of battle and it's doing the same after every character makes an action and is finally working. Not the most elegant solution, but it's working at the least.
 

snafets

Villager
Member
Joined
Jan 8, 2016
Messages
6
Reaction score
0
Primarily Uses
I had two common events set up one says autorun and the other parallel, both "saved" with a switch and an auto turn of, because I wanted to see the differences of both. Later I tested a battle and all the sudden I got a parallel msg after every attack. So it looks like the parallel event is trigger in battle

But I fond my mistake. Because I test something else earlier and triggered the event in/with the attack skill. Sorry about that. I thought it is related because It shows up for me :(

At least I can tell you could make a common event saved with switch and trigger it i.e. in the troop because it ignore the "save" switch when called
 

theolis-wolfpaw

Villager
Member
Joined
Jan 4, 2016
Messages
22
Reaction score
4
First Language
English
I had two common events set up one says autorun and the other parallel, both "saved" with a switch and an auto turn of, because I wanted to see the differences of both. Later I tested a battle and all the sudden I got a parallel msg after every attack. So it looks like the parallel event is trigger in battle

But I fond my mistake. Because I test something else earlier and triggered the event in/with the attack skill. Sorry about that. I thought it is related because It shows up for me :(

At least I can tell you could make a common event saved with switch and trigger it i.e. in the troop because it ignore the "save" switch when called
Oh, yeah, I knew that was how it worked. It's easy to call an event in battle, just you'd have to call it over and over again to get it to run like a parallel process event would, and that would probably just freeze up the game. XP
 

gilgamar

Veteran
Veteran
Joined
Jan 28, 2016
Messages
132
Reaction score
59
First Language
English
Primarily Uses
Bit late to the conversation but if anyone else stumbles upon this thread I found a way to run common events in battle without waiting for turn end:

action.item().effects.forEach(function(effect) {
if (effect.code === Game_Action.EFFECT_COMMON_EVENT) {
$gameTemp.reserveCommonEvent(effect.dataId);
interpreter = $gameTroop._interpreter;
interpreter.setupReservedCommonEvent();
interpreter.update()
this.refreshStatus();
}
}, this);



In this case I'm running a common event off of a skill but the main bit is reserving the event, gaining access to the interpreter (I borrowed it from $gameTroop) setting up the events and then updating. Follow up with refresh status in case you change player status during the common event.
 

Luth

Veteran
Veteran
Joined
Apr 29, 2014
Messages
129
Reaction score
54
First Language
French
Primarily Uses
Bit late to the conversation but if anyone else stumbles upon this thread I found a way to run common events in battle without waiting for turn end:

action.item().effects.forEach(function(effect) {
if (effect.code === Game_Action.EFFECT_COMMON_EVENT) {
$gameTemp.reserveCommonEvent(effect.dataId);
interpreter = $gameTroop._interpreter;
interpreter.setupReservedCommonEvent();
interpreter.update()
this.refreshStatus();
}
}, this);



In this case I'm running a common event off of a skill but the main bit is reserving the event, gaining access to the interpreter (I borrowed it from $gameTroop) setting up the events and then updating. Follow up with refresh status in case you change player status during the common event.
I'm kinda necroposting, but i'd like to know how you use it exactly ? I'd like the death state to run a common event.
Thanks for helping :)
 

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,569
Latest member
Shtelsky
Top