[RM2K3] ENABLING AN EVENT AFTER TRIGGERING A NUMBER OF OTHERS
Posts
Pages:
1
So like, I want an event that's triggered after a few others are completed.
Like triggering a cutscene after talking with everybody in the map.
How do I go about that?
Like triggering a cutscene after talking with everybody in the map.
How do I go about that?
Branch in a branch in a branch.
If (switch 1 is on)
If (switch 2 is on)
If (switch 3 is on)
then do the thing
/end
/end
/end
I think it would amount to switches and a variable. Like, after you speak to a person, you'd increment a variable, and enable a switch. Though, enabling the switch is more of an insurance policy that players can't just talk to the same person over and over to trigger the cut-scene in question.
As for how to trigger the cut-scene, I think there would have to be some kind of check against the variable to see if it equals however many people the player needs to talk to. What happens when the Conditional Branch is passed might depend on the cut-scene, itself.
As for how to trigger the cut-scene, I think there would have to be some kind of check against the variable to see if it equals however many people the player needs to talk to. What happens when the Conditional Branch is passed might depend on the cut-scene, itself.
The problem with using a variable is that it's no good for things that can happen out of order. Like talking to everybody in town.
If you talk to someone and increase a variable, how do you prevent that same bit of code from being triggered again? You would need to add a page with a variable condition. But if you can do things out of order there is no correct number to put. You would need a switch. So why use a variable at all?
Unless you have self switches, and in 2k3 that's a plugin.
If you talk to someone and increase a variable, how do you prevent that same bit of code from being triggered again? You would need to add a page with a variable condition. But if you can do things out of order there is no correct number to put. You would need a switch. So why use a variable at all?
Unless you have self switches, and in 2k3 that's a plugin.
Because checking against one variable is easier than a nested if against... who knows how many switches?
*Edit: Yes, it's possible to go the nested ifs route with my suggestion. It's absolutely using switches for the express purpose to prevent players from spamming the one person. However, my original point of comparing one value should still stand?
*Edit: Yes, it's possible to go the nested ifs route with my suggestion. It's absolutely using switches for the express purpose to prevent players from spamming the one person. However, my original point of comparing one value should still stand?
Oh, I see what you're saying now. I still disagree xD
Thing is, it's not very difficult to add a simple branch and choose a new switch. It's about as much work as adding 1 to a variable. So you can add var+1 to each NPC event or add a bunch of switch branches in the check event. It ends up being the same amount of work, just in different places.
Plus you're using a variable where one isn't needed. In small games not a big deal, in bigger games you want to avoid that.
Either way works.
Thing is, it's not very difficult to add a simple branch and choose a new switch. It's about as much work as adding 1 to a variable. So you can add var+1 to each NPC event or add a bunch of switch branches in the check event. It ends up being the same amount of work, just in different places.
Plus you're using a variable where one isn't needed. In small games not a big deal, in bigger games you want to avoid that.
Either way works.
It does depend on what you're trying to do. If you need someone to be talked to in a specific order then switches is the best way to go. For example talk to butcher>talk to baker>talk to candlestick maker>talk to sailor.
If you only need to talk to those people in any order then a switch/variable combo works. For example: talk to all three of them before talking to the sailor again.
The switch/variable combo would be like
If TALKED TO BUTCHER = OFF
:dialogue:
Change variable 'blah' +1
Turn switch TALKED TO BUTCHER = ON
END
(or have the switch change the page to something else). It really does depend on what you need exactly, though.)
If you only need to talk to those people in any order then a switch/variable combo works. For example: talk to all three of them before talking to the sailor again.
The switch/variable combo would be like
If TALKED TO BUTCHER = OFF
:dialogue:
Change variable 'blah' +1
Turn switch TALKED TO BUTCHER = ON
END
(or have the switch change the page to something else). It really does depend on what you need exactly, though.)
Isn't it just liberty?
Pages:
1

















