[XP] Easy Party Switcher

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

Previous topic - Next topic

Blizzard

Read the instructions, there's a script call for it.
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.

sournote103

I did. I couldn't figure it out  :^_^':

Blizzard

actor.must_be_in_party and actor.forced_position or something like that. Just look it up.
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.

Juan

Lol blizz you beat me to it. I might as well provide the comments to go with those.
Spoiler: ShowHide
$game_actors[ID].must_be_in_party = true/false
#   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
$game_party.actors[POS].forced_position = nil/0/1/2/...
#   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,
Dropbox Who need luck when you can make your own.
3ds Friend code: ShowHide
 4468 1422  6617

sournote103

Quote from: Juan on June 05, 2009, 04:12:42 pm
Lol blizz you beat me to it. I might as well provide the comments to go with those.
Spoiler: ShowHide
$game_actors[ID].must_be_in_party = true/false
#   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
$game_party.actors[POS].forced_position = nil/0/1/2/...
#   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,


OK, but that doesn't tell me HOW to make an actor be a permanent party member. I'm pretty useless with scripts.

Blizzard

June 05, 2009, 04:41:32 pm #85 Last Edit: June 05, 2009, 04:44:41 pm by Blizzard
No, it doesn't tell you at all. There is absolutely no text which indicates or just hints at what you need to do in order to use those commands. :V:

Quote# How to use:
#
#   To call this script, make a "Call script" command in an event.


Quote#   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!)
#


Where you would obviously use only one of the given values and not all of them.
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.

sournote103

Quote from: Blizzard on June 05, 2009, 04:41:32 pm
No, it doesn't tell you at all. There is absolutely no text which indicates or just hints at what you need to do in order to use those commands. :V:

Quote# How to use:
#
#   To call this script, make a "Call script" command in an event.


Quote#   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!)
#


Where you would obviously use only one of the given values and not all of them.

Hm.... I tried that, and it gave me an error. Could you please show me how it's supposed to look?

teengamer

I can't get it to change any party member's status 8 or higher (008, 009, 010, etc.)

fugibo

Quote from: sournote103 on June 06, 2009, 08:30:52 am
Quote from: Blizzard on June 05, 2009, 04:41:32 pm
No, it doesn't tell you at all. There is absolutely no text which indicates or just hints at what you need to do in order to use those commands. :V:

Quote# How to use:
#
#   To call this script, make a "Call script" command in an event.


Quote#   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!)
#


Where you would obviously use only one of the given values and not all of them.

Hm.... I tried that, and it gave me an error. Could you please show me how it's supposed to look?


It'd be super-duper helpful if you showed us what YOU are doing!

rpgmakerfanhaha

My god....The thing I wanted is that not all actors in the database are in the party changer.I want it to start with the initial party members and then other actors slowly joins into the party through the story.Someonee please help me with the scripts?

Blizzard

You wouldn't have this problem if you read just this one page of the 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.

rpgmakerfanhaha

I don't possess any scripting knowledge or what.Blizzard can you give me a sample of a disabled member in the party so I will know how to type the line in the script and where to do it.

Blizzard

August 31, 2009, 07:23:01 am #92 Last Edit: August 31, 2009, 07:24:50 am by Blizzard
Quote from: Blizzard on June 05, 2009, 04:41:32 pm
Quote# How to use:
#
#   To call this script, make a "Call script" command in an event.


Quote#   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!)
#


Where you would obviously use only one of the given values and not all of them.

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.

Jackolas

