Seeking Script solution for specific Monster-Capture system [Solved]

Chris_Pitre

Villager
Member
Joined
Jan 9, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm going to try and be as detailed as I can, this is a Script Request, but it comes from days of trying to utilize a series of common events and script calls to hodge-podge a graphical monster-catching ("Taming") system. I'm an intermediate RPG-Maker with fair knowledge on XVXAce and XP (default systems and configuration, not scripting) and extensive knowledge on 2k3. So I have a grasp on terminology and modestly complex procedure.

The game in question is a reboot of an obscure 90s Pokemon Rip-Off that was conceptualized before Pokemon was a thing. It performed and was terrible, but I have a sentimental soft spot for it, so here I am.

In this project, every target enemy (BattlePet) you encounter is a candidate for being tamed, which I initially intended to be handled via common-eventing by linking it to be called from an assigned "Tame" skill when used in a fight. The Common event would check the enemy ID to see if it has the state "DEAD", and if not, fade out the BGM and display a capture animation. From there, a script call would start a mini-game (I am using a plug-in-play script for this, Sixth's "Stay in Range" minigame) along with a minigame BGM. If you fail, the capture is unsuccessful, and if you succeed, the capture is successful. Your party would be checked if it was full, if not, the BattlePet is added to the party, if so, sent to a reserve station (I haven't configured a system to handle that part yet, I will likely use a specific Party script).

The main problem I am encountering is programming the skill to recognize specific Monster IDs selected when the skill was used. If, for example, the Protagonist uses "TAME", a Skill with an enemy targeting scope of "ONE ENEMY", on "AZURA" (Monster ID 1).

The skill calls the Common event "TAME", which fades out BGM, which then has to use an animation-- but on what? I can manually select Monster IDs of 1-8, or the entire troop, but I can't configure it to continue the action on the designated target ID.

When using RPG Maker XP, this was managed if the skill was offensive, I could have the common event manually use branching events to determine if Monster ID 1 had the "DEAD' state, if yes, skip to 2, if not, proceed with attack.Since RMXP had no, "attack 2/3/4 random targets" scope in their skill creation, this was a minor innovation to the default system.

But for an idea like this, that just won't work. And so in my frustration, I decided to just ask if such a script was possible, exists, or could be quickly whipped up.

The only time the "TAME" command should not work is on certain key encounters like specific Boss Battles, which, if I could've gotten the Common Eventing system to work, could have just been mitigated by removing the Tame feature in a Battle Troop event. I realize if a Script was made, it could be done in such a way so I could simply add <Cannot Tame> in an Enemy Note Tag and there we go.

Anyway;
For a script, I'm fairly flexible and can work with anything. The base features should include the Taming feature for capture when a Skill assigned to it is used; A Ratio of success rate either determined by a minigame which I had originally planned (and by default, is run via script call: Instructions in the Script were;

"To start a mini-game, use the following script call:

start_range_game(key,x,y)

Replace 'key' with a key you used in the 'Games' settings in the script!
Replace 'x' and 'y' with the X and Y co-ords you want to show the mini-game images!
All image positions are centered! So, the X and Y positions do NOT mean the top left corner of images, but the center of them!

Examples: start_range_game:)easy,120,240)
start_range_game:)hard,230,146)"

However, a more simple way of determining capture success with HP ratios and/or added status ailments is also perfectly fine.

The third feature should at least allow me to include a start capture animation, successful capture animation and failed capture animation. So a battle animation would play; Algorithms would then take place to determine success rate, then an animation plays over the target to signify a successful or failed capture; Then the BattlePet is either added to your active party, or, if that is full, either terminate the capture process with a failure ("Your party is already full!") or shuffle the captured BattlePet to a party reserve screen which can be script called later to manage one's party of BattlePets.

An optional wish is a BGM control, but if a minigame is too complex to include in a scripting solution, this may not be necessary, and I may be able to just add BGM control around the script in use anyway.

