Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Event Based Summoning

Like a lot of other creators out there, I wanted a summoning system of some sort for my game. After browsing through a lot of threads here, I had a lot of ideas, but most of the scripts (RGSS) that were written are either incomplete, or didn't have what I was looking for.

So, of course, I went and made one. It's all event based, so it can get tedious, but it does have a few advantages. This tutorial assumes you have a single character who will be summoning, not universal.

This is designed to make the following occur:

1) Make summon spells (skills), allowing the summon to occur.
2) Replace the summoner (and only the summoner, though this would be easy to change) with the Summon.
3) Allow the Summon to scale it's power based on the summoners level.
4) Allow the Summoners' XP to still gain, even if the battle ends with the summon in battle. (This was the nastiest part of this).

For this system to work, you'll need to make a PC for every summon you intend to have in the game. For each of those, set it's XP settings to match the summoner's. This way, you know that when the summoner levels up, so will the summons (and vice versa).

With that done, next you must set up your skills. Give it whatever name you want (For this example, "Air Bender"). Set it to no damage, and have it call a common script. Make one of these skills for every summon. Finally, create another skill to 'dismiss' the summon, and set it to call yet another common event. (Total number of common events will equal the number of summons, plus 1)

Now, go into common events, and script out your summons. This can include whatever you wish, but a few things must be included. First, it will need to turn on a switch (in the example here, "Summon"). Second, it will need to remove your summoner from the party and add your summon to the party. Your dismiss common event will do the opposite, and, again, can include whatever else you want to happen on screen.

With all those done (easilly), we're ready to hit the hard part - ensuring that the XP is given to the summoner, and also ensuring that the summons (including those that aren't being used all the time) are also recieveing XP and leveling up.

For this, we have one more common event we're going to create, and this one is a doosy. You will require a number of variables. For the example I'm going to use , I will only use one summon, so only three variables are needed. For each additional summon, one more variable is needed.

First thing we need to do is have the game check to see if a summon was used. So, set up a conditional branch for "Switch:Summon = ON". Now, enter a Change Party Member Command removing the summons. All of them. One command for each, so that no matter what you summoned, this one event will remove it. Following those, it needs to re-add your summoner. Finally, this needs to turn the switch for Summon back to OFF.

Now comes the fun part. Set up a series of variables like thus :

Control Variables: [0001] = [Aluxes]'s XP
Control Variables: [0002] = [Shiva]'s XP

There needs to be one variable for the summoner, and one for each summon. A third variable if for temporary calculations, and is called "TempXP".

With the variables now set (and getting reset everytime the script is run, which is important), we now have to start the calculations themselves.

This portion of the event looks like this:

Code:
Conditional Branch: Variable [0001] > Varibale [0002]
[INDENT]Control Variables: [0003] = Variable [0001]
Control Variables: [0003] -= Variable [0002]
Change EXP: [Shiva], + Variable [0003]
Else
Conditional Branch: Variable [0001] = Variable [0002]

Else
[INDENT]Control Variables: [0003] = Variable [0002]
Control Variables: [0003] -= Variable [0001]
Change EXP: [Aluxes], + Variable [0003][/INDENT]
Branch End
[/INDENT]
Branch End

I'll try to explain what this does, for those who can't muddle thier way through the code.

It first compares the summoner's XP to the summon's XP. If the Summoner's is greater (indicating the battle ended without a summon in play), it set's the summoner's XP as the Variable "TempXP", subtracts the summon's XP, and adds the result to the summon's XP. This basically sets both the summon's and the summoner's XP to the same amount.

