[RGSS3] RETCON Library - Detecting current entry

Discussion in 'RGSSx Script Support' started by ZirconStorms, Oct 29, 2019.

  1. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    332
    Likes Received:
    108
    First Language:
    English
    Primarily Uses:
    RMVXA
    Script is called RETCON LIBRARY: JOURNAL by McDohl.
    Link: https://rpgmaker.net/scripts/272/

    I'm trying to detect the current entry that the Journal window is showing, in order to adjust info shown in a custom window. I feel like it has to do with this line (approx. line 338):
    Code:
    entry = $game_party.journal[@page.currentpage][0].to_str
    but I don't know what the first line should be in order to achieve something along the lines of:
    Code:
    case [code to figure out the entry array being used]
    when 1 (AKA when the player is looking at the first entry in the module)
    then [insert custom text + refresh window].
    when 2
    same process.
    etc...
     
    #1
  2. Engr. Adiktuzmiko

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

    Messages:
    14,640
    Likes Received:
    2,967
    Location:
    Philippines
    First Language:
    Tagalog
    if you're doing this inside Scene_Journal itself

    Code:
    case @journalwindow.page.currentpage
    
    if on other Class

    Code:
    case SceneManager.scene.journalwindow.page.currentpage
    
    But for the 2nd code to work, you might need to add this first
    Code:
    class Scene_Journal
      def journalwindow
        return @journalwindow
      end
    end
    
    Also these would only work if you are inside the Journal scene as the "page" doesnt exist unless you're on that scene.
     
    Last edited: Oct 29, 2019
    #2
    ZirconStorms likes this.
  3. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    332
    Likes Received:
    108
    First Language:
    English
    Primarily Uses:
    RMVXA
    Doing it in Scene_Journal itself gives this error:
    upload_2019-10-29_17-34-34.png

    example of code in use, right now:
    Code:
    case @journalwindow.page.currentpage
    when 1
    msgbox("test 1")
    when 2
    msgbox("test 2")
    else
    end
     
    Last edited: Oct 30, 2019
    #3
  4. Engr. Adiktuzmiko

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

    Messages:
    14,640
    Likes Received:
    2,967
    Location:
    Philippines
    First Language:
    Tagalog
    Add this code then

    Code:
    class Window_Journal
      def page
        return @page
      end
    end
    
     
    #4
    ZirconStorms likes this.

Share This Page