check eventId from another functions?

● ARCHIVED · READ-ONLY
Started by Isabella Ava 9 posts View original ↗
  1. Erm Hi : =)
    You see that i try to run a simple function for each Event in the map (RPGMV)
    $gameMap.events().forEach(function(event) {
    if (event._stb) {
    if (event._stb == 1 && event.x == 16 && event.y >= 26) {
    $gameMap.event(X)._ccheck = $gameMap.event(X)._ccheck || 0;
    $gameMap.event(X)._ccheck = 1;
    }}});

    But within this function, i need to get eventId of the event that is running this code (assume that i don't know it)
    I tried several ways but cannot get eventId of the "host" event
    Please help, thank you :=(
  2. There ya go my bud:

    The event ID:
    Code:
    this._eventId

    The whole event
    Code:
    $gameMap.event(this._eventId)
  3. KanaX said:
    There ya go my bud:

    The event ID:
    Code:
    this._eventId

    The whole event
    Code:
    $gameMap.event(this._eventId)
    Hi @KanaX := )
    Thank you but when i ran
    $gameMap.event(this._eventId)
    inside of another function (like my sample code above) it will give 'undefined' error
  4. Where do you run it from?

    Edit: I stupidly assumed that you are using script calls, which isn't the case.

    try this'n:

    Code:
    event._eventId
  5. Thanks @KanaX := ) everything going well with your Spriter Battle plugin?
  6. Working out some weird flickering and timing issues but the gist of it is done :) Did it work?
  7. KanaX said:
    Working out some weird flickering and timing issues but the gist of it is done :) Did it work?
    It did not work but i realized that i was asking for an impossible thing : =P
  8. Okay, again, show me where you are using it :p Or tell me what you want to do.
  9. Thanks for your kind @KanaX
    however i make it simple by assign the hostId to a global variable like this:
    var test = this._eventId;
    $gameMap.events().forEach(function(event) {
    if (event._stb) {
    if (event._stb == 1 && event.x == 16 && event.y >= 26) {
    $gameMap.event(test)._ccheck = $gameMap.event(test)._ccheck || 0;
    $gameMap.event(test)._ccheck = 1;
    }}});
    Erm.. so it's is kinda of a curious question only.. : =)