Is there any way to run a common event when a weapon is equipped?

● ARCHIVED · READ-ONLY
Started by lixerman99 5 posts View original ↗
  1. I've seen a few posts on the topic but all are VX/VX ACE solutions. I want the player image to change when different weapons are equipped but using a parallel common event with nested conditional branches freezes the player. Is there a fix for this or some solution for this to work?


    (I guess if the common event just ran once, every time the menu was closed, that would work too if it's more possible.)


    RPG MAKER FORUMS Picture.PNG
  2. 1) if a common event parallel process freezes the player, then you made a mistake in the common event.


    Either not enough waits, a logic error or you're triggering an autorun or something like that, because parallel processes never stop the player (they can only lag the game if they have too few waits).


    2) I think tsukihime wrote such a plugin for MV - she definately wrote such a script for Ace and I think it's already ported to MV.
  3. Andar said:
    1) if a common event parallel process freezes the player, then you made a mistake in the common event.


    Either not enough waits, a logic error or you're triggering an autorun or something like that, because parallel processes never stop the player (they can only lag the game if they have too few waits).


    2) I think tsukihime wrote such a plugin for MV - she definately wrote such a script for Ace and I think it's already ported to MV.



    The problem with long waits is that the process will still lag the game, just whenever the process finally takes place. Also, the player image will only be updated a random amount of time after. I'm also unable to track down the tsukihime script you mentioned and have been trying to find the Javascript where the menu window closes and add the '$gameTemp.reserveCommonEvent(0016);' call for the common event there but having no prior knowledge of Javascript as a language, it's been pretty rough. I wish there was still XP's script system.
  4. OK, I just looked at the details of your screenshot - part of the lag is because you went at it in the wrong way, causing unneccessary lag.


    1) remove all elses and make the conditional branches all on the main level. You don't need to nest the branches this way for identical data checks, and that causes some of the problems.


    2) why don't you use the change actor graphic for the image change? using the set move route variant has some disadvantages here.


    3) at the end of each check, use exit event processing to abort the rest of the parallel (after setting the switches or whatever you have at the bottom of the conditionals)


    If an equipment has been confirmed, you don't need to check the rest of the conditionals as the actor can't have two different weapons equipped.
  5. Andar said:
    OK, I just looked at the details of your screenshot - part of the lag is because you went at it in the wrong way, causing unneccessary lag.


    1) remove all elses and make the conditional branches all on the main level. You don't need to nest the branches this way for identical data checks, and that causes some of the problems.


    2) why don't you use the change actor graphic for the image change? using the set move route variant has some disadvantages here.


    3) at the end of each check, use exit event processing to abort the rest of the parallel (after setting the switches or whatever you have at the bottom of the conditionals)


    If an equipment has been confirmed, you don't need to check the rest of the conditionals as the actor can't have two different weapons equipped.

    Wow, this is working really well, thanks!