MZ General progression system

Hello, I'm currently trying to figure out how to make my game progress step by step in the most elegant way possible (using the least amount of unique events, pages, switches, variables)

1) What would be, according to you, the absolute simplest way to achieve the following situation ?

- Player can talk to NPC A, B, C, but not D.
- After talking to NPC A, B, C once each, player can now talk to NPC D.
- NPC A, B, C can be talked to repeatedly.

I would like to achieve this with no external event and no multiplication of event pages (no self-switches to empty pages for example)


2) My gut feeling is to use variables, let's say event A, B and C increase variable X by 1 each, and D can only be talked to on a conditional branch with a >3 prerequisite on variable X. However, that would obviously mean the player can talk to event A 3 times and jump to event D, which I don't want. I don't want event A to erase itself after being talked to once either, all of them must be repeatable.

3) Is there a simple way to code a variable increase that ONLY happens the first time a repeatable event is triggered ? I can think of a conditional branch only allowing the variable increase on NPC A IF said variable is <1 for example, repeating that event would never progress it again, but in that case talking to NPC B first would put the variable to 1 and completely prevent A from increasing the variable, and the game would never progress to D.

If it's not doable, is there a plugin for it ? A plugin that'd allow parts of an event (in this case, variable increases) to erase themselves after first use, while the rest stays intact.

4) Would Visustella's quest system help with my game progression in any shape or form ? Some say it's mostly cosmetic and doesn't really handle the progression logic at all, how much of that is true ? Is there no way to create "quest D only appears if quest A, B, C have been cleared once", and if there is, would that allow me to skip my whole problem using quests instead ?
1) What would be, according to you, the absolute simplest way to achieve the following situation ?

- Player can talk to NPC A, B, C, but not D.
- After talking to NPC A, B, C once each, player can now talk to NPC D.
- NPC A, B, C can be talked to repeatedly.

I would like to achieve this with no external event and no multiplication of event pages (no self-switches to empty pages for example)
Note that you can nest branches (i.e. put branches inside other branches) to check for multiple conditions at the same time.

A (self) switch is ideal for tracking "do once" things, like "has the player talked to me yet?". You can also use a variable to make the checks more convenient, or if you want to use it as a page condition for NPC D so that they only appear after talking to A, B, and C. Here are a couple of ideas:
Spoiler: option 1 (3 self-switches, 1 variable)
NPCs A, B, C (1 page):
  • If Self-Switch A is OFF:
    • Introduce themselves.
    • +1 to variable.
    • Turn on self-switch A.
    Else:
    • Say other things.
NPC D (1 page):
  • If variable ≥ 3:
    • Say whatever is appropriate.
    Else:
    • (Still need to talk to NPCs A, B, and C.)
Spoiler: option 2 (3 switches)
NPC A (1 page):
  • If Switch 101 is OFF:
    • Introduce themselves.
    • Turn on switch 101.
    Else:
    • Say other things.
NPC B: same structure as A but use a different switch (e.g. 102) instead.
NPC C: same structure as A but use a different switch (e.g. 103) instead.

NPC D (1 page):
  • If Switch 101 is ON:
    • If Switch 102 is ON:
      • If Switch 103 is ON:
        • Say whatever is appropriate.
        • Exit Event Processing
  • (Still need to talk to NPCs A, B, and C.)
2) My gut feeling is to use variables, let's say event A, B and C increase variable X by 1 each, and D can only be talked to on a conditional branch with a >3 prerequisite on variable X. However, that would obviously mean the player can talk to event A 3 times and jump to event D, which I don't want. I don't want event A to erase itself after being talked to once either, all of them must be repeatable.
that works just fine. you can use a conditional branch to make it so that the variable is only incremented when some switch is explicitly off, and then flip that self switch true when the player interacts with the event later in the event
Wouldn't both of your solutions require me to keep track of hundreds of switches ? Every single time my character talks to anyone I would have to create a burner switch.

Is there no solution using only a variable and conditional branches ? Maybe some way for the event to store the current variable and then never increase it again if the variable is above what was stored (which it will be after the +1 increase), or something like that