Thank everyone for reading and consideration.

EDIT: Relevant Info; I am using Luna Engine, building on top of the Premade Demo "Etrian", which I am largely using for it's cosmetic design with custom modifications. It is compatible with Yanfly's scripts, but I know I should mention it just in case.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,425
Reaction score
7,710
First Language
German
Primarily Uses
RMMV
I think one of your problems might come from your mixing up the difference between enemy ID and enemy index, which is NOT the same.
In the troop events you can select the index from #1 to #8. That is what the troop is defined of, the enemies in the order they were added. However that is NOT the enemy ID (the number of the enemy on the enemy tab in the database. Just think about it - if you were to fight a troop of eight bats, then all bats would have the same enemy ID#1 (from the database) while each bat would have a different index (from #1 to #8).
 

Chris_Pitre

Villager
Member
Joined
Jan 9, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
I took pictures with my phone but it would not boot on this message board here.

But, no. I don't think so. For one (we'll use the Show Battle Animation on the Battle section of the event columns) simply states "Enemy" on the first tab (listing "Entire Troop" then 1-8) and on the bottom the "Animation", self-explanatory.

Secondly, when I select any number it very clearly corresponds to the ID of the enemy placed in the given troop this event is taking place in. Whereas if the common event called upon an entirely different troop during a battle that isn't even happening when the skill calling the common event was used, the system should potentially crash for failing to identify the enemy ID in question (since it isn't even located in the current Troop encounter).

Edit: Oh, I see what you're saying. But regardless of this the BATTLE section in the event columns has no other method of differentiating the enemy indexes outside of troop IDs added in the order they were entered into the troop. Show Battle Animation, Force Action, etc. All relies on this one rigid enemy targeting system, which doesn't seem to be able to focus it's actions on the troop ID selected by the skill calling the event to occur.

Or rather, I haven't found a way to bypass and make it happen.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,425
Reaction score
7,710
First Language
German
Primarily Uses
RMMV
then you still need to call it by its correct name, because as soon as you get into scripting the battler has both id and index, and the number you're talking about is still the index variable and not the id variable.

which doesn't seem to be able to focus it's actions on the troop ID selected by the skill calling the event to occur.
the index should be handled correctly by the engine, unless you're doing something wrong.
please give us a screenshot of both the skill and the event, then we might be able to find out where it went wrong.
 

Chris_Pitre

Villager
Member
Joined
Jan 9, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
Screenshot (1).png

So, in battle, you would be able to use the Tame command in order to capture enemy targets you encounter, it would work by selecting the command, and then selecting the target BattlePet you wish to catch, and then the following program I tried to code would happen;

Screenshot (2).png

What I did was program one of the blank Skill slots to target an enemy, which would be the target the player wishes to capture, and then run a Common Event which would step the player through the process of Capture.

Screenshot (3).png

It was on this Common Event page that it hit me. The process I conceptualized should have worked like this (and would have required tinkering once I started bug testing it, but);

First, the Skill calls the Event, which would fade out the BGM and wait a moment so the screen doesn't clutter with instant effects. From there, Show Battle Animation on the selected target to Capture; from there, run the mini-game script using either the"High_Score" variable control to determine success rate (say, setting the capture rate to requiring a score of 5000 or whatever); Or, just "success and fail", from there, a successful or failure capture animation; Then a branch effect to see if the Player Party is full, etc. Etc (I'm confident I can manage that on my own).

So, my problem hit very early on.

Screenshot (4).png

The first step was to show the battle animation on the target selected by using the Tame Command, but there is no default way to select that target when using "Show Battle Animation" from a Common Event.

When I was saying, "Enemy ID", I was referring to this section here;

Screenshot (5).png

Unless I set a complicated Branching Event that manually checks if each ID has the State "DEAD" and then skips onward until it finds a live candidate, I can't figure a way to bypass this targeting scheme. I'm not scripting, nor using Luna Engine to configure this, just the default systems.

