Please help me, It's basically the only thing i need to finally start to do the graphics of my project and etc. I searched for hours here and there but I didn't find this script anywhere, really.
I have two little requests, I was trying to look for a script that when my party leader is dead, after battle, it makes the next character that is not dead, into a leader (so like this the leader will appear in map), example:
(http://puu.sh/3a640.png)
Link > This was exactly what I wanted, but it's for VX ACE and I want one for RPG maker XP, I didnt find a script for this though.
The second request it's that I'm using a script to make me change the leader of my party manually (Link to the script), the problem is that when the leader or another character is dead, I still can choose them, I would want to the character's name in options to be disabled, like on the image bellow:
(http://puu.sh/3a1Jl.png)
I hope it's easy to understand what I really want...I am really sorry for my bad english too;;
This will solve your first issue.
#===============================================================================
# Switch Lead if Dead
# Version 1.0
# Author gameus
#-------------------------------------------------------------------------------
# Cycles through all actors and changes party leader if one or more are dead.
#===============================================================================
class Scene_Map
alias gg_check_party_leader_init_lat main
def main
for i in 0...$game_party.actors.size
if $game_party.actors[i].dead?
$game_party.actors.push($game_party.actors.pop)
end
end
gg_check_party_leader_init_lat
end
end
Place above main and below all other scripts.
As for your second request, this can be done through eventing. You can do a conditional branch and check to see if the Actor has the "Knockout" state inflicted. But since I'm in a programmy kinda mood. I'll make a simple menu scene that you can call up anytime and have the player choose his leader.
EDIT: Here you go. Just call using:
$scene = Scene_Switcher.new
(http://puu.sh/3anuE.png)
#===============================================================================
# Switch Leader
# Version 1.0
# Author gameus
#-------------------------------------------------------------------------------
# Lets you choose a new leader only if the new leader isn't dead.
#
# Instructions:
# Call using
# $scene = Scene_Switcher.new
#===============================================================================
class Scene_Switcher
def main
@spriteset = Spriteset_Map.new
@help_window = Window_Help.new
@help_window.set_text("Choose a new leader.", 1)
@help_window.back_opacity = 128
@names = []
$game_party.actors.each { |actor| @names.push(actor.name) }
@command_window = Window_Command.new(200, @names)
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
color = actor.dead? ? @command_window.knockout_color :
@command_window.normal_color
@command_window.draw_item(i, color)
end
@command_window.opacity = 128
@command_window.x = 220
@command_window.y = 240 - @command_window.height / 2
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@command_window.dispose
@help_window.dispose
end
def update
@spriteset.update
@command_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
elsif Input.trigger?(Input::C)
if $game_party.actors[@command_window.index].dead?
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
actor = $game_party.actors[@command_window.index]
$game_party.actors.delete(actor)
$game_party.actors.insert(0, actor)
$game_player.refresh
$scene = Scene_Map.new
end
return
end
end
end
Thank you so much, so so much for the second script. All the change leaders scripts I found always lack this detail and I saw some people looking for it too, it's sure a big help! Ran perfect here.
but The first script runs the game without errors but still not works, like, the leader dies but he still not changes his position of leader to the next member alive (or change his leader position to the next member alive and comes to the last character of the party position):
(http://puu.sh/3as4q.png)
thank you also for the help I hope it's not a big nuisance...!
EDIT: nevermind, I did it! With some help of another script that is not i what i exactly want but changes the leader position (link (http://forum.chaos-project.com/index.php?topic=11993.0;wap2)) i got some lines and put in your script. Maybe it has some not necessary lines but it's working perfect here!!
Here is the code of how it turned:
class Scene_Map
alias gg_check_party_leader_init_lat main
def main
for i in 0...$game_party.actors.size
if $game_party.actors[i].dead?
$game_party.actors.push($game_party.actors.pop)
party = $game_party.actors.shift
$game_party.actors << party
party = $game_party.actors.pop
$game_party.actors.unshift(party)
$game_player.refresh
else
party = $game_party.actors.pop
$game_party.actors.unshift(party)
$game_player.refresh
end
end
gg_check_party_leader_init_lat
$game_player.refresh
end
end
thank you for the help!!
Just as a side note, if you have any events that could potentially kill an actor on the map, it will not make any changes to party order.
That's true. I didn't think about that. I was just being lazy and hasty I guess. ;p
Don't worry, I actually put the automatic change script in game_map (def update) too, so the map actually updates and if the leader is dead the same automatic change thing is done ~ ;) thanks so much for the help again
So I was rethinking this, and I'm pretty sure I just simplified it the best I could.
class Scene_Map
alias gg_upd_leader_dead_lat update
def update
if $game_party.actors[0].dead?
$game_party.actors.push($game_party.actors.shift)
$game_player.refresh
end
gg_upd_leader_dead_lat
end
end
I tested this out myself and it seems to be working just fine.