Cannot use Variable as Event ID

Discussion in 'RGSSx Script Support' started by MoloRid3r, Feb 15, 2017.

  1. MoloRid3r

    MoloRid3r Villager Member

    Messages:
    24
    Likes Received:
    1
    First Language:
    Thai
    Did i do something wrong?
    Code:
    $game_map.events[$game_variables[48]].animation_id = 115
    Error :
    [​IMG]
    Ps. Variable no.48 = 10 (event no.10)
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Please post a screenshot of the command in the event - I strongly suspect that you have a space there where it doesn't belong, and automatically corrected that mistake when retyping the command here.
     
    #2
  3. Linard

    Linard Veteran Veteran

    Messages:
    202
    Likes Received:
    17
    First Language:
    Filipino
    Primarily Uses:
    RMMV
    Try to remove "s" on the event.
    Just give a try :)

    $game_map.event([$game_variables[48]).animation_id = 115
     
    Last edited: Feb 15, 2017
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,934
    Likes Received:
    11,603
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    No, it's $game_map.events.

    Is that EXACTLY what you have in the script call? Or have you split it onto two lines (or has it done it automatically)? If you've split it onto two lines, it will be because of where the line break occurs. Make the line break after $game_variables[ and before 48.
     
    #4
  5. MoloRid3r

    MoloRid3r Villager Member

    Messages:
    24
    Likes Received:
    1
    First Language:
    Thai
    Sry for late reply. Yes! it's automatically split to another line. So how to type all of it in one line?
     
    #5
  6. Trihan

    Trihan Speedy Scripter Veteran

    Messages:
    1,483
    Likes Received:
    981
    Location:
    Buckie, Scotland
    First Language:
    English
    The script box for events won't always allow you to put your entire script on one line. Do what Shaz said and make a line break after $game_variables[ but before the 48.
     
    #6
  7. MoloRid3r

    MoloRid3r Villager Member

    Messages:
    24
    Likes Received:
    1
    First Language:
    Thai
    I figured it out! Thank you by the way!
    Code:
    a = $game_variables[48]
    $game_map.events[a].animation_id = 113
     
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,934
    Likes Received:
    11,603
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    yeah, that'd work too. But the way we already told you - splitting it, but at a specific place rather than an auto-line break - would have been fine.
     
    #8

Share This Page