Next, it checks to see if the XP is equal. If they are (and a lot of the time this script runs, they will be... more on this shortly), it does nothing. But if they aren't equal, and the summon's XP is greater (which, if it doesnt meet the first two's requirements, it has to be), then it does essentially the same thing as in the first branch, just reversing the values. Again, all this does is set the XP to be the same for both the summoner and summon.

*phew* OK, now that event will work for a single summon. Additional sections must be set up for each additional summon. They will look identical save for the actual variable used for the summon. Otherwise, no other changes needed.

Now that the event is set up, (here's another tedious thing, but with event based, there is no way around this...) an event needs to be set up on each of your maps where combat may occur. This even will run in Parallel Process, and will simply call the common event we just created. (This is why the check for XP equality was made - this script will be constantly running in any map that calls it. Most of the time, they will be equal. The only time they wont be will be after the battle.)

Ok, think that about wraps that up. It's not elegent, as scripting would be, but it does appear to work. If you run across any bugs let me know - as well as any small changes you'd like made that you can't figure out on your own.

Hope this helps out guys - it's a pain, but it works, and it doesn't require scripting.
 
Ya nicely done!
I had a system similar to this one, tough a little different... i didn't know how to use common event properly in map so i never worked out how to remove the summon after battle, now i know it...
 
Actually, I've been playing with this, and it still has a few drawbacks that I'm working on. Well... not drawbacks per se, but inherant exploits.

If you set it up this way, there is still the problem of HP and SP for the summoner himself resetting to full after the summon is dismissed. Conversely, the same will happen to the summon - it's HP and SP will be full every time it's summoned. If these are fine by you, great, but me? I want there to be continuity. The big trick right now to fixing this for me isn't the summoner's HP and MP. Those will be simple to fix (relatively speaking), nor the Summon's HP/MP. It's resetting the summon's HP/MP when the party rests... since the summons are only a part of the party during combat, I can't use the "Recover All" event command. This will most likely involve a lot of variable plays, but I'll get it figured out. And when I do, I'll update the original tut.

Also... as I'm not too familiar with how this particular post system works... how do you put things in collapsable windows? Scripts, screenshots, all that jazz... how is that done? WOuld help clean up the tut itself.
 
Very nice Tutorial. I plan to use it myself too. Also, I have found my own idea for getting around the HP/SP refill problem.

I plan to set it up so that summoning in my game is particularilly taxing on the energy of the summoner. The summoner's HP and SP both drop to 1 after the summon has been dispelled, or the battle ends. That way there is less chance for abuse.

Also, The summoner can only cast the summoning spell if he has at least 50% of his total health remaining. This way, the player cannot simply bring in the full health summon in place of a badly injured summoner.

Anyway, Great tutorial. ^^
 
OK, minor update to this.

I was incorrect in my second post regarding HP/SP refills on summon/dismissal. I based my original statements on Battle Tests, not full game versions. When I did, I found out that the HP/SP of non-party PCs are tracked... thus, if the summoner had 400/500 HP when he summoned, when he reappears, he will still have that 400 HP. The same goes for the summons themselves. The only way that these numbers will reset is if, when you put in the event command to call a new party member in, you also flag it as "initialize". This will reset the HP and SP, as well as level and everything else. So don't use that. Thank you.

So, the original tutorial is working perfect as is. The only steps I would add are to insure that your Summon PCs have weapons and armor to give it the suitable attack and defence values you wish. Otherwise, your summon is going to get wiped out. And we all know how painful that can be.

Which brings me to my final issue (and one I'm still working on): what happens when the summon dies. As it's setup right now, if the summon dies in battle, it will remain and be in a knockout state. Following the battle, the summon will be removed and the summoner added, and all will be back to normal. I havn't tried summoning a dead summon yet (and I think it would be a bad idea... for many reasons), but it would be simple enough to add a "Change HP" command to our XP comparison script.

Simply add another conditional branch for each summon you set up, checking for either an HP = 0, or (and I dont have the program in front of me, so I'm not sure if this exists) State = Knockout. In either case, set it up so if this condition is true, Change HP[Shiva] = 1.

This will give the summon 1 HP, meaning you wont be summoning a dead creature... but you better be ready to heal it as soon as it's called.

Also, to ensure that Inns/Tent/whatever heal the summons, you may want those events to specifically recover each summons HP/SP. Tedious, as I mentioned earlier, but it works.

I'm working on a Testbed Demo of this system, using these events and Trickster's CTB system (released in Feb). It will also feature a CMS that will allow you to directly access your summon's equipment from in-game... allowing you to get better equipment for them as well.

When that happens, I'll update the original post in it's entirety to show the full system and the tutorial demo download. Until then...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top