[XP] Easy Party Switcher

Started by Blizzard, January 09, 2008, 04:30:52 pm

Previous topic - Next topic

Blizzard

Don't worry, Omega. I have time today, I will check what's wrong after I am done posting.

@Zeldaknight: Didn't you send me the demo regarding CRLS? Anyway, my anwser is in the CRLS topic.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

omegapirate2000

Spoiler: ShowHide

Blizzard

There you go. It was a problem with SDK, not the script by Seph.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

omegapirate2000

October 20, 2008, 06:39:21 pm #63 Last Edit: October 20, 2008, 06:47:57 pm by omegapirate2000
Great fix, but I posted sephs script because it freaks out when I switch the second party member out for an empty slot, I'm guessing because it doesn't take the script into account when it calculates SP, I'll make a topic about it in script requests, thanks!

Topic is here:

http://forum.chaos-project.com/index.php?topic=2026.0
Spoiler: ShowHide

Memor-X

is there a way to have characters that must_be_in_party locked in the position they are in, like having the leader of the party unable to be removed from the party and always being first in the party

Starrodkirby86

A feature like would be very popular, so Blizzard must have put it in there. And indeed he did. Locate this part in the instructions:
#   Other syntaxes:
#     $game_actors[ID].not_available = true/false
#     $game_actors[ID].disabled_for_party = true/false
#     $game_actors[ID].must_be_in_party = true/false
#     $game_actors[ID].forced_position = nil/0/1/2/...
#   OR
#     $game_party.actors[POS].not_available = true/false
#     $game_party.actors[POS].disabled_for_party = true/false
#     $game_party.actors[POS].must_be_in_party = true/false
#     $game_party.actors[POS].forced_position = nil/0/1/2/...
#
#   ID  - the actor's ID in the database
#   POS - the actor's position in the party (STARTS FROM 0, not 1!)
#
#   not_available
#   - will disable the possibility of an already unlocked character to be in
#     the current party
#
#   disabled_for_party
#   - will cause the character NOT to appear in the party switch screen at all
#
#   must_be_in_party
#   - will cause the character to be automatically moved into the current party
#     and he also cannot be put in the reserve
#
#   forced_position
#   - will enforce the player to be at a specific position in the party, set
#     this value to nil to disable this feature, use it in combination with
#     must_be_in_party and $game_party.forced_size or you might experience
#     bugs,
#


I don't know where you put these, so read the instructions comprehensively, my friend.

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Punn

I don't know if this was intended but I was too busy playin my game and I went to the possibly dangerous area of the game and manage to find a safe spot, everyone damage or KO'd, so I went in and heal my ass, and then when I try to switch to the tank actor, he isn't recovered along with the reserved party...

Blizzard

The event command that can heal only heals one actor at the time or the entire party. Since the reserve party isn't actually the current party, nothing happens. You can do it with a script call, though.

This one heals the reserve party if it exists:

if $game_system.stored_party != nil
  $game_system.stored_party.each {|actor| actor.recover_all}
end


This one heals all actors:

(1...$data_actors.size).each {|i| $game_actors[i].recover_all}
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

X-Law

I found a bug in the demo, just following the autorun event got an error, tomorrow i'll post the exact error, with a screen if possible
But in the meantime, just wonder if possible to have the option to change the party in the window command instead of in party_command? Maybe using the CRLS style, i mean the swap_command style.

AlbatrosStorm is on sale now!

G_G

Quote from: Rival Blizzard on May 07, 2009, 03:35:02 am
The event command that can heal only heals one actor at the time or the entire party. Since the reserve party isn't actually the current party, nothing happens. You can do it with a script call, though.

This one heals the reserve party if it exists:

if $game_system.stored_party != nil
  $game_system.stored_party.each {|actor| actor.recover_all}
end


This one heals all actors:

(1...$data_actors.size).each {|i| $game_actors[i].recover_all}



Would this work?

(1...$data_actors.size).each {|i| $game_actors[ID].not_available = true}

Blizzard

Quote from: X-Law on May 07, 2009, 08:35:09 pm
I found a bug in the demo, just following the autorun event got an error, tomorrow i'll post the exact error, with a screen if possible
But in the meantime, just wonder if possible to have the option to change the party in the window command instead of in party_command? Maybe using the CRLS style, i mean the swap_command style.


I'm not going to implement it.
And it's possible that there is an error since I usually don't test the entire system thoroughly when I make a new version. I usually only make some shallow testing to see if everything works fine. If it's a bug in the demo only, then it's not a bother.

Quote from: Youngster Gi Gi on May 07, 2009, 11:29:16 pm
Would this work?

