Let's talk about LUA! [QA.Win.64.882.Date.11.08.19]

Discussion in 'Lua Discussions' started by Drake Aedus, Nov 9, 2019.

Thread Status:
Not open for further replies.
  1. Feldon Grimshaw

    Feldon Grimshaw Avatar

    Messages:
    257
    Likes Received:
    449
    Trophy Points:
    28
    Based on the google doc and the latest round of tweets, here's my understanding of the current state of the Lua API (as of the time of this posting .. i'm sure it will continue to evolve).

    [​IMG]
     
    Drake Aedus, Astirian and John Markus like this.
  2. Toular

    Toular Avatar

    Messages:
    661
    Likes Received:
    631
    Trophy Points:
    93
    My first whack at a useful script:

    function Update()
    end

    ConsoleLog( "Initializing" )

    interestedStats = {
    275, 304, 366, 411, 427,
    428, 429, 430, 5, 6,
    92, 233, 406, 70, 93,
    15, 18, 40, 410, 435,
    84, 17, 181, 327, 328,
    329, 330, 331, 332, 333,
    334, 335, 336, 434, 10,
    11, 129, 130, 131, 322,
    323, 405, 451, 97, 98,
    317, 318, 319, 48, 49,
    58, 61, 62
    }

    linespace = 18

    function OnGUI()
    for i, statNumber in ipairs( interestedStats ) do
    GUILabel( 60, 50 + i * linespace, 390, linespace * 1.4,
    string.format( "%50s = %6.3f", GetStatNameByNumber( statNumber ), GetStatValueByNumber( statNumber ) ) );
    end
    end

    It dumps a bunch of stats down the left side of the screen. It would be nice to have a mono-spaced font so my attempt at formatting worked.

    Also, the "linespace" may need to be adjusted, depending on a person's font size.
     
  3. Toular

    Toular Avatar

    Messages:
    661
    Likes Received:
    631
    Trophy Points:
    93
    One thing that's nice to see are my virtue values .... I had no Idea I was that high on Love. Apparently I lack in Courage, though. Not sure why ...

    One thing that I'm curious about ... I'm wearing a full set of Epic Leather, but my "LightArmorSetBonus" is 0. If I assume that's a boolean value, it seems it should be 1.
     
    Last edited: Nov 10, 2019
  4. Tiina Onir

    Tiina Onir Avatar

    Messages:
    1,103
    Likes Received:
    1,900
    Trophy Points:
    125
    Location:
    Bramble, South Paladis
    I'm pretty sure it will be. Remember this is a VARY pre-alpha addition. There's still a lot to do, in this phase alone. It wasn't due to be in-game, really, until the end of the year.
     
    Astirian likes this.
  5. Barugon

    Barugon Avatar

    Messages:
    15,716
    Likes Received:
    24,336
    Trophy Points:
    153
    Gender:
    Male
    LOL, I bet they didn't intend to expose the virtue stats.
     
  6. Katu

    Katu Avatar

    Messages:
    454
    Likes Received:
    777
    Trophy Points:
    55
    Gender:
    Male
    Location:
    Finland
    Those are part of normal "/stats" command output. So they are available for Lua.
    • VirtueCourage
    • VirtueLove
    • VirtueTruth
     
  7. Barugon

    Barugon Avatar

    Messages:
    15,716
    Likes Received:
    24,336
    Trophy Points:
    153
    Gender:
    Male
    If you look at the output that /stats gives then you'll note that all three of those are -1. This was done explicitly because the devs didn't want people minmaxing them.
     
    fooBrew, Jaesun and Alley Oop like this.
  8. Toular

    Toular Avatar

    Messages:
    661
    Likes Received:
    631
    Trophy Points:
    93
    Yeah, it feels like getting the actual values for the virtues might be unintended; they are definitely not -1.
     
  9. Katu

    Katu Avatar

    Messages:
    454
    Likes Received:
    777
    Trophy Points:
    55
    Gender:
    Male
    Location:
    Finland
    Oh, I thought ( for some reason ) that -1 was just my QA character. Lua API really does return the actually values.

    Nice :)

    If you have "Lua" folder next to game exe file, with "bootstrap.lua" file in it, this is the code that shows the virtues.

    function OnGUI()
    GUILabel(100,500,200,100, GetStatNameByNumber(317) .. ": " ..GetStatValueByNumber(317))
    GUILabel(100,520,200,100, GetStatNameByNumber(318) .. ": " ..GetStatValueByNumber(318))
    GUILabel(100,540,200,100, GetStatNameByNumber(319) .. ": " ..GetStatValueByNumber(319))
    end
     
  10. Daxxe Diggler

    Daxxe Diggler Avatar

    Messages:
    2,692
    Likes Received:
    5,711
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Virtue Oasis - Hidden Vale
    Let's not forget the /loctrack command . This command already puts a constant UI box on-screen that shows your /loc coordinates constantly.

    I'm sure a smart programmer will eventually be able to use or modify this existing element. ;)
     
  11. Drake Aedus

    Drake Aedus Avatar

    Messages:
    536
    Likes Received:
    886
    Trophy Points:
    75
    Gender:
    Male
     
    Tiina Onir likes this.
Thread Status:
Not open for further replies.