Give keys/item to only certain characters? [SOLVED!!]

Status
Not open for further replies.

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Veteran
Joined
Jun 5, 2019
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Hi, I'm a little new so I could just be missing something, but I'm trying to give only certain characters their own key/item. I have a character who is smart, a character who is strong, and one that is kind, so
I'm trying to make it so that you can only "solve" a puzzle if you switch players to the smart guy in "formation".
So if you try to move a boulder out of the way it would say something like, "Only strong guy can move this." unless you're already playing as the strong guy. I tried looking this up on the forums but I couldn't find anything this specific.
Thanks!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
Try Conditional Branches which check if Actor X is in the party. If yes, move boulder. Else your text.
 

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Veteran
Joined
Jun 5, 2019
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMVXA
I've tried doing that, but since the characters are always in the party it just lets them through.
I'm trying to make the player switch to the correct character before they are able to move through.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
How are you handling the switching?
 

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Veteran
Joined
Jun 5, 2019
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMVXA
I'm not sure how a switch would be needed.
Please elaborate on what you have in mind!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP
I believe he means, how do you handle the switching between characters?
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
By "In formation" do you mean among the active battle members? If that is the case you can use this:
Code:
$game_party.battle_members.include?($game_actors[actor_id])
Of course, you have to replace "actor_id" with the actual ID of your actor.
The default Event Command handles it this way:
Code:
result = ($game_party.members.include?(actor))
However, the "members" method for Game_Party returns "battle_members" only when the party is in a battle, returning the whole party otherwise (all_members).
Code:
def members
  in_battle ? battle_members : all_members
end
Using the previous code in the script box of a conditional branch you can effectively check if the actor you want is part of the current formation.
 
Last edited:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Control VariableX = Set to ID of Party Member 1
Conditional Branch if VariableX equal to 3 do push rock, else texbox: "the wrong Actor is Party Leader"
 

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Veteran
Joined
Jun 5, 2019
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMVXA
slimmmeiske2: Ohh, when you manually go into the menu and switch characters in formation.
Heirukichi: No, not in battle, in game.
Bex: I'll try that right now!
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Heirukichi: No, not in battle, in game.
That is exactly why I used "battle_members". I added an explanation to my previous post, it should answer your question.
 

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Veteran
Joined
Jun 5, 2019
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMVXA
I'll try that right now.
 

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Veteran
Joined
Jun 5, 2019
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Thank you so much, Bex!!! All I had to do was set the equals to 1 and it worked!!:wub:wub
(When I set it to 3 it made the 3rd character have the ability to but no-one else.)
Thanks everyone for helping me!
 
  • Like
Reactions: Bex

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

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.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top