EPDGaffney Posted May 8, 2018 Share Posted May 8, 2018 That's brilliant. Glad you're on your way to being done and that the hard stuff is out of the way. The old message system is fine. If it works without a performance hit and satisfies your requirement of not needing NVSE, that's great. The new system is superior, though, and much faster to code, so if you want help understanding it, you can drop your script here and I'll show you how I would change it over. If I understand how these container-sorting mods works, that idea of dropping the container item sounds good. Let me know if you need help with that. Link to comment Share on other sites More sharing options...
FriedStephen Posted May 9, 2018 Author Share Posted May 9, 2018 Ok, so I ran into a couple of snags. One is simple but annoying, the other is also probably simple, but I can't figure out. The first one is that as far as I can tell, all the models for containers lack any havok data, which is an issue for me because I want the Dumping item to be carryable in my inventory, then when dropped I need to place it wherever I want, then when activated, it is replaced by an activator in the exact same spot. All that scripting works fine, but when using a container model without any havok data the item will just float in midair when dropped. This thread here seems to explain a solution to this problem, and has a usable container model with havok data, but I'd rather not go through the process of editing a model myself if somebody has already updated a collection of models I could use. I just wanted to ask if you knew about any such resource. The second issue I'm having is that the OnActivate object script attached to the Activator doesn't seem to be changing variables in the quest script like I want it to. For example, the object script has "set gszQ.dump to 1" ("short dump" is in the quest script), and the quest script has an "if dump == 1" chain, but it never actually runs. All the spelling and syntax is correct, and there are no compiling errors, so I wonder if there's an inherent issue with changing quest variables from an object script. Once these two snags are fixed, the whole mod should be ready to go, though I'll share the menu script with you in case you can help NVSE-ify it. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 9, 2018 Share Posted May 9, 2018 Which container did you want to use? I'd be surprised if no-one's done a briefcase by now. But this is easy and I predicted you'd have this problem. I can add Havok data to any model you need me to do. The second issue is perplexing. I'll need to see your scripts, as flipping quest variables within an object script is standard and I do it often, and everything else is fine if you're correct. Have you run tests to confirm all this, like the variables not flipping and stuff like that? or are you assuming this because the bit you want it to run isn't running? You can do print checks to see where your script is failing, and you can use Let instead of Set to print an error any time the Let fails. Link to comment Share on other sites More sharing options...
FriedStephen Posted May 9, 2018 Author Share Posted May 9, 2018 Oh, thank you! I wasn't totally decided on which model to use, but I don't want you to have to do every single one just so I can try them all out, so the briefcase detonator is what I'll settle on. The file path is "Clutter\BriefcaseDetonator\BriefcaseDetonator01.NIF". As for the scripts, this script is attached to the activator:https://pastebin.com/AZW0j5Zw And this one is the current iteration of the quest script:https://pastebin.com/pSFvJDws I only commented on the current issue, which is the "dump" section closer to the bottom. I can properly comment on the menu section later if you'd like some context for translating it to the NVSE version, I'm just tired now. This issue is confusing me because it's using functions I've already successfully used in other areas. The only things that are different now are that the logic is initiated in an object script, within an OnActivate block, neither of which I have any prior experience with. I haven't done more rigorous tests yet, because I had tried a few different ways of scripting the same logic with different functions in different scripts, but never got any different results. One source I found online was a thread that seemed to imply that there was an issue with this whole object script/quest script thing, but I couldn't find any documentation to elaborate on that. I need to get back to it once I'm more refreshed. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 9, 2018 Share Posted May 9, 2018 Only problem I noticed in the scripts is your menu and button variables should be of the int variety (or short, but I never use short, for organisational purposes). The model needs a bit of extra work because it was made a bit special, with animations and such, so when I havoked it, it fell apart in two pieces as I'd feared. If my NifSkope attempt doesn't work, it's not hard to fix it in Blender. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 9, 2018 Share Posted May 9, 2018 Here is that briefcase you ordered, sir:https://ufile.io/jaxrc Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 9, 2018 Share Posted May 9, 2018 Just realised, I'll need your message(s) if you want to understand how to switch to using MessageBoxExAlt. Link to comment Share on other sites More sharing options...
FriedStephen Posted May 9, 2018 Author Share Posted May 9, 2018 Thank you so much for the model! It works great! As far as the item dump though, I still can't get it working. I've tried changed the "set gszQ.dump to 1" to "let gszQ.dump := 1", but in game the RemoveAllItems function still doesn't happen, and no error message is printed to the console. That gets me thinking that maybe the issue has more to do with the RemoveAllItems function, although it used to work back when I just had an activation of a container scripted to run that function. Now, I don't quite understand calling references, or more specifically, when the game decides what the calling reference currently is, but could the problem be that RemoveAllItems only works when activated from the context of an actual container? I don't quite know what I'm trying to say since I don't have a proper grasp on the lingo, but I'm wondering if the function only works if a container is currently active. It's quite annoying that my final feature before cleaning up and prepping for release, also happens to be my most perplexing yet. The logic seems to hold up, yet it inexplicably doesn't work, so I feel like the problem lies with a peculiarity of the engine. I'll link a download for the current state of the mod. Could you give it a test and take a look in case the issue is only happening to me? Also, all the messages are there, so you can take a look a those too, if you like. To add/remove labels to containers, you must purchase the Label Maker from Chet in Goodsprings, then activate any container while sneaking. The Mobile Auto-Sorter is also purchased from Chet. You must drop it and then activate it to make it an activator, then activating it while standing will bring up the dump option, and activating while sneaking will pick it back up. Load order probably doesn't matter much, but I have it over UIS, and both fairly low down, after any mods that add new items. I don't want to impose a bunch of work on you, so take your time. I'm in no hurry. https://ufile.io/fdtmg Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 10, 2018 Share Posted May 10, 2018 Found the problem. I assumed you were doing all your menu stuff in GameMode, as about 95% of it is, and you aren't, which is where the problem is. Now, with the message functionality I was talking about, you're grand, but with the vanilla functions, you depend on GetButtonPressed, which is not available in an OnActivate block. Using your current approach:https://pastebin.com/d8nWkM37 Using MessageBoxExAlt:https://pastebin.com/EK2ZQE1e Link to comment Share on other sites More sharing options...
FriedStephen Posted May 11, 2018 Author Share Posted May 11, 2018 Hooray! It works!You see, I never would have guessed that OnActivate had such a limitation. It seems so clear to me now, but i really didn't think there was anything wrong what I was doing before.I'm using your MessageBoxExAlt scripts now, so if you still want to try and translate the Label Maker menu, go ahead. I think I understand how it works now, but my brain needs a rest for a while before I try and do it myself. To be clear, I no longer need the the Message that related to my original Auto-sorter menu? Also, if I want to emulate the conditions I had for each button in the Label maker menu, can I simply use "if + condition" statements before the "if iButton" statements? And finally, does each sub menu need a separate callbacks script, or can related submenus be organised into the same script? Apart from that, the one area I'm looking into is making the Auto-sorter dump only non-equipped (and maybe non-hotkeyed) items, rather than absolutely everything. To be honest, I like how it is now, because I don't intend the auto-sorter to be a "send to home base/infinite storage" machine when out in the wasteland, but I wouldn't hold it against someone if they did want that functionality. It could be nice to have the option. In the future I'll look back into extra categories, and also TTW support. TTW seems interesting but the upcoming 3.0 is apparently gonna shake existing mods up big time. 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. Link to comment Share on other sites More sharing options...
Recommended Posts