Jump to content
Sign in to follow this  
Tsukihime

RMDC #1: Dynamically Ordered Choice Selections

Recommended Posts

Challenge_DynamicChoiceOrder4.jpg
Suppose you have an NPC that displays a list of options for the player to select from. The catch: each option has a condition that must be satisfied to appear, and the order that the options appear is based on the order that the conditions were satisfied.

Introduction

The RMDev Challenge is a series of articles that presents a problem for RPG Maker developers and the objective is to find a solution.

The purpose is to engage RPG Maker developers in some (possibly practical) problem-solving that will allow them to explore more of what the engine has to offer, and also to see how others implement the same solution.

The rules are simple: provide a solution that works in a version of RPG Maker of your choice. You can use anything at your disposal: events, pictures,  ruby scripts, external libraries, etc.

You may present your solution however you wish (comment, blog post, video, etc) and wherever you wish, but I ask that you leave a link back to this article if you are sharing a solution on external sites. I also recommend sharing the solution on external sites and leaving a link in the comments because the comment section is too small for details. Remember: you want to share with others your solution.

Challenge

Suppose you have three villages in your world creatively named Village A, Village B, and Village C. I will refer to these villages as A, B, and C for brevity.

To make traveling around the world faster, you have a teleportation device in your castle that allows you to teleport to a village that you have visited. Initially, none of the villages are available.

Challenge_DynamicChoiceOrder0.jpg

Once you visit a village and record its position, you may now teleport to that village using the device.

The order that the villages appear in the teleport menu is based on the order that you visited the villages. For example, if you visited A, then B, then C, the options would appear in that order.

Challenge_DynamicChoiceOrder1.jpg

On the other hand, if you visited A, then C, the A would appear first, followed by C.

Challenge_DynamicChoiceOrder2.jpg

You can see that Village B isn’t available. This is because you haven’t visited it yet.
Finally, after you visit B, you would now see A, followed by C, followed by B.

Challenge_DynamicChoiceOrder3.jpg

This reflects the order that the villages were visited during your game.

Note that the solution does not strictly need to be presented as the default choice selection (these images were generated for illustration purposes only)

How would you accomplish this?

(originally posted at HimeWorks)

Edited by Tsukihime
  • Like 2

Share this post


Link to post
Share on other sites

Damn, that's a pretty good challenge - requiring not just some systems knowledge of the engine, but perhaps technical knowledge and maybe even some design patterns.

Its kinda like the Bonfires in the souls games, but with the order of visitation addition.

 

A bit beyond me to try and execute but..

Ideally, the way I'd go about doing it is by having an array that'd store some kind of variable, or string - then the first time I visited a new location I could travel to, a slot in the array would be filled. Then, when it came down to the menu, I'd see about going through and dynamically printing the opinions with some sort of for-loop.

 

As for RPG Maker and Ruby - I have no idea what is and isn't possible with that strategy. I imagine the 'variables' system could easily fill the place of the array, and maybe you could handle a for-loop with some clever flow control. As for dynamically printing the options - that might be a little trickier, and might require some design as to how you would want to present it, but it seems totally possible. If you wanted choices, I know of some script (I can't think of who's it is right now, but it is out there) that allows for more than 4 choices for when players are given a branch in dialogue, and it seems to work by appending more options after the 4th. With the same system, you could probably 'dynamically' add the choices by appending them each, one by one.

Edited by Chaosian
  • Like 1

Share this post


Link to post
Share on other sites

Ya, I decided to make it free-for-all instead of "it must use the 'show choice command' for setting up the options", though forcing you to use the event command would also be an interesting side-challenge.

Share this post


Link to post
Share on other sites

I'm going with the event route as well.

Okay, so generally whenever I visit a town, I would set a switch exclusive to that town to "on", and a variable to the order you have visited the town. When interacting with the waypoint (Or equivalent), it would display the choices depending on the villages you have visited. A little sloppy, but here it goes.

 

