Updating Item Category Names In-Menu?

Post » Thu May 12, 2016 12:09 am

As part of my Mod, I open up the GiftMenu on a 'Merchant' NPC, and let the player 'Buy' items using a series of Function set up--it's part of a pseudo-perk system. Before opening the Menu, though, I grab the Strings for the various Categories I'm using (All, Weapons, Apparel, Scrolls, Books), and then update the String to my new Category names, and a variable representing how many Perk Points the Player has to spend.



Except for the 'All' set, this works perfectly--when moving Category, it shows the 'Perk Category' instead of the Item type (i.e., "Powers", instead of "Books"). For some reason, though, the "All" category does not update like the rest :/



The other issue is, the String only updates before the Menu opens--even though I update them after buying the Perk, the Category name will not change unless I close the Menu and reopen it.



So, I was hoping for some help on these two points:


  1. How do I get the 'All' category to update? The String seems to be sAllItems, but changing this has no effect.

  2. How do I get the String to update whilst the menu is open? I was thinking I could use one of the UI Script's Invoke Functions, but I don't know where to find the 'target' of those Scripts, and I am not familiar with how to actually use them.

Any help would be great :)

User avatar
[ becca ]
 
Posts: 3514
Joined: Wed Jun 21, 2006 12:59 pm

Post » Wed May 11, 2016 2:16 pm

Oooo! Willing to part with any more info?



I take it you've tried while loops, OnOpen or a forced close on the first opening to allow for an update already but maybe divide the gift menu with formlists so that there's only a powers menu on its own, perk menu on its own. The merchant could have several different options for each category and they would all be separate. If no one ends up helping, maybe think about circumventing the problem instead of trying to solve it.

User avatar
Gen Daley
 
Posts: 3315
Joined: Sat Jul 08, 2006 3:36 pm

Post » Wed May 11, 2016 3:09 pm

It's not that impressive unfortunately :P



Basically just a Merchant in a Remote Cell; force open his Gift Menu, and then pick Items from the list--when added to the Player's inventory, these Items fire-off a Function in a Quest Script relative to their Item-Type, see if the Player can afford them (if not, the item is re-added to the Merchant, otherwise I run whatever the Perk is meant to do. It's mainly limited by which items have Descriptions, but it seems to work OK for what I want. You have to move the Merchant to your own Cell, however, because otherwise their Gift Menu does not update when items are added. It's a LOT of work, but since we cannot add actual Perk Trees... :D



ForceClose is something I've not tried; I might be able to do that... It'd be a bit visually-messy depending how quick it is, but it'd be better than what I have now :D

User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Wed May 11, 2016 7:42 pm

Have you thought about using the perk tree method that is used in Camp Fire? Have you ever played the Gothic games? They have a trainer 'teach' the player 'perks'. It's pretty cool how they explain how to remove claws and skin through dialogue and then the player gains the ability to do so if they have the 'perk points' and required level. Quite immersive.



I'm surprised that no one has made a MCM perk system that makes it easy to add new menu based trees. Throwing weapons redux has a very simple one based on weapons hits and a counter.

User avatar
Shaylee Shaw
 
Posts: 3457
Joined: Wed Feb 21, 2007 8:55 pm

Post » Thu May 12, 2016 12:12 am


Your best bet would be to open https://github.com/Mardoxx/skyrimui/blob/master/src/giftmenu.fla file in e.g. Adobe Flash Professional CS4 (10.0.2), which has a free trial period, or another tool if one exists. The .fla file contains nested instances and the names of those instances are parts of the target string.

User avatar
Angela
 
Posts: 3492
Joined: Mon Mar 05, 2007 8:33 am

Post » Wed May 11, 2016 9:16 am

Thanks MrJack.



Any chance you can give me a little more direction? When I open the file, I see this :


https://41.media.tumblr.com/a3fb66ce310282102af9b31d74f29dbb/tumblr_o6344ghuyi1vqcasyo1_1280.png



I assume the 'Sprites' are the part I need? The problem is, I cannot seem to work out which parts are actually for headings; like, I canfind the sprint that seems to control the lists, but cannot seem to find out how the actual titles of those sections are identified. For example, there's Sprite59, which is called 'ItemCardList', which looks like it's the individual items you're looking through; but I cannot (seem to) see the super-menu that belongs to.



I think it is Sprite55, which is imported, and has no identifier.



I assume, if I've got this right, it'd be :



UI.InvokeString("GiftMenu", "Imported/Sprite55", "My New String")



Does that seem correct, or...?



Thanks for any help! :D

User avatar
Michelle Smith
 
Posts: 3417
Joined: Wed Nov 15, 2006 2:03 am

Post » Wed May 11, 2016 1:50 pm

It has been quite a while since I last did this so my memory is a bit fuzzy and I can't check it up since I don't have the development environment set up anymore. The dark grey rectangle is the "stage" that has instances of base objects (listed on the right) and you'll probably have to go and root around in the layers (bottom of the window) to find the layer that contains the instances you are interested in.



The target string usually looks something along the lines of:



"_root.SleepWaitMenu_mc.HoursSlider.maximum"

SleepWaitMenu_mc is an instance found in the root of the MovieClip, HoursSlider is an instance of a slider found within SleepWaitMenu_mc, and maximum is a float number property defining the maximum value that HoursSlider can have. A base object may have one name, but each instance of a base object has a unique identifier if you want to reference them in ActionScript. You need to find the identifiers of the instances instead of the identifiers of the base objects, which is what you seem to have found.



The gift menu may be using parts of other menus (I think that is the case with almost every menu even vaguely reminiscent of the inventory menu), which makes things more complicated. So you might get a part of the path from giftmenu.fla and the rest from whichever other menu is linked/imported.



It will take a while to understand how the UI system works (Flash, ActionScript, interoperability between ActionScript and Papyrus, etc.). If you want to pick apart an existing UI mod (.fla, .as, and .psc files), then you can check out https://github.com/Kapiainen/Extended-UI. I included all of the source files and you can check out how e.g. one can call functions defined in a menu's ActionScript from Papyrus with the help of functions added by SKSE.

User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am


Return to V - Skyrim