Tsukihime 1,489 Posted October 21, 2012 Common Event Arguments -Tsukihime This script allows you to reserve common event arguments using script calls and then retrieve them in the common event. Naturally, common events would be more flexible if you could pass in arguments, like functions in programs. Download Script: http://db.tt/R846qNLZ Usage You should set the arguments before making a common event call using a script call add_cevent_args(1, 2, 3, ...) Then, in the common event, you can retrieve them using script calls as well args = $game_temp.common_event_args You would use script calls to assign them to variables or switches or anything else you might want to do. As an example, here is a "show picture" common event that takes the name of a picture to show as an argument, and then I use methods in Picture Wrapper to display the image Share this post Link to post Share on other sites
Tsukihime 1,489 Posted December 16, 2012 (edited) I have added a convenience function that allows you to set the common event arguments directly. 1. In the configuration, you reserve a range of variables. For example, if you write 1..10, that means $game_variables[1] through $game_variables[10] will be used for common event arguments. 2. Use the script call inside an event set_cevent_args(arg1, arg2, ... ) The first reserved variable will store arg1. The second reserved variable will store arg2. And so on. The variables will be re-used constantly, and cleared out after the common event finishes executing, so they will only be available during the life-time of the common event call. 3. Use "Conditional Branch" command as usual, checking the appropriate variables. This is purely for convenience and saves you from having to retrieve the variables later yourself. Note that if you are using non-numeric arguments, you will still have to use scripted conditional statements since RM's variables only support numbers (and integers at that...) Edited December 16, 2012 by Tsukihime Share this post Link to post Share on other sites