Hello, and thanks for clicking on my post. I am stuck with the following:
I'm designing a rougelike game and will be using a random number generator (the one built into MV's variable controls) to choose dungeon floors, item tables for shopkeepers, and loot for treasure chests. Rather than having 100 "if" statements for each, I'm going to use switch statements.
I have some code writing experience, but not any with javascript specifically, and I am new to the concept of a switch statement.
I've got as far as passing (or maybe just "trying to pass") some information from the engine to this code:
switch(i = $gameSwitches.Value(2)) {
case i === 0:
break;
case i === 1:
break;
}
Problem number 1:
I don't know whether what I have here would work or not. I've tried running it and all it's done so far is tell me that "undefined is not a function" and mention yanfly's absorbtion barrier plugin in the error message for some bizzare reason. I've tried turning the plugin off, but that just moved it up from the bottom of the plugin list to the next highest plugin up. Why is it referencing my plugins at all? What have I failed to define?
Problem number 2:
Even if I can send info from the game to the script I'm writing, I don't know how to send info the other way. I know I'm supposed to write something between "case i === 0:" and "break;", but I have no idea what that something is. That's more of a general question, I know, but hey, when you're as stuck as I am, it's a good idea to ask a lot of questions.
Whatever feedback you can provide is deeply appreciated. Thanks for reading to the end