When visiting the town

 set switch "town A" to "on"

   if variable "town B" is == "1"
     if variable "town C" is == "2"
       set variable "town A" to "3"
     else
        set variable "town A" to "2"
   else
     if variable "town B" is  == "2"
      If variable "town C" is == "1"
        set variable "town A" to "3"
      else
        set variable "town A" to "1"
     else
       if variable "town B" is == "3"
        if variable "town C" is == "2"
          set variable "town A" to "1"
        else
          set variable "town A" to "2"
     else
       print message "This is your first town! nice to see you."
       set variable "town A" to "1"

When interacting with the waygate

if switch "Town A" is "On"
 if switch "Town B" is "On"
  if switch "Town C" is "On"
    if variable "Town A" is "1"
     If Variable "Town B" is "2"
       If variable "Town C" is "3"
         show choices "Town A, Town B, Town C"
     If variable "Town B" is "3"
       If variable "Town C" is "2"
         show choices "Town A, Town C, Town B"
     else
      if variable "Town B" is "1"
       If variable "Town A" is "2"
        If variable "Town C" is "3"
          show choices "Town B, Town A, Town C"
       If variable "Town A" is "3"
        If variable "Town C" is "2"
          show choices "Town B, Town C, Town A"
      else
       If variable "Town C" is "1"
         If variable "Town A" is "2"
           If variable "Town B" is "3"
             show choices "Town C, Town A, Town B"
         If variable "Town A" is "3"
           If variable "Town B" is "2"
             show choices "Town C, Town B, Town A"

If switch "Town A" is "On"
 If switch "Town B" is "On"
  If switch "Town C" is "Off"
    if variable "Town A" is "1"
      If Variable "Town B" is "2"
         show choices "Town A, Town B"
    else
         show choices "Town B, Town A"

If switch "Town A" is "On"
 If switch "Town B" is "Off"
  If switch "Town C" is "On"
    if variable "Town A" is "1"
      If Variable "Town C" is "2"
         show choices "Town A, Town C"
    else
         show choices "Town C, Town A"

If switch "Town A" is "Off"
 If switch "Town B" is "On"
  If switch "Town C" is "On"
    if variable "Town B" is "1"
      If Variable "Town C" is "2"
         show choices "Town B, Town C"
    else
         show choices "Town C, Town B"

If switch "Town A" is "On"
 If switch "Town B" is "Off"
  If switch "Town C" is "Off"
    Show choices "Town A"

If switch "Town A" is "Off"
 If switch "Town B" is "On"
  If switch "Town C" is "Off"
    Show choices "Town B"

If switch "Town A" is "Off"
 If switch "Town B" is "Off"
  If switch "Town C" is "On"
    Show choices "Town C"

I understand that there is a much more efficient way of doing this, but haha. Screw that. It's RPG maker. :P

  • Like 1

Share this post


Link to post
Share on other sites

I think even if it's RPG Maker, one should still strive to find solutions that may be flexible enough to use in larger settings.

 

The challenges are presented in such a way that the problem is simple enough to just brute-force it to get it to work (to demonstrate that it can be done with eventing, for example)

 

Sometimes that's all that really matters in the end: whether players like it, rather than whether it's built in a sophisticated way.

Edited by Tsukihime
  • Like 1

Share this post


Link to post
Share on other sites

I think even if it's RPG Maker, one should still strive to find solutions that may be flexible enough to use in larger settings.

 

The challenges are presented in such a way that the problem is simple enough to just brute-force it to get it to work (to demonstrate that it can be done with eventing, for example)

 

Sometimes that's all that really matters in the end: whether players like it, rather than whether it's built in a sophisticated way.

Oh no, of course I feel like you should strive to find flexible solutions. This is why I love RPG maker so much though, you can do anything you really want, with or without programming knowledge. You simply need to be creative enough to find that solution. Although my method isn't very flexible, nor is it very fancy, it does get the job done. Eventing this sort of "improvised logic" is my favorite thing to do with RM.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted