'Summoning' Characters in Script

TheBadShave

Very Novice Novice
Member
Joined
Oct 23, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello,
This is my first post so I hope it will be helpful.

I'm hoping to make a battle plugin that permits a character to summon another character into a blank slot in the party. Imagine something to the effect of: Summoner Casts 'Goblin with Visible Nips' -> an empty slot in the party is filled with a character named Goblin with Visible Nips. There are other factors I want involved such as removing these summons at the end of battle but I'll cross the bridge later once this part works. Baby steps, you know?

Basically in very crude pseudocode I would figure it would play out something like this:

When summon spell is cast, check if party is full.
If Full- Spell fails.
If Not Full- Continue
Get level of summoner
Create character of appropriate type in first open slot, at level of summoner.

Now I would assume that based on what little I know, I'd have to create a character for each potential summon, with it's own growths and stuff, but is it possible to populate the party during battle through scripting? Is it possible to instantiate characters into the database on the fly like that (in case there's two slots open and say the summoner wants to summon two of the same thing). I'm assuming if there's a way to populate the database in script there would also be a way to depopulate it to avoid tons of junk characters clotting up the memory.

In terms of skill level I've only done some plugin tutorials but I have a background in other languages and a JS reference so I was hoping to use this as a learning experience.

Anyhow any help would be appreciated. I'm very new to programming RPGMMV. Than
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
the biggest problem here is also the reason why there are so few summoning scripts: compatibility with other battle-plugins.

As long as you stay with the default system, you don't even need a script or plugin for summoning, you could summon any existing actor by eventing alone, absolutely no need for javascript. And most people do that for non-battle-summonings as well.

However that changes as soon as people begin to use plugins to change their battlesystems. You usually get a lot of errors if you try to summon during battles.
The reason for this is that a lot of battlesystem-plugins need additional data on the battlers to function correctly, and they usually set and define that data at battlestart only.
So if you try to add an actor during battle (no matter if by events or by script), that battler is missing the required additional data the other battleplugins need -> "UNDEFINED" errors or similiar effects are the result.

To get the summoning working, you need to be able to add that non-default data at the moment you summon your additional actor into battle. And that is only possible if you know what data the other battleplugins need and define.
So you can write a summoning plugin that will work for a specific battlesystem, but it will usually fail to work for a different combination of battleplugins.

To write a summoning plugin that works with everything, you would have to include code to identify every other battleplugin and make the correct additions for each other battleplugin.
 

TheBadShave

Very Novice Novice
Member
Joined
Oct 23, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ah I see, thanks! I wasn't even aware the in-game engine could add characters during battle. I guess I need to look into that. As for making plugins I'm not too worried about carking up the battle system because I'm only using plugins I make myself (mostly to add UI) as a learning experience. I'm leaving the battle engine wholly untouched.

I guess then my last question before this ventures out of the area of JS into scripting is if it's possible for the engine to be instructed to have multiple copies of the same character in the party at the same time and if so does it create junk data (keeping track of that character forever even though it's gone at the end of battle). The only thing I could think of to be sure was rather inelegant: having 3 copies of every potential summon and using logic in the script to have it pick each one in sequence. It seemed like a safe way to ensure the game isn't trying to remember data for the last 120 spoopy skeletons the character has summoned in old battles.

Thanks again for your reply, it really helps!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
actors need a unique ID, so yes you'll need a copy for each possible summon.
However, you can reset data on adding, that is what the initialisation checkbox on the event command to add an actor stands for. So you'll only need one actor per slot per different summoning.

How to handle different summons depends on what exectly you want - the way you mentioned is the easiest one but not the only one.
 

TheBadShave

Very Novice Novice
Member
Joined
Oct 23, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
I see, thank you this is really helpful! Sorry it ended up not being very JS related but I didn't know it could be handled outside of JS going in! Thanks a ton!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

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!

Forum statistics

Threads
106,035
Messages
1,018,459
Members
137,821
Latest member
Capterson
Top