EPDGaffney Posted May 11, 2018 Share Posted May 11, 2018 Brilliant, glad it works. Right, the advantage of MessageBoxExAlt is how fast it is to type in your message directly into the script that shows the message, and then not need a whole message form. You do need a UDF script if your buttons do something (I use a blank one for when my buttons have no function, so I just 'call' that script whenever I want to use message boxes that are just to be read and exited), but it's still faster than using the message form. I'm converting more of it over the past couple of days, just for a bit of craic really, but if I decide to do the entire thing, I could hand it off to you for release. The problem is in fact the conditions on the buttons. It turns out that that's one feature of the old message system which I had forgotten about and is to my knowledge unavailable here. So, I'm trying to optimise the code a bit and not keep the quest running, but I am attempting to start and stop the quest just for the messages with conditions on their buttons (2 and 3 I think) and then stop it once it's not needed. To answer your question on how to do it if I wanted to do it with just MessageBoxExAlt, it's possible with if statements, but honestly not really worth it. I'm assuming that when a message button is hidden with the vanilla message box, the other buttons don't lose their index number for the script, correct? Just thought of a possible alternative for use in MessageBoxExAlt, though...using powers of two for int variable values based on which buttons are or are not hidden. Hum...I'll have to give this more thought. All the menus can be organised into one UDF script with variables, similar to what you have now (if iMenu == 1, if iButton == 0 do this, else cancel; if iMenu == 2, if iButton == 0 do that, else cancel, &c.). I think you'd need an array script for some of the other stuff you want. Or you can use GetEquippedObject and a load of ref variables, put everything in the box, sort it, then grab each of the items back out of the containers and add them to the player again and equip them. Or maybe there's a simpler way and I was too tired to think hard enough to remember it. I don't use TTW, so I'm not sure what's left to do to support it. I thought that they just put FO3 into NV, meaning all the same mods should work, should they not? What's in 3.0 that's interesting? Thank you so much for all your help! In case there was any doubt, of course you're also getting co-author credit for the plugin once I release it (or however this site handles collaborations). Couldn't have done it without you.Thanks for that. Appreciate that sort of acknowledgement. Link to comment Share on other sites More sharing options...
FriedStephen Posted May 11, 2018 Author Share Posted May 11, 2018 At this point, I'm just glad we have a fully functional version. Since we've already got a bit of NVSE script in there, may as well make as much use of it as possible, but at least it's not necessary. As for TTW, I've only just begun looking into it, so I don't really know exactly what's happening with 3.0, but I've heard that it breaks compatibility with pretty much all existing TTW mods. I think fortunately for us, New Vegas mods that are mainly scripts pretty much all worked with TTW out-of-the-box, so there shouldn't be any issues with UIS and MAS. All I think I'd need to do is give the Label maker and Mobile Auto-sorter items to a FO3 vendor so that people starting in the capital wasteland can make use of them. Probably would give them to Moira to match Chet. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 11, 2018 Share Posted May 11, 2018 I was working on my own mod and came across this, completely forgetting I'd ever done it:https://prnt.sc/jgdc6n I think fortunately for us, New Vegas mods that are mainly scripts pretty much all worked with TTW out-of-the-box, so there shouldn't be any issues with UIS and MAS.That's exactly what I was thinking. Moira sounds like the best analogue to Chet in my recollection of FO3, fuzzy as that recollection is. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 11, 2018 Share Posted May 11, 2018 I've optimised the majority of the code. However, I've 'ported' a lot of stuff to JIP-orientated methods without knowing what this mod even does. When you interact with a container and you're crouched, you can give it a label or remove that label. That functionality seems to be completely intact. The MAS item itself has that dumping feature which works perfectly if I understand what it does (removes all player items and places them in the labelled containers, placing in the 'main' container any items of categories that have no labelled containers). Is that the whole mod? Link to comment Share on other sites More sharing options...
FriedStephen Posted May 11, 2018 Author Share Posted May 11, 2018 Yup, that's pretty much it. The ability to place/remove labels while sneaking should only be possible while the "Label Maker" item is in your inventory. The buttons for adding a specific label should only appear if the existence of that label on the currently selected container is not true, and the opposite for the "remove label" buttons. The button for "Remove All Labels from All Containers" would only appear if at least one of any of the labels has already been assigned. Those are the QoL features I wanted for a nice, clutter-free UX. Technically the primary function of the mod is simply the sorting, but I wanted my version to go beyond the original, which was a little too bare to fit in with the incredibly polished mods we have these days. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 11, 2018 Share Posted May 11, 2018 Sounds like what I have:https://ufile.io/8k84t I'm not really sure it was worth it, if I'm honest, but I think it's easier to add to it and its performance should be slightly improved. Let me know if anything is missing or wrong. You don't need to use this version, either, as it requires NVSE and JIP LN. I think it needs an icon and model for the label maker. If you want to make it so that whatever the player has equipped remains on their person, I think the easiest way to do that would be with some JIP LN scripts. Link to comment Share on other sites More sharing options...
FriedStephen Posted May 12, 2018 Author Share Posted May 12, 2018 I've only had very little time to pore over your work and a single minute to test the plugin, and I've noticed a couple of issues. The first, more pressing issue was that the "Add Label" menu did not appear when the button was pressed, so I was not able to actually assign any labels to containers to test the rest of the plugin. The "Remove Label" menu seemed to work, but without any labels assigned to a container, I could not confirm if it was still truly working (probably is since you didn't change those two menus.) The second (minor) issue, is that currently it is possible to press the "Dump Inventory" button when no container has been assigned the contMain label, meaning if someone were to do so, their whole inventory would simply disappear. I should be able to easily fix that with an if statement that checks if contMain is anything but 0, and maybe have a corner message appear to say that the inventory can't be dumped yet. The first issue is what I'm concerned about, and I'm sure there's a simple solution, but I need to go over your work to understand the process more, and I won't have time this weekend for that. Otherwise your work seems to be very organised and efficient, though I'm wondering if the quest script delay needs to be so short. I understand that the quest is no longer running all the time, but I don't see what improvement 0.01 seconds could possibly make, and am worried that it could have adverse effects on performance or stability. Then again, I don't know much about this, apart from reading delays below 0.1 seconds were not recommended. I was fine with the 10mm pistol model and junk icon for the label maker, but I'll think about alternatives. I don't think it really warrants any custom artwork, so vanilla assets should be fine. The whole equipped/hotkeyed thing should be possible for me to implement with GetEquippedItemRef and GetHotkeyItem, but I'm still not convinced it's worth the effort. I'll put it on the backburner. Anyway, if you have a chance to give another look at the main issue, that would be greatly appreciated, but I'll make an effort eventually to properly understand all your changes and do thorough testing to ensure I can maintain the plugin in the future. I only ever intended this to be my own undertaking, but you've really gone above and beyond, so much so that I'm a little bewildered. Of course I greatly appreciate it, but it'll take some time for me to catch up. Thank you! Link to comment Share on other sites More sharing options...
FriedStephen Posted May 12, 2018 Author Share Posted May 12, 2018 A quick update:I tried a bit more testing, and got mixed results. The menus seemed to be working again, but a bit slower to load than before. The sorting system seemed to work, but some categories were misplaces sometimes. That may have been my fault as I may have mixed up labels since I was clicking through everything quickly. Eventually, the menus starting to only appear some of the time, and then at one point they stopped appearing completely. To be clear, the MessageBoxExAlt menus were appearing properly and were very responsive, it's just my old ones that were messing up. I wonder if this has something to do with the quest be toggled off and on, maybe it eventually gets stuck in off mode. I'll need to take a closer look at the reorganised aspects, and try to see if there's a loose end somewhere. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 12, 2018 Share Posted May 12, 2018 That's weird. I had absolutely no problems like that. I suppose it could be something to do with the quest being toggled. The engine can go weird with message boxes at times, so maybe toggling the quest isn't reliable. Stuff going into the wrong containers shouldn't happen, either, and didn't when I tested. I could redo the whole mod not to use a quest, which is probably how I would have done it in the first place, or you can just go back to the other version. If you want to add more buttons and need to use MessageBoxExAlt, I can try to think of a way to hide some of them without throwing off the script. You know what may work? Using an additional perk entry point that works only on an activator and calls your message boxes, scripting each button individually. Meaning, one of your perk points does that, and your first menu (Add Label/Remove Label) causes the player to activate that activator and thus call the perk entry point that essentially reconstructs the menus (2 and 3). The truth is that although I would have taken one of these approaches if building the mod from the ground up (in which case I would know what the mod is actually intended to do as well), it's probably best as is. It works and the performance seems good. Link to comment Share on other sites More sharing options...
FriedStephen Posted May 12, 2018 Author Share Posted May 12, 2018 I had a bit of time to look into the plugin today, no time to make changes or test anything though. A couple of things I wanted to point out were:1. The sorting script seems to only be activated now when the mobile auto-sorter is used to dump inventory, or when the label maker menu is open. This is actually not how I intended it to function, since the label maker should only be necessary for editing labels, and should be stored away when not in use, and people need to be able to simply drop items into the container labeled "contMain" for the sorting to activate. I think that means the quest script should really be always on, no toggle. It didn't seem to hurt performance anyway.2. I noticed that in the sorting script, all the lines like "if contMain != 0" are replaced with "if contMain". Is this an oversight, or is it functionally the same? I guess all that line does is enable/disable the sorting function depending on whether or not the label is assigned. I think the simplest solution here would be to combine our past two versions. You cleaned up a lot of aspects that should probably be kept, like the NVSE stuff, and moving the check script into the perk entry, but otherwise we can probably re-merge the two quests, have the sorting script in gszQ run constantly, and drop the sorting script in gszAutoSorterScriptMsg4UDFScript. That'd make it a lot more manageable for me since it's really just a more efficiently written version of my last working version. It's odd that it seems to be working fine for you but not for me. Before I try making any changes, I'll do some more testing in case the errors really were just on my part. Before I tested your work, I first removed the old quest script and message box elements that were no longer in use, and updated the vanilla MagDrug exemption formlist to also include DLC items and poisons, to match the UIS categorisation, but perhaps I messed something up somewhere. Link to comment Share on other sites More sharing options...
Recommended Posts