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:
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.
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.