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
908
Reaction score
480
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,760
Reaction score
1,922
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
908
Reaction score
480
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
11
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
908
Reaction score
480
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
665
Reaction score
559
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 Profile Posts

Create Anime Art w/ AI, Tall Sprites with Aurora, Customize Variable Display | RPG Maker News #34

[My favorite slow moving track I've made so far]
dd_airport2.jpgdd_combat.jpg
dd_town.jpg
I did an experiment to try to solve the art style problem between RTP and 3D models.
But, it feels this grimdark world is going to end even faster. :kaoswt2:
Solovei wrote on caethyril's profile.
Hi, just wanted to say, thank you for helping me fix that event with the step count! I followed your example exactly and it works now:kaojoy:
still waiting for original character contest 3 bust/face dlc release :kaoluv:

Forum statistics

Threads
111,188
Messages
1,059,120
Members
144,437
Latest member
foxiee05
Top