Or a command that would erase parts of the event permanently when triggered (in this case, erasing the variable increase command from within the end of the event itself, so that it can't occur when that event is triggered a second time)


Maybe something like
"If variable X is untracked, track it"
"If variable X is equal to tracked value, +1 to variable X"

And then when the event is rerun no increase occurs because the variable's current amount is different than what was tracked.

I don't know if it's possible but does it make sense ? I want the event itself to remove commands from the event after they happened, without external (switch/self-switch) help, because they would completely bloat the code.
Wouldn't both of your solutions require me to keep track of hundreds of switches ? Every single time my character talks to anyone I would have to create a burner switch.
no. "self switches" are separate from regular "switches" and are unique to each event. you dont need to make any new switches at all in Cae's first method / the one i suggested. you'd use one of the four self switches of each event already has

1765976514985.png


the editor has a series of tutorials i suggest taking that go over the basics of many of the features of the engine if you click on "Help" in the main menu
1765976666152.png
no. self switches are separate from regular switches and are unique to each event. you dont need to make any new switches at all in Cae's first method / the one i suggested. you'd use one of the four self switches of each event already has
Yes, but I'm trying to avoid self-switches, because they double the amount of pages needed for basically no reason. I would like for the self-switch to occur WITHOUT using a burner page, mainly because my events already have lots of pages and I can't really double/triple that just for a simple progression check, plus I wouldn't be able to use more than 4 self-switches anyway.

Let's say my event is 300 lines of code long, and I only want to remove one of them (the part that increases a variable). I want the event to remove the line on its own so it can be reused, rather than self-switch to a page thats 299 lines identical minus the variable increase.
Yes, but I'm trying to avoid self-switches, because they double the amount of pages needed for basically no reason.
we're not telling you to make different pages. you'd only use a conditional branch to make the outcome different
1765977199580.png


plus I wouldn't be able to use more than 4 self-switches anyway.
are you currently using all four self switches in all of these events already? you would only need to choose one self switch on each event. theyre unique to each event, so even if you chose self switch A for all three, they'd only refer to their own A self switches and would be different individually
we're not telling you to make different pages. you'd only use a conditional branch to make the outcome different
View attachment 355276


are you currently using all four self switches in all of these events already? you would only need to choose one self switch on each event. theyre unique to each event, so even if you chose self switch A for all three, they'd only refer to their own A self switches and would be different individually
Ok that's really cool, I didn't get that the first time. I'm not currently using all four, but I heavily suspect that I will. A major part of my game occurs on the same map, and the same events progress from page to page depending on current story state (through a variable). So 4 story steps in, self-switches wouldn't work anymore, would they ?

Oh wait , or would I be able to reuse all 4 of them in every page ?

Like if I use your method to control how page 1 behaves with self-switch A, and then later have a variable make this event run a second page, could I STILL use self-switch A to then control the second page without messing anything up ?
A major part of my game occurs on the same map, and the same events progress from page to page depending on current story state (through a variable). So 4 story steps in, self-switches wouldn't work anymore, would they ?
it depends on what exactly you plan to do and how you have it organized. you could use different events entirely but just hide the ones not in use. you can make different versions of the map with different events and send the player to the version of the map they need for the story. you can technically make and use additional self switches through script commands (the editor would never acknowledge them but they can be accessed anywhere that takes script, like conditional branches). it can go a number of ways.

Oh wait , or would I be able to reuse all 4 of them in every page ?
self switches are unique to the event, not the page. but, if youre using a variable to track the pages and arent using self switches at all for that, then you can turn those self switches "off" at some point when you need them for another page. theres no need to keep those switches set to "on" if you used them for something else before and the page you used them in is no longer accessible
Yeah I guess that's my solution, track pages with a variable, and changes within pages with self-switches. Sounds like I can create dozens of pages that way without running out of anything, and technically only using a single variable.

I guess the tutorials I watched always assumed self-switches had to be used in combination with new pages with a self-switch condition, and I never realized they could interact with conditional branches of the page they're in.

Thanks a bunch
Technically, if you really need to, you could use more than 4 self switches. Only the first 4 can be used as page conditions, but you could use the following script call to set self switch E, for example:

JavaScript:
$gameSelfSwitches.setValue([$gameMap.mapId(), this.eventId(), 'E'])

And then check it with a conditional branch script call:

JavaScript:
$gameSelfSwitches.value([$gameMap.mapId(), this.eventId(), 'E']) == true

With this method you wouldn't even be limited to letters, so you could give them descriptive names as well. But these "extended" self switches obviously can't be used as a page condition (unless you use a plugin like Hime's Page Conditions – it's for MV though, no idea if it works in MZ).

I never realized they could interact with conditional branches of the page they're in.
Or conditional branches of any other page. They're linked to the event, not the page. You could set self switch A on page 1, and then on page 3 (say, when they have a particular item), check if self switch A is set.
"Or conditional branches of any other page. They're linked to the event, not the page. You could set self switch A on page 1, and then on page 3 (say, when they have a particular item), check if self switch A is set."

Is there a good use for this, like what's a staple situation where I would make use of that ? So far I'm trying to avoid that interaction entirely since I don't want anything in page 1 to go and ruin the logic of page 3, so i'll probably reset the switches anyway
I'm sure there are uses for it. I don't have an example for you off the top of my head. But I think you should know that that's how it works.

Original thread: https://forums.rpgmakerweb.com/threads/general-progression-system.181475/