That's why I decided to ask if there was simply a "Monster Catching Script" that was coded in a way that compliments what I'm trying to do with this project;

If you know a way I can manage the targeting system using default commands (as in, if I'm simply an idiot who was going about this the wrong way altogether), that would also save my butt.
 

Chris_Pitre

Villager
Member
Joined
Jan 9, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
I should also probably include if it helps clarify that, in accordance with the distinction of Monster Index VS Troop ID, the actual Party Member (the captured BattlePet) being recruited after Capture is not relevant to the monster actually being fought. BattlePets would be set as their own individual actors and classes, and when recruited, would join the party at that default state.

So if you captured a Mookie who was poisoned, sleeping and near death, the Mookie added to your party would still be the default Monster on Actor #2. If you went back at Lv 32 and caught another, or caught a different Mookie in a different area, it would be the same BattlePet set to the same Actor #.

The only target ID I'm concerned with is during battle. When animations and visual cues need to be displayed.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,425
Reaction score
7,710
First Language
German
Primarily Uses
RMMV
You're overthinking it - there are easy solutions if you just take a step back in your sequence.

Your main problem is that the skill does not transfer its data to the common event it calls. You need something to transfer that data, and there are two ways to do this - with and without a script.
If you're looking for a scripted solution I suggest you go to himeworks.com. I don't remember the name of the script, but tsukihime wrote an Ace-Script that added storage variables for battledata to the engine, allowing the common events to access the data of the skill they had been called from (including target etc).

If you want to do this without scripts, the trick is to add an invisible state.
You create a state "targeted" that has no messages and no icon etc. You then add that state as an effect to the capture skill, the same that calls the common event.
Now you need to add a series of conditional branches to the beginning of the event, checking each of the eight indexes if the enemy in that index has been affected by that state. As soon as you find the enemy with that state you know which enemy the skill was targeted at.

Don't forget to remove the state in the event (so if the capture fails the next turn doesn't identify the same state again) and make sure that the skill can't be used twice in the same battleturn (if it can be used multiple times you'll need to write the common event in a way that handles multiple states - possible but more work)
 

Chris_Pitre

Villager
Member
Joined
Jan 9, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
Oh! States!! That sounds perfect! Thank you so much!
 

Chris_Pitre

Villager
Member
Joined
Jan 9, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'd just like to follow up that I have programmed the Taming system using the State method and not only did it work perfectly, I even managed to include the minigame feature necessary to capture the target.

Screenshot (6).png

Screenshot (8).png
Screenshot (9).png
Screenshot (10).png
Screenshot (11).png
Screenshot (12).png
Screenshot (13).png

It needs a little polishing of course, but the meat of the system is up and running! Thank you again!

The only issue I encountered while sequencing this was finding a way to make the targeted enemy vanish until a Tame Failure animation finishes,so that the enemy would vanish during the Tame Start animation, then re-appear after the shattering effect of the Tame Failure animation.

At first I was thinking of using Enemy Transform and have them transform into a blank Monster ID with no graphics set, but that didn't seem to work and created complications when I intended them to transform back.

For now, the enemy graphics stay as they are and if the Taming succeeds, the battle is aborted. If it fails, the BGM is replayed from it's Save and the battle continues.

Again, thank you so much!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,425
Reaction score
7,710
First Language
German
Primarily Uses
RMMV
only one advise:
I said that the state should have no messages and no icon, but I never said that it should have no name.
Quite on the contrary it should have a name so that your checks are using that name:
"[tame rargeted] inflicted" instead of "[] inflicted"
It doesn't matter for a single such state, but if you ever have a more complex case where you need several states, then you need the name to find out which invisible state is where - and the name is never displayed to the player if the state has no messages, so it doesn't matter there.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,358
Members
137,803
Latest member
andrewcole
Top