August 31, 2009, 09:15:44 am #93 Last Edit: August 31, 2009, 09:16:50 am by Jackolas
I can't understand how peep can't understand the really really simple instructions... >:(

Quotegive me a sample of a disabled member in the party

download the demo?

Blizzard

I can't understand how people can't understand CLARIFIED instructions. ._. It makes me a sad blizzard. ;_;
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.

rpgmakerfanhaha

okay okay alright alright!Calm down!I have finally found out the way to work the script now.

Blizzard

You seem to be misunderstanding something. Nobody is angry here.
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.

Alunasa

October 21, 2009, 11:01:42 pm #97 Last Edit: October 21, 2009, 11:03:43 pm by Alunasa
Hi!  First I want to thank you for taking the time to develop and test this script.  It's amazing and very helpful.  I'm very, very new to using scripts and this is the first one that I've installed.

Nortos posted a demo for how to add a button to Change Party from the menu and I copied the code from the demo.  The Easy Party Switcher Script seems to be working perfectly but I'm getting an error message every time I exit the game.  I think it is due to something in the code for the menu.

Oh and this same error appears in both my game and the demo posted by Nortos.  I am using the most recent version of the Easy Party Switcher script.

Here's the error message:
Spoiler: ShowHide
Script 'Scene_Menu' line 243: NameError occurred.
undefined local variable or method 'update' for #<Scene_Exit:0x157e8a0>


Here's a copy of the entire menu code:

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 = "Change Party"
   s6 = "Save"
   s7 = "Exit"
   @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 playtime window
   @playtime_window = Window_PlayTime.new
   @playtime_window.x = 0
   @playtime_window.y = 305
   @steps_window = Window_Steps.new
   @steps_window.x = 0
   @steps_window.y = 390
   @gold_window = Window_Gold.new
   @gold_window.x = 0
   @gold_window.y = 255
   # 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 # Party Changer
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_PartySwitcher.new
     when 5  # 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 6  # exit
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_Exit.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
#------------------------------------------------------------------------------
#  This performs exiting
#===================================================

class Scene_Exit
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Make command window
   s1 = "To Title"
   s2 = "Exit"
   s3 = "Cancel"
   @command_window = Window_Command.new(192, [s1, s2, s3])
   @command_window.x = 320 - @command_window.width / 2
   @command_window.y = 240 - @command_window.height / 2
   @command_window.opacity = 255
   @spriteset = Spriteset_Map.new
   # Execute transition
   Graphics.transition
   # Main loop
   loop do
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Frame Update
     Frame.update
     # Abort loop if screen is changed
     if $scene != self
       break
     end
   end
   # Prepare for transition
   Graphics.freeze
   # Dispose of window
   @command_window.dispose
   @spriteset.dispose
   # If switching to title screen
   if $scene.is_a?(Scene_Title)
     # Fade out screen
     Graphics.transition
     Graphics.freeze
   end
 end
end


I think that the error message pertains directly to line 243.  Line 243 reads: "update".
Here is the section of the specific code with the line highlighted in red:

Spoiler: ShowHide
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Make command window
   s1 = "To Title"
   s2 = "Exit"
   s3 = "Cancel"
   @command_window = Window_Command.new(192, [s1, s2, s3])
   @command_window.x = 320 - @command_window.width / 2
   @command_window.y = 240 - @command_window.height / 2
   @command_window.opacity = 255
   @spriteset = Spriteset_Map.new
   # 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 window
   @command_window.dispose
   @spriteset.dispose
   # If switching to title screen
   if $scene.is_a?(Scene_Title)
     # Fade out screen
     Graphics.transition
     Graphics.freeze


I would appreciate any help that you can give me.  Like I said before, I'm a complete newbie when it comes to scripts and coding so I know next to nothing.  I actually had to look up how to "call a script" and where to insert it.  O.o

Thank you,
-Alunasa

Blizzard

That's a weird error. Do you think you could make a small demo demonstrating the problem? I'll take a look at it and fix it then.
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.

Alunasa

Okay, I made a demo and put it up on Megaupload.  The error happens when you enter the game, change party members and then select exit.  Also, I wasn't sure what type of file you needed so I uploaded two different kinds... one WinZip and one made by RMXP.

Exe File:


WinZip File:


Thanks for the quick reply.