Save-Point
Help with Change Party Order script - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: Help with Change Party Order script (/thread-5123.html)

Pages: 1 2


Help with Change Party Order script - VEE-Chary - 04-24-2014

So... I'm getting all the scripting out of the way before starting over with a project and this one has been bothering me.

I'm using a script to switch the party order (you press a key outside of battle and the second party member becomes the first, the first becomes the last, etc.) but I'd like to make a very basic edition to the script to disable its use if a switch is on.

For cutscenes, for instance, players can still fuck around and switch party members so you end up with an NPC adressing a secondary character as if they were the protagonist. With said secondary character standing right next to it.

I've attached the script in question as a txt. I have no scripting skills aside from Pascal, so I'd largely appreciate some help.



.txt   Change party order.txt (Size: 667 bytes / Downloads: 3)


RE: Help with Change Party Order script - VEE-Chary - 05-03-2014

Uh... yeah, it's been like two weeks and no reply. Is there a way to bump this? Because I have no idea how to do that.


RE: Help with Change Party Order script - MechanicalPen - 05-03-2014

posting in your own thread to move it to the top of the list is called a bump. Which is what you just did o:

Code:
class Scene_Map
  alias modern_algebra_change_leader_modification update
  def update
    modern_algebra_change_leader_modification
    if Input.trigger? (Input::Letters["Q"]) && $game_switches[36] == true
      # Remove the Lead Actor
      old_lead = $game_party.actors.shift
      # Add the old leader back into the party
      $game_party.add_actor (old_lead.id)
    end
    if Input.trigger? (Input::Letters["W"]) && $game_switches[36] == true
      # Remove the last actor in the party
      new_lead = $game_party.actors.pop
      # Insert him as the lead actor
      $game_party.actors.unshift (new_lead)
      # Refresh $game_player to reflect new leader
      $game_player.refresh
    end
  end
end

It's just that simple.


RE: Help with Change Party Order script - VEE-Chary - 05-03-2014

Wow, that WAS simple. Great, thanks.


RE: Help with Change Party Order script - VEE-Chary - 05-04-2014

Wait. No. It's not working.


RE: Help with Change Party Order script - MechanicalPen - 05-04-2014

Whoops. Change the = to ==. I also edited my original post.


RE: Help with Change Party Order script - KasperKalamity - 05-04-2014

can i ask why you would want to do this with a script? what makes that less work?


RE: Help with Change Party Order script - MechanicalPen - 05-04-2014

How would you do this without a script? Because I cannot imagine any way to write this using events unless you've hard coded the party characters or use a bazillion case statements.


RE: Help with Change Party Order script - VEE-Chary - 05-04-2014

There you go, thanks! Even if the switch was off, every time you pressed either key the switch turned itself on, so there was no way to turn it off and disable the function.

As for doing it without a script... why? Why go crazy with common events and conditionals when there's a very simple script that does it for you?


RE: Help with Change Party Order script - KasperKalamity - 05-06-2014

(05-04-2014, 10:17 PM)MechanicalPen Wrote: How would you do this without a script? Because I cannot imagine any way to write this using events unless you've hard coded the party characters or use a bazillion case statements.
like this. it worked with a character select map like this. the default party members were ghosts who had to inhabit mortal bodies to escape a dungeon. the gimmick is up to you though