How to make my characters to select an order of watch duty?

Mohitrani

Warper
Member
Joined
Jan 5, 2021
Messages
4
Reaction score
1
First Language
italian
Primarily Uses
RMMV
Hello, i have a problem, i have 8 characters camping at night, and they have to choose an order for watch duty, so that after picking an order each of them will act singularly for a while and then after all of them acted they'll group together in the morning. What can i do to achieve that? thank you.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
To do this entirely in an event, just set aside 8 variables (watch 1 through watch 8) and make a sequence of choices to choose who is number 1, number 2, etc. Don't forget to do conditionals after every choice from 1 on to make sure the player hasn't chosen the same character for two shifts.

You'll need a plugin to display that many choices, there are several available if you Google it.

You could get it looking a little slicker with a plugin function, but that sounds like it's advanced for you.
 

Mohitrani

Warper
Member
Joined
Jan 5, 2021
Messages
4
Reaction score
1
First Language
italian
Primarily Uses
RMMV
To do this entirely in an event, just set aside 8 variables (watch 1 through watch 8) and make a sequence of choices to choose who is number 1, number 2, etc. Don't forget to do conditionals after every choice from 1 on to make sure the player hasn't chosen the same character for two shifts.

You'll need a plugin to display that many choices, there are several available if you Google it.

You could get it looking a little slicker with a plugin function, but that sounds like it's advanced for you.
i already have a plugin to show more choices, so i set variable range 1 to 8, but what about operation and operand? sorry i never use variables, i just use switches, so i'm kinda noob to this
 

Milennin

"With a bang and a boom!"
Veteran
Joined
Feb 7, 2013
Messages
2,771
Reaction score
1,935
First Language
English
Primarily Uses
RMMV
If you don't know how to use Variables, I'd strongly suggest to look up a tutorial on them. They're one of the most important features you're going to need to know how to use for RPG Maker (alongside Switches). They look complex to use at first, but once you know how they work, it's very simple and it opens up a lot of options.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
i already have a plugin to show more choices, so i set variable range 1 to 8, but what about operation and operand? sorry i never use variables, i just use switches, so i'm kinda noob to this
This is very basic eventing that you'll need to understand if you're going to make a decent game of any complexity. There are many tutorial videos on YouTube and threads in the tutorials forum to help you get started.

