Hime party manager

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
Ah as I suspected $gameMap.idlePartyEvent(#) doesn't give the event ID but the entire object.
View attachment 146529

$gameMap.idlePartyEvent(#)._eventId is how you get the event ID for the other parties.

So for party 2 it would be....
JavaScript:
Math.round($gameMap.distance($gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y, $gameMap.event($gameMap.idlePartyEvent(2)._eventId).x, $gameMap.event($gameMap.idlePartyEvent(2)._eventId).y) <= 1)
There is a problem here though. Any party the player is in control of no longer counts as an event but instead the player object. So if the player controls party 2, then this code would error as party no longer exists. So to get around that, you need to encase it in a conditional to check if the $gameMap.idlePartyEvent(#) is undefined.... Else you'll get an error every frame.

View attachment 146530


Finally, because the player object is a potential thing the enemy can encounter, you'll need a conditional statement just for that....
JavaScript:
Math.round($gameMap.distance($gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y,
$gamePlayer.x, $gamePlayer.y) <= 1)
in a conditional will work. You don't have to worry about this one being undefined as the player is always somewhere on the map.
Okay I noticed one problem. When the enemy unit comes in contact with 1 of my idle parties a battle engages, but the party that is engaged in battle is the party under my control and not the idle party.
 

ImaginaryVillain

Resident of Silent Hill... Apparently
Veteran
Joined
Jun 22, 2019
Messages
700
Reaction score
3,639
First Language
Absurdism
Primarily Uses
RMMV
Add the party switch trigger to that party in the conditional statement.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,374
Reaction score
5,031
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
After doing some game testing I realized that the idle party is engaging in battle twice so that means that the battle processing is going twice and I don't know why. Everything else is working perfectly. I tried all sorts of things to make it stop engaging in battle twice but nothing works. Here's how I have my parallel event working.
Code:
◆If:Script:$gameMap.idlePartyEvent(1) !== undefined
  ◆If:Script:Math.round($gameMap.distance($gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y, $gameMap.event($gameMap.idlePartyEvent(1)._eventId).x, $gameMap.event($gameMap.idlePartyEvent(1)._eventId).y) <= 1)
    ◆Script:Party.switch(1);
    ◆Battle Processing:Advance Scout
    :If Win
      ◆Control Self Switch:A = ON
      ◆
    :If Escape
      ◆Set Movement Route:Player (Wait)
      :                  :◇Script:this.jump_to(4,0)
      ◆
    :If Lose
      ◆Set Movement Route:Player (Wait)
      :                  :◇Script:this.jump_to(4,0)
      ◆
    :End
    ◆
  :End
  ◆
:End
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,553
Reaction score
3,789
First Language
English
Trying showing a message before the party switch, after the party switch, and after the battle processing.

See how many messages get triggered.

The logic seems fine but parallel processing might do something weird.
Or it could be related to that Party.switch (when the player takes control of the party)

Anyways if it's executing twice, you should see two sets of messages.
If you disable the parallel process does nothing happen as expected?
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
Trying showing a message before the party switch, after the party switch, and after the battle processing.

See how many messages get triggered.

The logic seems fine but parallel processing might do something weird.
Or it could be related to that Party.switch (when the player takes control of the party)

Anyways if it's executing twice, you should see two sets of messages.
If you disable the parallel process does nothing happen as expected?
Code:
◆If:Script:$gameMap.idlePartyEvent(1) !== undefined
  ◆If:Script:Math.round($gameMap.distance($gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y, $gameMap.event($gameMap.idlePartyEvent(1)._eventId).x, $gameMap.event($gameMap.idlePartyEvent(1)._eventId).y) <= 1)
    ◆Text:None, Window, Bottom
    :    :Come and join us. Ignorance is bliss when you are part
    :    :of the nexus.
    ◆Script:Party.switch(1);
    ◆Battle Processing:Advance Scout
    :If Win
      ◆Control Self Switch:A = ON
      ◆
    :If Escape
      ◆Set Movement Route:Player (Wait)
      :                  :◇Script:this.jump_to(4,0)
      ◆
    :If Lose
      ◆Set Movement Route:Player (Wait)
      :                  :◇Script:this.jump_to(4,0)
      ◆
    :End
    ◆
  :End
  ◆
:End
so I figured it out. I needed to insert a text box in front of the party switch script command. The text would read twice, once before the battle processing and again after the battle processing, but at least the player will not have to fight two battles.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,553
Reaction score
3,789
First Language
English
I think we still need to figure out why parallel process event does that lol.

Game message processing basically interrupts it

Basically a parallel process should stop at the battle trigger. Once the battle is over, it will check the result and continue. If the battle gets called twice, there's something weird happening.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,808
Reaction score
1,267
First Language
EN
Primarily Uses
RMMZ
@Tsukihime: it might be related to the reserveTransfer call in Game_Player.prototype.refreshPartyLocation (HIME_PartyManager). Maybe try adding something like interpreter.setWaitMode('transfer'); immediately after so it pauses 1 frame for the transfer to complete? :kaoswt:

(Each parallel event runs through an interpreter attached to the event itself, so when the map changes, all parallel events stop where they are.)

Edit: oh wait, that's awkward because you don't know which interpreter to reference from that context... :kaoslp:
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,553
Reaction score
3,789
First Language
English
@Tsukihime: it might be related to the reserveTransfer call in Game_Player.prototype.refreshPartyLocation (HIME_PartyManager). Maybe try adding something like interpreter.setWaitMode('transfer'); immediately after so it pauses 1 frame for the transfer to complete? :kaoswt:

(Each parallel event runs through an interpreter attached to the event itself, so when the map changes, all parallel events stop where they are.)

Edit: oh wait, that's awkward because you don't know which interpreter to reference from that context... :kaoslp:
I set up a simple project. 2 MB.


One map, one event top-left

Page 1: create party 2 right below the event, turn on self switch A to go to page 2

Page 2: move event down (through on). Check if event position == party 2 position. If so, battle processing, then turn on self-switch B to go to page 3

Page 3: nothing

It only triggers it once for me though.

EDIT: wow you can actually browse the files right in the forum. Anyways pop it out to download as archive.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
I tried setting up 1 of my enemy units according to the example that was given to me, but for some reason now the unit won't even engage in battle. If you have time please download my project and see. All you have to do is start on the map "Path to Ambush4"
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,808
Reaction score
1,267
First Language
EN
Primarily Uses
RMMZ
One map, one event top-left

Page 1: create party 2 right below the event, turn on self switch A to go to page 2

Page 2: move event down (through on). Check if event position == party 2 position. If so, battle processing, then turn on self-switch B to go to page 3

Page 3: nothing

It only triggers it once for me though.
Yea, I can't get it to run twice either... :kaoslp:

I was focusing on the "runs twice" thing and thinking it was related to Scene_Map.prototype.updateMain updating in the order events > player > change scene. Not sure about that though.
If you have time please download my project and see.
Whoa, 1.2 GB! :kaoback: Can you maybe reproduce the effect by copying the relevant events into Hime's little sample project? :kaoswt:

Something you could try is turning off your other plugins, since this particular scenario only needs Hime's Party Manager (correct?). If it works OK with the other stuff turned off, it's probably a plugin compatibility or load order issue.

(An aside: I notice that amongst other things you seem to have my OverpassTileExt plugin in there. If you want to use it, I'd suggest naming the file Cae_OverpassTileExt, else it won't see its own plugin parameters. Also, I think it replaces all the methods from the original OverpassTile plugin. :))
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,553
Reaction score
3,789
First Language
English
1.2 gigs is way too big for a simple example lol can you download the example I have and copy the event over.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
Yea, I can't get it to run twice either... :kaoslp:

I was focusing on the "runs twice" thing and thinking it was related to Scene_Map.prototype.updateMain updating in the order events > player > change scene. Not sure about that though.

Whoa, 1.2 GB! :kaoback: Can you maybe reproduce the effect by copying the relevant events into Hime's little sample project? :kaoswt:

Something you could try is turning off your other plugins, since this particular scenario only needs Hime's Party Manager (correct?). If it works OK with the other stuff turned off, it's probably a plugin compatibility or load order issue.

(An aside: I notice that amongst other things you seem to have my OverpassTileExt plugin in there. If you want to use it, I'd suggest naming the file Cae_OverpassTileExt, else it won't see its own plugin parameters. Also, I think it replaces all the methods from the original OverpassTile plugin. :))
Yeah I'll do that. My project when deployed is only 400 mb because I exclude unused files. I have a bunch of unused stuff in there :) I'm a noob and this is my first project so I'm trying alot of crazy stuff that never works.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
1.2 gigs is way too big for a simple example lol can you download the example I have and copy the event over.
Ok I figured it out. I have to set all my movement routes to through on then only will the battle engage. You know I was thinking, this plug-in can be used to do some really cool things. With some small tweaks like overhead map with pause option, a cursor to select parties, some minor AI for the enemy event parties, it would be easy to create a game like ogre battle. I don't think this would conflict with any other yanfly plug-in. Have you ever played ogre battle?
 
Last edited:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,553
Reaction score
3,789
First Language
English
Ok I figured it out. I have to set all my movement routes to through on then only will the battle engage. You know I was thinking, this plug-in can be used to do some really cool things. With some small tweaks like overhead map with pause option, a cursor to select parties, some minor AI for the enemy event parties, it would be easy to create a game like ogre battle. I don't think this would conflict with any other yanfly plug-in. Have you ever played ogre battle?
I haven't played ogre battle but that sounds like a creative use of the plugin.
You can also bind party switch to a button like page up or page down to go through the parties on the map and try to do micro manage each party to optimize something

If you manage to get something working share a video it'd be interesting to watch.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
I haven't played ogre battle but that sounds like a creative use of the plugin.
You can also bind party switch to a button like page up or page down to go through the parties on the map and try to do micro manage each party to optimize something

If you manage to get something working share a video it'd be interesting to watch.
In my game I already bound party switch to a button like page up. But I am only able to bind one script call to one button. Is it possible to bind more than one script call to one button. I would love for the player to able to scroll through their parties using just page up and page down. Right now I have page up bound to switch to party 1, page down party 2, shift-3, ok-4, and so on.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,553
Reaction score
3,789
First Language
English
In my game I already bound party switch to a button like page up. But I am only able to bind one script call to one button. Is it possible to bind more than one script call to one button. I would love for the player to able to scroll through their parties using just page up and page down. Right now I have page up bound to switch to party 1, page down party 2, shift-3, ok-4, and so on.
You can have the script call check the current party number and increase or decrease by 1. If it's the smallest or largest ID, wrap around.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
You can have the script call check the current party number and increase or decrease by 1. If it's the smallest or largest ID, wrap around.
I read and reread your help manual, but I didn't come across a script for checking current party number per se. I assume maybe you're speaking of "Active Party Variable" which I'm supposed to add and subtract from. Do you have a link or example I can follow. My mind is not the most mathematical mind and this stuff is really hard for me to understand. Thanks so much. Here's a link to Ogre Battle one of my fav old school rpgs .
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,553
Reaction score
3,789
First Language
English
I read and reread your help manual, but I didn't come across a script for checking current party number per se. I assume maybe you're speaking of "Active Party Variable" which I'm supposed to add and subtract from. Do you have a link or example I can follow. My mind is not the most mathematical mind and this stuff is really hard for me to understand. Thanks so much. Here's a link to Ogre Battle one of my fav old school rpgs .
I looked at the plugin and there isn't an easy to scroll between parties.
One way is this
Code:
var parties = $gameParties.parties();
var index = parties.indexOf($gameParty);
var newIndex = index + 1;
if (newIndex >= parties.length) {
   newIndex = 0;
}
var newPartyId = parties[newIndex].id;
Party.switch(newPartyId);
What this code does is first you grab all the parties in the game, which gives something like this

Code:
[Party1, Party2, Party3]
Then you figure out the position of the current party which is $gameParty.
Assuming we're currently Party 3, it will give you 2, because the index starts with 0 instead of 1

So now you have the index of the current party. You want to find the next party, which we'll assume is just index + 1

But because we're already the last party, we need to make sure we wrap around to the first in the list, which is what the condition check is for.

Finally, now you have the index of the party, you grab the party from the list, get the ID, and then call Party.switch as usual.

It's similar logic if you want to scroll backwards

Code:
var parties = $gameParties.parties();
var index = parties.indexOf($gameParty);
var newIndex = index - 1;
if (newIndex < 0) {
   newIndex = parties.length - 1;
}
var newPartyId = parties[newIndex].id;
Party.switch(newPartyId);
Now if you bind one to page up and the other to page down, now you should be able to scroll through all of your parties.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Hello I buyed RPG Maker VX Ace a long ago and I want to use it again but in the meantime I changed my pc but I lost the paper with my product key on so I can't use RPG maker again... someone can help me please ? or there is no hopes ?:'( ( I have a bad english I'm sorry )
I was away this days here in the forum but it was for a good cause!
The trailer of the demo of Luke Inn is on youtube and I am so happy!
I need to see the bugs of the game but I am happy that I have new content to show!

The last part of the modern interior will be ready soon. This will be a B-tile. With interior items for the kitchen, bathroom, toilet and storage room.
This frantic shooting ARPG plugin for MZ looks really great. Here is the link to a post from the official Japanese RPG Maker forum.

Forum statistics

Threads
102,941
Messages
996,125
Members
134,397
Latest member
Harwin
Top