Common Event not starting

Discussion in 'Learning Ruby and RGSSx' started by Yuuta Kirishima, Oct 31, 2016.

  1. Yuuta Kirishima

    Yuuta Kirishima Software Engineer/Professional Mayonnaise Player Veteran

    Messages:
    550
    Likes Received:
    131
    Location:
    North Carolina
    First Language:
    Engilsh
    Primarily Uses:
    RMMV
    I have set up a simple web system were the game pulls a version number from the server,


    How it works:


    Game retrieves the version number from the servers rb file version.rb which contains the following code:


    $server_version = 0.1


    Then it evals the version.rb file to inster the global variable into the game,


    The game compares the $server_version to the $client_version using this code:


    if $client_version != $web_version then
    $game_temp.reserve_common_event(2)
    end

    # This is run inside of an in-game event.


    this should simply run the common event if the two numbers are different,


    so I changed the $client_version to 0.0,


    if my math is correct 0.0 does not equal 0.1,


    so why isn't the common event starting?
     
    Last edited by a moderator: Oct 31, 2016
    #1
  2. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,543
    Likes Received:
    2,900
    Location:
    Philippines
    First Language:
    Tagalog
    Have you tried debugging it? like seeing if the if actually turns true?


    if $client_version != $web_version then
    p "true"
    $game_temp.reserve_common_event(2)
    end


    this should print out true if the condition is true which then means the problems lies on the actual common event call..


    TBH, since ur doing it in an event you could just use the default conditional branch event command and go to third tab to use a script call based condition and call the common event using the default event command too


    CommonEvent.PNG
     
    #2
  3. Yuuta Kirishima

    Yuuta Kirishima Software Engineer/Professional Mayonnaise Player Veteran

    Messages:
    550
    Likes Received:
    131
    Location:
    North Carolina
    First Language:
    Engilsh
    Primarily Uses:
    RMMV
    Edit: It did print true, I was looking at the wrong thing, but the common event still doesn't run.


    [​IMG]
     
    Last edited by a moderator: Oct 31, 2016
    #3
  4. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,581
    Likes Received:
    1,360
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    did you try 

    Code:
    //not equal value or not equal type    
    x !== 5
     
    #4
  5. Yuuta Kirishima

    Yuuta Kirishima Software Engineer/Professional Mayonnaise Player Veteran

    Messages:
    550
    Likes Received:
    131
    Location:
    North Carolina
    First Language:
    Engilsh
    Primarily Uses:
    RMMV
    That gives an error,


    [​IMG]
     
    #5
  6. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,581
    Likes Received:
    1,360
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV


    hey very sorry not see the 


    forget what i say 
     
    #6
  7. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,543
    Likes Received:
    2,900
    Location:
    Philippines
    First Language:
    Tagalog
    Did you try to use the event method that I posted?
     
    #7
    Yuuta Kirishima likes this.
  8. Yuuta Kirishima

    Yuuta Kirishima Software Engineer/Professional Mayonnaise Player Veteran

    Messages:
    550
    Likes Received:
    131
    Location:
    North Carolina
    First Language:
    Engilsh
    Primarily Uses:
    RMMV
    Honestly have no idea why I didn't use the conditional branch before. It works thanks! I must be tired.
     
    Last edited by a moderator: Oct 31, 2016
    #8

Share This Page