Hi all,
What I want to do:
Make an item that will teach skills to an actor, ONLY if they have reached a certain level in a certain class. For instance, an actor can only learn Lv.2 black magic through a certain item if they've leveled up the black mage class enough.
What I've done:
Made the item trigger a state and a common event. In the common event, there are the conditions of the selected actor being 'afflicted' by said state, as well as knowing a 'dummy' skill that is learned by leveling up the class in question. When both conditions are met, the actor will learn the skill(s) I want them to learn. My problem with this method is that since it's running an event, it closes the menu, and I'd rather have it act like using an item normally (with no menu closing). I've gotten close to fixing this by adding in the common event the script SceneManager.push(Scene_Item); BUT that puts the menu back in the first item category on the first item. I want it to stay on the item/category that the cursor was previously on.
Suspected solves/workarounds:
I suspect the most efficient way of solving the problem is if there exists a scene interpreter compatible with MZ. This way, I could run the events in the menu without closing it at all. Alternatively, I could put a command at the end of the event telling the game to reopen the menu and go to the item scene AND in the correct index/category, as well as put the cursor back on the item, but I'm not sure if this method is even possible. I've read something about being able to define certain indexes of scenes (such as the key items category) so that they can be called directly, which would get me part of the way there. I'm just not well versed in coding so I'm not sure how to go about executing this.
Any and all workarounds/solutions to achieve the desired end result are welcome (even if it's a method I haven't thought of)! Thanks in advance for the help.
P.S. Feel free to move this thread to wherever if it's in the wrong location!
What I want to do:
Make an item that will teach skills to an actor, ONLY if they have reached a certain level in a certain class. For instance, an actor can only learn Lv.2 black magic through a certain item if they've leveled up the black mage class enough.
What I've done:
Made the item trigger a state and a common event. In the common event, there are the conditions of the selected actor being 'afflicted' by said state, as well as knowing a 'dummy' skill that is learned by leveling up the class in question. When both conditions are met, the actor will learn the skill(s) I want them to learn. My problem with this method is that since it's running an event, it closes the menu, and I'd rather have it act like using an item normally (with no menu closing). I've gotten close to fixing this by adding in the common event the script SceneManager.push(Scene_Item); BUT that puts the menu back in the first item category on the first item. I want it to stay on the item/category that the cursor was previously on.
Suspected solves/workarounds:
I suspect the most efficient way of solving the problem is if there exists a scene interpreter compatible with MZ. This way, I could run the events in the menu without closing it at all. Alternatively, I could put a command at the end of the event telling the game to reopen the menu and go to the item scene AND in the correct index/category, as well as put the cursor back on the item, but I'm not sure if this method is even possible. I've read something about being able to define certain indexes of scenes (such as the key items category) so that they can be called directly, which would get me part of the way there. I'm just not well versed in coding so I'm not sure how to go about executing this.
Any and all workarounds/solutions to achieve the desired end result are welcome (even if it's a method I haven't thought of)! Thanks in advance for the help.
P.S. Feel free to move this thread to wherever if it's in the wrong location!