The Witcher 3
0 of 0

File information

Last updated

Original upload

Created by

Germ1nal

Uploaded by

Germ1nal

Virus scan

Safe to use

Discussion concerning stats display (5 comments)

  1. ozz61
    ozz61
    • member
    • 1 kudos
    OK I have put together a quick solution using the button press idea (as discussed in my last post below) to switch between item desriptions and I think it could be the way to go.

    See below and let me know what you think. The code could be refactored a bit but you get the idea as a proof of concept first impresssion:

    In input.settings file add the line in [RadialMenu]
    Spoiler:  
    Show

    IK_Pad_LeftThumb=(Action=SwitchRadialItemTextDescription)


    In input.xml add the following line:
    Spoiler:  
    Show

    <Var builder="Input" id="SwitchRadialItemTextDescription" displayName="SwitchRadialItemTextDescription" displayType="INPUTPC" actions="SwitchRadialItemTextDescription" />


    In hudModuleRadialMenu.ws:
    Define a var to keep track of which type of description user has chosen to display.
    Spoiler:  
    Show

    private var SwitchRadialItemTextDescriptionOptionFlag : int;
    default SwitchRadialItemTextDescriptionOptionFlag = 0;


    Add lisenter
    Spoiler:  
    Show

    theInput.RegisterListener( this, 'OnSwitchRadialItemTextDescription', 'SwitchRadialItemTextDescription' );


    Add event when button is pressed
    Spoiler:  
    Show

    // Event for user to select type of description they want displayed e.g. short description, full stats, full description
    event OnSwitchRadialItemTextDescription( action : SInputAction )
    {
    KillItemTimer();

    if ((!m_IsPlayerCiri) && (m_shown))
    {
    if (IsPressed(action))

    // 3 options available
    // 0 = short description + basic stats (default)
    // 1 = Full stats
    // 2 = Full description
    if (SwitchRadialItemTextDescriptionOptionFlag == 2)
    {
    SwitchRadialItemTextDescriptionOptionFlag = 0;
    }
    else
    {
    SwitchRadialItemTextDescriptionOptionFlag = SwitchRadialItemTextDescriptionOptionFlag + 1;
    }

    SelectSlotId();
    }
    }


    Add function to get Full stats info
    Spoiler:  
    Show

    //based on GetBaseItemData function found in guiTooltipComponent.ws
    private function GetRadialItemFullStatsText(item: SItemUniqueId, inv: CInventoryComponent) : String
    {


    var strStats : String;
    var i : int;
    var statsList : CScriptedFlashArray;

    //maxToxicity = RoundMath(thePlayer.GetStatMax( BCS_Toxicity ));

    modQuickRadialSelection_tooltipComponent.initialize(inv, modQuickRadialSelection_flashValueStorage);
    modQuickRadialSelection_tooltipComponent.setCurrentInventory(inv);

    statsList = modQuickRadialSelection_tooltipComponent.GetBaseItemData(item, inv).GetMemberFlashArray("StatsList");

    strStats = "";
    for (i = 0; i < statsList.GetLength(); i += 1)
    {
    strStats += statsList.GetElementFlashObject(i).GetMemberFlashString("value") + " " + statsList.GetElementFlashObject(i).GetMemberFlashString("name") + "<br>";
    }

    return strStats;

    }


    Insert case to compare which option is currently in use and get the description. This should go into function SelectSlotId() before the m_fxUpdateItemIconSFF.InvokeSelfFiveArgs function is called.

    Spoiler:  
    Show

    switch (SwitchRadialItemTextDescriptionOptionFlag)
    {
    case 0:
    //fullDescription = "SHORT DESCRIPTION + BASIC STATS";
    // we break because the methods above have already set short description and basic stats to fullDescription
    break;

    case 1:
    //fullDescription = "FULL STATS";
    fullDescription = "<font color = '" + modQuickRadialSelectionConfig.itemStatsColor + "'>" + GetRadialItemFullStatsText(item, inv) + "</font>";
    break;

    case 2:
    //fullDescription = "FULL DESCRIPTION";
    fullDescription = itemDescription;
    break;

    default:
    break;
    }

  2. ozz61
    ozz61
    • member
    • 1 kudos
    Interesting approach. I tried looking for a way to either expand the number of lines or have different text for the middle and bottom right text display area but couldn't seem to find a way. I think the draw function is called higher up the chain in the game which Im not sure how to influence.

    The limitation of 6 lines makes it difficult to include the ideal info, either the description is cut short or the stats are cut short.

    Your approach is interesting as it seems to balance between the two, however it is difficult to know if cutting the description would have any negative impact for the user missing out potential useful information. On the other hand the user may find the stats info more important. Im not really sure the best way forward to be honest.

    Maybe a button configuration that when you press it switches the display text between Full description and Full Stats by updating the item text displayed somehow; call SelectSlotId again with bool var changed when L Thumbstick button is pressed?

    Alternatively maybe an option for the user to choose what is displayed e.g.
    1. Short description + Basic stats (this could be default option)
    2. Full description + No stats
    3. No description + Full stats
    4. Full description + Full stats (but inform the user in Mod description that some stats are cut off for long item descriptions)

    On testing I did notice the text size seems to cut off the last line for Grapeshot Bomb and Superior Swallow; even though they were only showing 5 lines. I removed the Size format from the code (so it uses the default size) and it now shows all 6 lines for both. Im wondering whether the size format is useful or maybe just keep the default text size instead.

    I am using the English Language version for reference so Im not sure how the text is displayed for other languages or what is cut off etc.
  3. Germ1nal
    Germ1nal
    • member
    • 3 kudos
    Yes, I think you have the right method here. I added a modification to display only the regen and duration attributes, so as not to have the whole list for all.
    Here it is:
    https://www.dropbox.com/s/xyvcu1gzkw90mxa/modQuickSelection_Standalone.zip?dl=0

    I also added at the same time a new file modQuickRadialSelectionConfig.ws containing all the config values.

    I am considering adding another option to have the whole list of attributes. I don't want all myself, but might as well give the option.
  4. ozz61
    ozz61
    • member
    • 1 kudos
    I think the latest method I posted is the way to go.

    I meant it is a simpler way to retrieve the item stats (instead of a simplfied version of the stats).

    It also retrieves the item stats including buffs (as seen in the Inventory menu); I think it is using the same method to what the inventory menu uses as far as I can tell.

    This is a much better way than my previous method because there are no "hacks" to get the item stats. It will follow same process how the Inventory menu shows the stats so the code is a lot more manageable.

    And if CDPR change what stats are shown, it "shouldn't" need much work (maybe none additional) to show the same stats as the Inventory menu displays.
  5. Germ1nal
    Germ1nal
    • member
    • 3 kudos
    Hi.

    I create this forum to be a follow-up of the following posts:
    http://forums.nexusmods.com/index.php?/topic/3252549-quick-radial-selection/?p=29480609

    Here are the last posts to summarize the point:

    OK. I have managed to find a much simplified version of getting the stats information.

    It is based on GetBaseItemData function found in guiTooltipComponent.ws but only using the interesting parts which get the Items stats.

    I believe the Inventory Menu uses this function to get item information for all items including weapons, armor, alchemy etc. So I have made a cut down version which only gets the item stats.

    Insert the below at line 1172 (in version 1.5 of hudModuleRadialMenu.ws) This is so we can append the item stats at the end of the description. You can adjust where you want the stats to be placed e.g. before or after and also set the Color and Font size etc.

    Spoiler:  
    Show

    fullDescription += "<br/><font size = '21' color = '#B58D45'>" + GetRadialItemStatsText(item,inv) + "</font>";



    Add the following function to hudModuleRadialMenu.ws
    Spoiler:  
    Show

    //based on GetBaseItemData function found in guiTooltipComponent.ws
    function GetRadialItemStatsText(item: SItemUniqueId, inv: CInventoryComponent) : String
    {

    var strStats : String;
    var i : int;
    var tooltipComponent : W3TooltipComponent;
    var m_flashValueStorage_radialstats : CScriptedFlashValueStorage;
    var tooltipData : CScriptedFlashObject;
    var statsList : CScriptedFlashArray;

    m_flashValueStorage_radialstats = GetModuleFlashValueStorage();
    tooltipComponent = new W3TooltipComponent in this;
    tooltipComponent.initialize(inv, m_flashValueStorage_radialstats);
    tooltipComponent.setCurrentInventory(inv);
    statsList = tooltipData.CreateFlashArray();
    strStats = "";

    tooltipData = tooltipComponent.GetBaseItemData(item,inv);
    statsList = tooltipData.GetMemberFlashArray("StatsList");


    for (i = 0; i < statsList.GetLength(); i += 1)
    {
    strStats += statsList.GetElementFlashObject(i).GetMemberFlashString("value") + " " + statsList.GetElementFlashObject(i).GetMemberFlashString("name") + "<br>";
    }

    return strStats;
    }


    There are only 6 lines displayed in the bottom right hand text box so some of the stats are cut off becuase the description is so long for some items or there are a lot of stats.

    I was thinking possible ways to improve could be:

    - Increase the Text box size
    - Display the Item name, category, description in the Middle box; and use the bottom right hand box to display the item stats.



    I have been thinking about it yesterday, too. Modifying the name is not desirable, as it is used for other things than display.
    I went for a simple solution: Cut the description until it has a correct length. I did this by removing sentences. There are still a few problems when the description is one long sentence, but it works ok. Instead of just adding to fullDescription, copy this:

    endPoint = "";
    ItemCharac = GetRadialItemStatsText(item,inv);

    if (StrLen(ItemCharac) > 5)
    {
    // Cut the description if it exceeds 90 letters (4 lines)
    //LogChannel('RADIALTEST', fullDescription + " " + StrLen(fullDescription));
    while ((StrLen(fullDescription) > 90) && (StrFindLast(fullDescription, ".") > -1))
    {
    endPoint = ".";
    fullDescription = StrLeft(fullDescription, StrFindLast(fullDescription, "."));
    }
    fullDescription += endPoint;
    //LogChannel('RADIALTEST', fullDescription + " " + StrLen(fullDescription));
    fullDescription += "<br/><font size = '21' color = '#B58D45'>" + GetRadialItemStatsText(item,inv) + "</font>";
    }

    I am also working on the item buffs, I am not fully satisfied with it. I will look at your new version.