Aquadrizzt Posted January 23, 2017 Share Posted January 23, 2017 Is it possible to display a character's tracking value in the SoD new UI? Ideally it would be displayed right next to Lore: Lore: 40 Tracking 35 How would I go about doing this if it was possible? Link to comment
Magus Posted January 24, 2017 Share Posted January 24, 2017 not sure about new ui, but I think Virtue mod added things to character screen in classic Link to comment
Aquadrizzt Posted January 24, 2017 Author Share Posted January 24, 2017 Yes that is a good starting point. Not sure if it works well with what I'm trying to do, but it is a start (it adds 3k lines to baldur.bcs for starters). Link to comment
Avenger Posted February 5, 2017 Share Posted February 5, 2017 I don't think this can be done. The engine doesn't pass this info down to the gui script. Link to comment
kjeron Posted February 5, 2017 Share Posted February 5, 2017 Could you use splprot+opcode 326 to detect the tracking stat, and remove/apply a different portrait icon for each possible value? Portrait Icons and their Names are passed through the GUI as Status Effects. Link to comment
subtledoctor Posted February 5, 2017 Share Posted February 5, 2017 Can you use numbers as portrait icons? Link to comment
Grammarsalad Posted February 5, 2017 Share Posted February 5, 2017 Can you use numbers as portrait icons?You would just need to make the custom bam a recognizable number, wouldn't you? But that would be a different status for each digit. That is a lot. I seem to recall some kind of limit regarding the number of custom portrait icons Link to comment
kjeron Posted February 5, 2017 Share Posted February 5, 2017 Unless there's some underlying problem I think that limit has been lifted with the latest update to STATDESC.2DA. I was able to add 255 more listings, they've so far displayed correctly through opcode 142. Link to comment
Grammarsalad Posted February 6, 2017 Share Posted February 6, 2017 Unless there's some underlying problem I think that limit has been lifted with the latest update to STATDESC.2DA. I was able to add 255 more listings, they've so far displayed correctly through opcode 142. Excellent news! Link to comment
kjeron Posted February 6, 2017 Share Posted February 6, 2017 Here's what I was able to come up with: // Add Splprot.2da info for Tracking Stat = param1 DEFINE_ACTION_FUNCTION ADD_SPLPROT INT_VAR stat = 0 value = 0 relation = 0 RET new_row BEGIN COPY_EXISTING ~SPLPROT.2DA~ ~override~ COUNT_2DA_COLS cols COUNT_2DA_ROWS cols rows TEXT_SPRINT check_row ~~ TEXT_SPRINT check_stat ~~ SET new_row = 0 FOR(current_row = 0; current_row < rows; ++current_row) BEGIN READ_2DA_ENTRY current_row 1 cols check_stat PATCH_IF (~%check_stat%~ STRING_EQUAL ~%stat%~) BEGIN READ_2DA_ENTRY current_row 2 cols check_value PATCH_IF (~%check_value%~ STRING_EQUAL ~%value%~) BEGIN READ_2DA_ENTRY current_row 3 cols check_relation PATCH_IF (~%check_relation%~ STRING_EQUAL ~%relation%~) BEGIN new_row = current_row current_row = rows END END END END PATCH_IF (new_row = 0) BEGIN FOR(current_row = 0; current_row < rows; ++current_row) BEGIN READ_2DA_ENTRY current_row 1 cols check_stat PATCH_IF (~%check_stat%~ STRING_EQUAL ~*~) BEGIN new_row = current_row current_row = rows END END PATCH_IF (new_row = 0) BEGIN new_row = rows INSERT_2DA_ROW rows cols ~%new_row% %stat% %value% %relation%~ END ELSE BEGIN SET_2DA_ENTRY new_row 1 cols ~%stat%~ SET_2DA_ENTRY new_row 2 cols ~%value%~ SET_2DA_ENTRY new_row 3 cols ~%relation%~ END END BUT_ONLY END LAF ADD_SPLPROT INT_VAR stat = 33 value = ~-1~ relation = 1 RET new_row END // Add Portrait Icon to Statdesc.2da. COPY_EXISTING ~STATDESC.2DA~ override COUNT_2DA_COLS cols READ_2DA_ENTRIES_NOW ~PXSTATDESC_ROW~ cols SET MAX_ID = 0 FOR (i = 0; i < PXSTATDESC_ROW; ++i) BEGIN READ_2DA_ENTRY_FORMER ~PXSTATDESC_ROW~ i 0 STATDESC_ID PATCH_IF MAX_ID < STATDESC_ID BEGIN MAX_ID = STATDESC_ID END END INNER_ACTION BEGIN OUTER_SET index = MAX_ID + 1 END FOR (i = 1; i < 256; ++i) BEGIN SET row = i + MAX_ID SET strref = RESOLVE_STR_REF (~Tracking: %i%~) INSERT_2DA_ROW PXSTATDESC_ROW cols ~%row% %strref% SPCL920B~ ++PXSTATDESC_ROW END PRETTY_PRINT_2DA BUT_ONLY // New spell, Cast Track#.spl with # = Tracking COPY_EXISTING ~SPIN101.SPL~ ~override\TRACKING.SPL~ WRITE_LONG NAME1 ~-1~ WRITE_LONG NAME2 ~-1~ WRITE_ASCII 0x10 ~~ #60 WRITE_BYTE 0x34 1 LPF DELETE_EFFECT END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = new_row STR_VAR resource = EVAL ~TRACK0~ END FOR (i = 1; i < 256; ++i) BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = i parameter2 = new_row STR_VAR resource = EVAL ~TRACK%i%~ END END // New spell, Remove Effects(Icon) of TrackIco.spl if Tracking = 0 COPY_EXISTING ~SPIN101.SPL~ ~override\TRACK0.SPL~ WRITE_LONG NAME1 ~-1~ WRITE_LONG NAME2 ~-1~ WRITE_ASCII 0x10 ~~ #60 WRITE_BYTE 0x34 1 LPF DELETE_EFFECT END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 STR_VAR resource = ~TRACKICO~ END // New spell for each, Cast TrackIco.spl at Level = Tracking OUTER_FOR (i = 1; i < 256; ++i) BEGIN COPY_EXISTING ~SPIN101.SPL~ ~override\TRACK%i%.SPL~ WRITE_LONG NAME1 ~-1~ WRITE_LONG NAME2 ~-1~ WRITE_ASCII 0x10 ~~ #60 WRITE_BYTE 0x34 1 LPF DELETE_EFFECT END LPF ADD_SPELL_EFFECT INT_VAR opcode = 333 target = 1 parameter1 = 1 parameter2 = i STR_VAR resource = ~TRACKICO~ END END // New Spell, Remove Effects of self, Display Portrait Icon = "Tracking: #" COPY_EXISTING ~SPIN101.SPL~ ~override\TRACKICO.SPL~ WRITE_LONG NAME1 ~-1~ WRITE_LONG NAME2 ~-1~ WRITE_ASCII 0x10 ~~ #60 WRITE_BYTE 0x34 1 LPF DELETE_EFFECT END READ_ASCII 0x72 ABILITY (40) LPF DELETE_SPELL_HEADER INT_VAR header_type = ~-1~ END FOR (i = 0; i < 255; ++i) BEGIN INSERT_BYTES (0x72 + i * 0x28) 40 WRITE_EVALUATED_ASCII (0x72 + i * 0x28) ~%ABILITY%~ #40 WRITE_SHORT (0x72 + i * 0x28 + 0x10) (i + 1) END WRITE_SHORT 0x68 255 WRITE_SHORT 0x6a (0x72 + 255 * 0x28) FOR (i = 0; i < 255; ++i) BEGIN LPF ADD_SPELL_EFFECT INT_VAR header = (i + 1) opcode = 142 target = 1 parameter2 = (i + index) timing = 9 END END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 STR_VAR resource = ~TRACKICO~ END /* Text to add to UI.MENU ... somehow ~~~~~ for index = 1, 255, 1 do local icon = index + %MAX_ID% local strtxt = icon .. "" if (characters[currentID].statusEffects[strtxt] ~= nil) then table.insert(listItems, {characters[currentID].statusEffects[strtxt].strRef, ""}) end end ~~~~~ right after: elseif currentTab == 3 then listItems = { { characters[currentID].proficiencies.lore.strRef, characters[currentID].proficiencies.lore.current }, { characters[currentID].proficiencies.reputation.strRef, characters[currentID].proficiencies.reputation.current, characters[currentID].proficiencies.reputation.helpStrRef }, } */ /* Casting "TRACKING.spl" whenever the Tracking Stat gets altered will detect the current value of the Tracking Stat, then display the corresponding Portrait Icon, or remove the Icon is Tracking = 0. They are redirected through one of the 255 subspells and then back to "TRACKICO.spl" at different levels so that I only need one instance/resource for Opcode 321 "Remove Effects by Resource". In the Record Screen, under Status Effects you'll see: [icon] Tracking: # In the Record Screen, under the Skills Tab you'll see: Lore: # Reputation: Something(#) Tracking: #: That last ":" in "Tracking: #:" is a part of the list, its expecting another string/value to display after it, which I left empty. Over the sidebar portrait you'll see a normal portrait icon. The BAM I used for the Portrait Icon is just the same one used by the Tracking Ability, it gets resized for the portrait, but cropped in the record screen. */ If we only had a way to detect portrait icons with SPLPROT we could do this with anything, not just stats. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.