(1...$data_actors.size).each {|i| $game_actors[ID].not_available = true}



(1...$data_actors.size).each {|i| $game_actors[i].not_available = true}
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Pm6583

Hi firstly I would like to say hi to everyone as I am new to this forum.

And secondly i have a question.

I have Implemented this script in the the menu so the party switching window can be seen from there, But is there anyway I can disable it in the menu until a certain point in the game when I want it to appear.

Any help would be appreciated

Thanks in advance
Centra Rise of Tiamut



In production.

Destiny's are created to be fulfilled, Just like proficies

G_G

you want the command disabled at certain times? Is that what you're asking?

If so post your menu here and I'll do it for you. The menu not the script.

Pm6583

Spoiler: ShowHide
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "Party"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when 5  # Party
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_PartySwitcher.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 1  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end


There you go (If thats what you wanted lol) and thanks, Nice to find some nice people here lol
Centra Rise of Tiamut



In production.

Destiny's are created to be fulfilled, Just like proficies

G_G

Spoiler: ShowHide
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================
class Game_System
  attr_accessor :party
  alias re_init_party initialize
  def initialize
    re_init_party
    @party = true
  end
 
end

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "Party"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    if $game_system.party == false
      @command_window.disable_item(5)
    end
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when 5  # Party
        # Play decision SE
        if $game_system.party == false
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_PartySwitcher.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 1  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end



Use
$game_system.party = true/false

true means you can use the party command
false means you cant

Pm6583

Centra Rise of Tiamut



In production.

Destiny's are created to be fulfilled, Just like proficies

Paladin295

Hello, this script seems to be exactly what I have been looking for, to use with my project. I do have a few questions though.

Within the instructions of the script:

"Compatibility:
#
#   98% compatible with SDK v1.x. 90% compatible with SDK 2.x. Can cause
#   incompatibility issued with other Party Change Systems. Can cause problems
#   with CBS-es if you use the battle switch feature. WILL corrupt your old
#   savegames."

1. Could someone explain how this will corrupt old saved games? Does this mean saved games that your playing through or actual saved project files? Is there any way this script could harm my saved project files?


2. "Script

Just make a new script above main and paste this code into it."

Could anyone elaborate on this somewhat? Where do I add this script at, in the script editor? What parts of the script do I add?


3. Is there any more detailed instructions listed somewhere, for those of us who have little experience with using scripts? Maybe a step by step tutorial?


4. I assume it is possible to disable the in battle party member switching function? Would it also be possible to change it so that in certain battles, the player is prompted to switch another party member in only in exchange for those party members who have already been knocked out?


Thank you very much for making this script! I also very much appreciate the time anyone has spent reading my post here and answering my questions, thank you. I look forward to hearing back from you.

Blizzard

May 23, 2009, 08:58:24 pm #77 Last Edit: May 23, 2009, 09:08:51 pm by Blizzard
Quote from: Paladin295 on May 23, 2009, 08:43:27 pm
"Compatibility:
#
#   98% compatible with SDK v1.x. 90% compatible with SDK 2.x. Can cause
#   incompatibility issued with other Party Change Systems. Can cause problems
#   with CBS-es if you use the battle switch feature. WILL corrupt your old
#   savegames."

1. Could someone explain how this will corrupt old saved games? Does this mean saved games that your playing through or actual saved project files? Is there any way this script could harm my saved project files?


No. I means that you shouldn't load savegames that were saved before you added this script into the game.

Quote from: Paladin295 on May 23, 2009, 08:43:27 pm
2. "Script

Just make a new script above main and paste this code into it."

Could anyone elaborate on this somewhat? Where do I add this script at, in the script editor? What parts of the script do I add?


Yes. All of it. How to add a script and the recommended order for scripts.

Quote from: Paladin295 on May 23, 2009, 08:43:27 pm
3. Is there any more detailed instructions listed somewhere, for those of us who have little experience with using scripts? Maybe a step by step tutorial?


There are full instructions within the script in the first green block of text. The text will appear green when you have added it into the script editor. There's a also a download link for a demo in the first post.

Quote from: Paladin295 on May 23, 2009, 08:43:27 pm
4. I assume it is possible to disable the in battle party member switching function? Would it also be possible to change it so that in certain battles, the player is prompted to switch another party member in only in exchange for those party members who have already been knocked out?


You will need to find somebody to edit the script and add this specific functionality.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

omegapirate2000

Spoiler: ShowHide

sournote103

OK, so I'm pretty inept at scripting...... so..... How do you make a character who is ALWAYS the FIRST MEMBER of the party. If you can, please be specific.