I'm having a small issue making some modifications to the Sapphire Action System IV by Khas.
What I am attempting to do is have all of the actors in the player's party gain EXP when an enemy is defeated, rather than just whoever is in the lead. This system allows only one actor to be on the map at a time, and while it is not intended to be used with parties, having other party members seems to have no ill effects. However, EXP is granted only to the lead character (aka the one visible on the field whom the player is controlling).
I have located the line that grants EXP after an enemy is defeated, which goes like this. It is line 1671 on an unmodified script.
actor = $game_party.members[0] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false)What this does is grant EXP to the leader of the party, regardless of which actor that may be. This works without any errors, as it should.I modified it to this in an attempt to grant to everyone in the party.
actor = $game_party.members[0] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false) actor = $game_party.members[1] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false) actor = $game_party.members[2] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false)My project features only three playable characters. The script in this state grants EXP to all three of them, but crashes if they are not all present. I believe this is because the game is attempting to give EXP to a character that isn't in the party at the time. I am looking for another method that will either grant EXP to the party without being dependent on how many actors are there. Ultimately, I would like for the lead character to gain full EXP while other members get half, but this is likely more complicated to program. The game only starts with one character, and the other two are recruited as you play, so it's necessary for EXP to be grantable no matter who is present and who isn't. My scripting skills are rather lackluster, but I am beginning to understand the most basic aspects and how to configure things. Any help on this would be greatly appreciated.
What I am attempting to do is have all of the actors in the player's party gain EXP when an enemy is defeated, rather than just whoever is in the lead. This system allows only one actor to be on the map at a time, and while it is not intended to be used with parties, having other party members seems to have no ill effects. However, EXP is granted only to the lead character (aka the one visible on the field whom the player is controlling).
I have located the line that grants EXP after an enemy is defeated, which goes like this. It is line 1671 on an unmodified script.
actor = $game_party.members[0] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false)What this does is grant EXP to the leader of the party, regardless of which actor that may be. This works without any errors, as it should.I modified it to this in an attempt to grant to everyone in the party.
actor = $game_party.members[0] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false) actor = $game_party.members[1] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false) actor = $game_party.members[2] current_level = actor.level actor.change_exp(actor.exp + @enemy.exp,false)My project features only three playable characters. The script in this state grants EXP to all three of them, but crashes if they are not all present. I believe this is because the game is attempting to give EXP to a character that isn't in the party at the time. I am looking for another method that will either grant EXP to the party without being dependent on how many actors are there. Ultimately, I would like for the lead character to gain full EXP while other members get half, but this is likely more complicated to program. The game only starts with one character, and the other two are recruited as you play, so it's necessary for EXP to be grantable no matter who is present and who isn't. My scripting skills are rather lackluster, but I am beginning to understand the most basic aspects and how to configure things. Any help on this would be greatly appreciated.