Need help with Party Changing System by Leon_Westbrooke

AveyondFan

Villager
Member
Joined
Sep 19, 2018
Messages
23
Reaction score
1
First Language
English
Primarily Uses
RMXP
I've been running into an issue with the script. There's a script call I can, in theory, use to put a party member into reserve.
I say in theory as I can't seem to get it to work.
Whenever I try to use it, I get the error message: ArgumentError occurred while running script. wrong number of arguments (0 for 1)
The call is $game_party.remove_actor_to_party(actor_id)

The part of the script I think is in question is this:

Code:
#==================================================
#  Game_Party
#==================================================
class Game_Party

  attr_accessor :party_members
  attr_accessor :move
  attr_accessor :locked
  attr_accessor :min_size
  attr_accessor :max_size
 
  alias leon_partyswitch_gameactor_initialize initialize

  def initialize
    leon_partyswitch_gameactor_initialize
    @party_members = []
    #  Edit :This is to change if an actor is locked or not. To lock them, add
    #        their id to the array below.
    @locked = []
    @min_size = 1
    @max_size = 4
  end
 
 
  def add_actor(actor_id)
    actor = $game_actors[actor_id]
    if @actors.size < @max_size
      unless @actors.include?(actor)
        unless @party_members.include?(actor.id)
          @actors.push(actor)
          $game_player.refresh
        end
      end
    else
      unless @party_members.include?(actor.id)
        unless @actors.include?(actor)
          @party_members.push(actor.id)
          $game_player.refresh
        end
      end
    end
  end
 
  def remove_actor(actor_id)
    @actors.delete($game_actors[actor_id])
    @party_members.delete(actor_id)
    $game_player.refresh
  end
 
  def remove_actor_from_party(actor_id)
    if @actors.include?($game_actors[actor_id])
      unless @party_members.include?(actor_id)
        @party_members.push(actor_id)
        @party_members.sort!
      end
    end
      @actors.delete($game_actors[actor_id])
    $game_player.refresh
  end

  def add_actor_to_party(actor_id)
    if @party_members.include?(actor_id)
      if @actors[@max_size - 1] != nil
        @party_members.push(@actors[@max_size - 1].id)
        @actors.delete_at(@max_size - 1)
      end
      @actors.push($game_actors[actor_id])
      @party_members.delete(actor_id)
    end
  end
end
#==================================================
#  END Game_Party
#==================================================
...I don't know what's wrong. All I am doing is replacing actor_id in the script call with a number (in the case of my testing, it was actor 26)
I don't know what I'm doing wrong (or if there's an error in the script as this is like trying to read... a language using an alphabet that isn't of that language) so... um...
Help, please?
Edit: Also, this is not the entire script. I'm just posting what seems to be connected with my issue.
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
Could you please edit your post to include a link to the web page where you got the script. That way, if anyone needs to check something before offering a suggestion, they don't have to go hunting.
Thanks.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
The call is $game_party.remove_actor_to_party(actor_id)
You mean $game_party.remove_actor_from_party(actor_id)
This does not put a member into reserve, from what I can see, it should remove them, like they were never in your party.
Edit: Also, this is not the entire script. I'm just posting what seems to be connected with my issue.
You were asked to post a link to the script, not to what you think is the problem.
Help, please?
We are trying, but it is difficult. We really need that script to see what it is suppose to do.
Is this a script that was commissioned for you? if not then tell us what the script is and where to get it.
Thanks
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
155
First Language
English
Primarily Uses
RMXP
o_O Kinda curious where you found that myself. It doesn't exist in Creation Asylum where Leon posted many of his other works.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Fixed. At least for me.
The problem I found is that the command window for script input (event command) is too short.
When entering in the phrase $game_party.remove_actor_from_party(2) ( not remove_actor_to_party <- typo)
it would give the error you are receiving as the line for this text is too long and the number would fall down to the next line.
Like this
$game_party.remove_actor_from_party
(2)

I fixed it by changing the script def name.
Line 96 def remov_actor_from_party(actor_id)
I remove the e in remove. This shorten it enough to allow the value to exist on the same line as the rest of the code.
I imagine that if you were to use 10 or more characters you would have to shorten it another character.

Second is
Line 472 $game_party.remov_actor_from_party($game_party.actors[@slot_window.index].id)
Again removed the e in remove.

then the script worked correctly.

I suppose you could use
$game_party.move_actor_from_party(actor_id)

Then that would give you two characters to be safe.
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
155
First Language
English
Primarily Uses
RMXP
Just so you know, line breaks are permitted after punctuation within scripts and script calls. It's quite valid to enter the original command as so:

$game_party.
remove_actor_from_party(2)

Now as to SPELLING and bugs like that... OOPS?
 

AveyondFan

Villager
Member
Joined
Sep 19, 2018
Messages
23
Reaction score
1
First Language
English
Primarily Uses
RMXP
Thanks for the help. Putting a break after the period fixed it.(as did the shortening it in the script, but I found putting a line break after the period easier).
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top