But if you read what the options say (and mouse over them to get an explanation)...
Just think about what you want to do, you have this list of variables and you want each variable to tell you which actor has that place in the camp watch, right? So when the player says "I want Jimmy to go first," you want to SET a value (that sentence didn't involve any adding or subtracting or other math). And you want to set it to the ID of Jimmy the actor, which is a CONSTANT value that doesn't change.
 

Mohitrani

Warper
Member
Joined
Jan 5, 2021
Messages
4
Reaction score
1
First Language
italian
Primarily Uses
RMMV
This is very basic eventing that you'll need to understand if you're going to make a decent game of any complexity. There are many tutorial videos on YouTube and threads in the tutorials forum to help you get started.

But if you read what the options say (and mouse over them to get an explanation)...
Just think about what you want to do, you have this list of variables and you want each variable to tell you which actor has that place in the camp watch, right? So when the player says "I want Jimmy to go first," you want to SET a value (that sentence didn't involve any adding or subtracting or other math). And you want to set it to the ID of Jimmy the actor, which is a CONSTANT value that doesn't change.
ok so this is what i did, i set 8 variables for order, so first,second,third and so on, then i put a sequence of choices and everytime you pick a choice the actor associated with that choice activates a variable like actorid=first for the first sequence of choices, actorid=second, for the second sequence and so on, so the only thing i need right now is a way to hide the choices already picked, cause if i open a conditional branch then i'll have to set up 8! different sequence for every order someone picks actors for the watchduty, is there a way to do that?
 

Beckx

Villager
Member
Joined
Mar 29, 2021
Messages
18
Reaction score
138
First Language
german
Primarily Uses
RMMV
Hey there, so i just started playing around with rpg maker so there might be a better way, but i'm a web developer in RL so i came up with a script solution that might help you out.
see the screenshot attached. it's also getting late here, so i'll be going to sleep soon and won't be able to answer any questions before tomorrow, just so you'll know :)
aaand you probably need to modify it, but it's a quick example of what you could do.

so, a little about what's going on:
We're using 4 variables for now (sorry for the strange naming-order, i was to lazy to clean it up):

#0002 are the choices you want to display and in the "correct" order
#0004 is going to look quite similar to #0002 when we're finished, but in the chosen order
#0001 is the number how often we want the loop to run (8 choices, so 8 times)
and
#0003 temporarily stores the choice ( could be used for display in text)

so, inside the loop, the first thing we check is if #0001 is 0, which means we need to break the loop.
it's important to break the loop, otherwise it would go on and on forever. and we're counting #0001 down at the very end of the loop.

onto the script, here for better copy and pasting:
Code:
choices = []; params = [];
$gameMessage.setChoices(choices, 0);
for(var i = 0; i <= 7; i++){
   choices.push($gameVariables.value(2)[i]);
}; params.push();
$gameMessage.setChoiceCallback( (index) => {
let chosen = $gameVariables.value(2).splice(index, 1);
$gameVariables.setValue(3, chosen);
let newOrder = $gameVariables.value(4);
newOrder.push(chosen);
$gameVariables.setValue(4, newOrder);
})

So, the following part opens the choice thingy with the choice options corresponding to the values of #0002 -> we're removing a taken choice from that variable later on, which is basically what you want.

Code:
choices = []; params = [];
$gameMessage.setChoices(choices, 0);
for(var i = 0; i <= 7; i++){
   choices.push($gameVariables.value(2)[i]);
}; params.push();

But, we still need to know which choice was taken, which we are doing in the next part.
note this line: $gameVariables.value(2).splice(index, 1);
splice is a javascript function which removes 1 item in #0002 at index and returns that value. so it basically does two things for us: changing #0002 and returning the value of the choice.

Code:
$gameMessage.setChoiceCallback( (index) => {
   let chosen = $gameVariables.value(2).splice(index, 1);
   $gameVariables.setValue(3, chosen);
   let newOrder = $gameVariables.value(4);
   newOrder.push(chosen);
   $gameVariables.setValue(4, newOrder);
})
 

Attachments

  • Bildschirmfoto von 2021-04-15 22-49-41.png
    Bildschirmfoto von 2021-04-15 22-49-41.png
    176.6 KB · Views: 3

Moerder

Villager
Member
Joined
Mar 27, 2021
Messages
22
Reaction score
19
First Language
F'thaghn
Primarily Uses
RMMV
Hi. what you want is perhaps this: https://forums.rpgmakerweb.com/inde...l-show-choices-hide-or-disable-choices.96941/

you can simply set up one choice dialog and depending on the switches or variables you use, it will no longer display an already chosen option. much simpler and much cleaner than a myriad of conditional checks. but as others have said before, check out all the things that variables can do first :p
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
so the only thing i need right now is a way to hide the choices already picked, cause if i open a conditional branch then i'll have to set up 8! different sequence for every order someone picks actors for the watchduty, is there a way to do that?
Well, 7, because the first person they choose is the first person they choose, no reason to check anything then. But that's why I said:
You could get it looking a little slicker with a plugin function, but that sounds like it's advanced for you.
You definitely need to get a stronger grasp of the basic event commands before you get too into scripting or plugins that you don't understand. But you've gotten several responses of options to help you if you go that way.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
706
Reaction score
583
First Language
English
Primarily Uses
RMMV
Honestly, I think the easiest way to do this in rpgmaker would be to do it on-map, and just have event versions of the characters.

Just have the player character walk up to the other party members and talk to them in the order you want to assign watch shifts.

Have the dialogue be something like
"Do you want me to take watch shift number \v[ SomeVariableNumberYouPick]?"
With choices of 'Yes," and "Nevermind"

If the player picks 'yes', you assign the party member to that shift, add one to SomeVariableNumberYouPick, and trigger a self-switch.

I think it's a little more immersive as well, and you get to put a little flavor text on character dialogue (and maybe hint who is the best choice for each shift, if you're feeling ambitious)
 

Mohitrani

Warper
Member
Joined
Jan 5, 2021
Messages
4
Reaction score
1
First Language
italian
Primarily Uses
RMMV
thank you all guys! i had no idea how todo that and now i managed to make it in 2 different ways and hopefully i'll be able to do it even in a third way! I'm in this rpgmaker world only since a week and never developed anything first, i promise i'll learn everything i need before asking more things, thank you, much love.
 

Latest Threads

Latest Posts

Latest Profile Posts

Working on a case. Get all the evidence to prosecute some bad guys. :kaojoy:
But, the game development schedule delayed. :kaoswt2:
The moral of the story: No good deed goes unpunished... I guess...
Now, hopefully, some certain people will not be stupid enough to leak my name on the reports.
just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.
Ever reach that moment in your life when your juggling a dozen or more projects that you know will never be made but don't have the heart to delete them? Ugh, I hate those moments...
:kaosigh: Why must you hurt me so?
my main character isn't the warrior of light or the chosen one, he's a self righteous, invasive try hard who gets ahead of himself and makes a critical error, resulting in a downward moral spiral that, eventually, leads him to truths that make him a better man, and im DAMN proud of that.

Forum statistics

Threads
111,448
Messages
1,061,188
Members
144,816
Latest member
pit2752
Top