How to lock a party member?

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
In the game I'm working on, I want it so that once you get a certain character, she is set to the first position and can't be changed.

Is there a way to do that?

Thank you!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Add the following script to a new slot in Materials:

class Game_Party def fix_position(index) @fixed_position = index end def fixed_position?(index) @fixed_position == index endendclass Scene_Menu < Scene_MenuBase alias shaz_fix_position_on_formation_ok on_formation_ok def on_formation_ok if $game_party.fixed_position?(@status_window.index) Sound.play_buzzer else shaz_fix_position_on_formation_ok end endendNow in your events, after the line where you add the actor to your party, do the following in a Call Script event command (last command on third tab):

Code:
$game_party.swap_order(0,$game_actors[id].index)$game_party.fix_position(0)
where id is the actor id of your new party member.I have not tested this, so let me know if you get any errors trying to run it. What SHOULD happen is that you'll add the character to your party, call the swap to make them the first party member, and then call the new party method to fix the actor in position 1. After that, when you go into the Formation menu, if you try to select the first actor, either as the first option or the second, it should not let you do it.

Moving to RGSS3 Script Requests
 
Last edited by a moderator:

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
What is a Call Script? It that a part of the full Script?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
No - it's an event command. Add a new event command to your event, click on the third tab, and look at the bottom of the second column. The very last command is called 'Call Script'.


I removed the quote from your post. You don't need to quote someone if you're replying directly after them, and if you DO quote them, you should remove anything unrelated to what you're about to say. ;)
 
Last edited by a moderator:

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
No - it's an event command. Add a new event command to your event, click on the third tab, and look at the bottom of the second column. The very last command is called 'Call Script'.

I removed the quote from your post. You don't need to quote someone if you're replying directly after them, and if you DO quote them, you should remove anything unrelated to what you're about to say. ;)
Ok, I tried it but it doesn't work. she still moves to the second spot.

BTW, i'm also using the Yanfly Party System Script found here:

http://yanflychannel.wordpress.com/rmvxa/core-scripts/party-system/
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
That would have been a good clue to start off with :)


Hopefully someone will come along who's familiar with that script. I just don't have the time to look into it, and I assumed you were using RTP.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
Ok, I tried it but it doesn't work. she still moves to the second spot.

BTW, i'm also using the Yanfly Party System Script found here:

http://yanflychannel.wordpress.com/rmvxa/core-scripts/party-system/
That script overrides the original formation menu, that's why Shaz solution didn't work - and why it was not neccessary.

Yanfly's party system already has a lock command build-in, and you need to use that command to lock the party position.

The description pictures on the linked page show that lock command being used in the actor notes, so try that first.

If it doesn't work for an actor that is added later, you'll need another command being used in a script call like Shaz explained. I haven't checked the script myself, but usually yanfly adds such options as well, so just read through the script's description in the comments at the start, those usually tell you all options available in the script.
 

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
That script overrides the original formation menu, that's why Shaz solution didn't work - and why it was not neccessary.

Yanfly's party system already has a lock command build-in, and you need to use that command to lock the party position.

The description pictures on the linked page show that lock command being used in the actor notes, so try that first.

If it doesn't work for an actor that is added later, you'll need another command being used in a script call like Shaz explained. I haven't checked the script myself, but usually yanfly adds such options as well, so just read through the script's description in the comments at the start, those usually tell you all options available in the script.
Yeah, I tried the "lock_actor(x)" call Script but it doesn't work for some reason.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Did you try setting it in the notes?


You should remove that script I gave you too, btw.
 
Joined
Apr 30, 2012
Messages
216
Reaction score
35
First Language
Spanish
Primarily Uses
If i dont bad remember,modern algebra did a script that does what do you want,search in rmrk.net.

Excuse me for my bad English.
 

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
Did you try setting it in the notes?

You should remove that script I gave you too, btw.
In the notes? I thought you put it in a Call Script.

Also, i did remove the script you gave me.

I really appreciate it, though! 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yanfly's party system already has a lock command build-in, and you need to use that command to lock the party position.


The description pictures on the linked page show that lock command being used in the actor notes, so try that first.
You need to read the comments at the top of Yanfly's script. Andar is saying you set it up via notes, not via a Call Script.
 

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
You need to read the comments at the top of Yanfly's script. Andar is saying you set it up via notes, not via a Call Script.
i read through the comments on the script and it says to use a Call Script to lock a character, as does the page I got the script from.

I've looked around and it has nothing to do with actor notes. I even tried it and it still didn't work.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
You need to read the comments at the top of Yanfly's script. Andar is saying you set it up via notes, not via a Call Script.
Unfortunately I misread the description, it is a script call and not a note.

However, the description also states that the lock command only works if you enable the new party menu, not in the old formation menu - that's probably the reason why it didn't work for you, if you're still using the formation menu.

ALWAYS read the description of any script you enter - a lot of scripts NEED CONFIGURATION, and just putting them in your game without checking those configuration options can cause a lot of problems (for example, if you need to specify a switch to control the script, and the default switch number in the script is already used for something else in your game)
 

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
Unfortunately I misread the description, it is a script call and not a note.

However, the description also states that the lock command only works if you enable the new party menu, not in the old formation menu - that's probably the reason why it didn't work for you, if you're still using the formation menu.

ALWAYS read the description of any script you enter - a lot of scripts NEED CONFIGURATION, and just putting them in your game without checking those configuration options can cause a lot of problems (for example, if you need to specify a switch to control the script, and the default switch number in the script is already used for something else in your game)
i think I have the new party menu set up. It's the line that says " ENABLE_MENU = true", right?

I've had it set up since the beginning. It's default is true in the script.
 
Last edited by a moderator:

Trianglon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
53
Reaction score
3
First Language
English
Primarily Uses
I got it to work but there's a problem i'm having with it.

It locks the character but it locks her in the second position.

How do I keep her lock in the first position?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
I got it to work but there's a problem i'm having with it.


It locks the character but it locks her in the second position.


How do I keep her lock in the first position?
That looks like you used a fix on (1) with an array/function that counts beginning with zero.
I didn't check the scripts for this, simply try which position is fixed when you lock to zero
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top