Call common event with the value of a variable

● ARCHIVED · READ-ONLY
Started by Mihnea 4 posts View original ↗
  1. Hello, there. I have a quick question that is simply; I want to call a common event with the ID of a common event.
    Here's how you call a common event in case anyone needs it https://forums.rpgmakerweb.com/index.php?threads/call-common-event-script-call.47559/
    Also, I came up with this but it doesn't seem to work:
    $game_temp.reserve_common_event($gameVariables.value(78)], 1)
    (78 being my common even ID)
    Any help?
  2. There is only one ] and not any [ ], maybe that's the problem?
  3. In the thread that you have linked, the answer was given by Hudell.

    He wrote:
    Code:
    $gameTemp.reserveCommonEvent(ID)
    You wrote:
    Code:
    $game_temp.reserve_common_event($gameVariables.value(78)], 1)
    Note that these are not the same ($game_temp is not the same as $gameTemp), and in programming, that is very important.

    ID refers to the ID# of the common event, and this can be a number or an expression. So, it could be "41", or it could be "$gameVariables.value(78)", as examples.

    Code:
    $gameTemp.reserveCommonEvent($gameVariables.value(78))
  4. Ebanyle said:
    There is only one ] and not any [ ], maybe that's the problem?
    Yes, that might be a problem too. Cause well: I never worked in Javascript only C# and C++.
    Aloe Guvner said:
    In the thread that you have linked, the answer was given by Hudell.

    He wrote:
    Code:
    $gameTemp.reserveCommonEvent(ID)
    You wrote:
    Code:
    $game_temp.reserve_common_event($gameVariables.value(78)], 1)
    Note that these are not the same ($game_temp is not the same as $gameTemp), and in programming, that is very important.

    ID refers to the ID# of the common event, and this can be a number or an expression. So, it could be "41", or it could be "$gameVariables.value(78)", as examples.

    Code:
    $gameTemp.reserveCommonEvent($gameVariables.value(78))
    Also, Aloe, thank you so much, it worked wonders! I'll even give you some credit up in there if you want :p