ThatOtherUser Posted March 9, 2017 Share Posted March 9, 2017 EDIT: Just gonna save everybody the time of going through this... I fixed the problem. As it turns out, yes, plugins do need a master file to be loaded alongside them, while the plugin is set as the active file. The problem was me being a moron. Thank you to everyone who decided to look at this, at least. Hello again, all. Second thread regarding problems with scripting. Thankfully this time, I think I know what I'm doing. Gist of my idea here is, I'd like to test if Fallout picks up mouse inputs during the game. And I know that Project Nevada is able to, for use as a hotkey for grenade throwing, for instance. So, I have my idea split up into four pieces: A quest with the Quest ID of SteelDetectKeyQuest. A script with the Form ID of SteelDetectKeyScript, saved as a Quest script. One message with a Form ID of SteelDetectKeyMessage. Another message, with the Form ID of SteelDetectImproperBoolean. All of this is saved in an ESP file named SteelDetectKeyPlugin. Here is the contents of SteelDetectKeyScript: ScriptName SteelDetectKeyScript short iKeyHit short bScriptEnabled ; don't worry about this, I set it in-game using the 'set' console command, intended design Begin GameMode if bScriptEnabled == 0 Return endif if ((bScriptEnabled > 1) || (bScriptEnabled < 0)) ShowMessage SteelDetectImproperBoolean set bScriptEnabled to 0 Return endif set iKeyHit to GetKeyPress 0 if ((iKeyHit != -1) || (iKeyHit != 65535)) ShowMessage SteelDetectKeyMessage, iKeyHit else Return endif End Now, the issue I'm facing is not with saving or making sure the script will compile, though that will very likely become an issue in the future. What I'm trying to figure out is why the quest is not retaining the Script setting I'm giving it. This is what I do. I first open up the GECK using the -editor switch on the nvse_loader.exe file (so I have access to the NVSE functions, hence GetKeyPress). I then go to Data, and unload all the master files. I don't think I need any of them for a script as simple as this, though this may be the mistake I'm ultimately making. Then, while in Data, I set my plugin as the Active File. I then hit Open. Now, with the plugin open, I go into the Quest filter in the Object window, open up my quest, and... the Script menu says NONE. Even though, when I open up the Script drop down menu, I see my script right there in it. I have no idea why this is happening, and I've been doing a lot of digging through Google to even find a reason as to why GetKeyPress doesn't appear to detect mouse inputs in the first place. This is steadily driving me up the wall, but I've still got some sanity in me. Not sure if anyone's submitted this kind of issue before, but I think it's about time I asked for assistance with this. Thanks to everyone in advance, I'm still a massive noob when it comes to scripting and plugin creation with the GECK. Link to comment Share on other sites More sharing options...
Ladez Posted March 9, 2017 Share Posted March 9, 2017 You can set a plugin as the active file without a master, but you appear to have done so in the wrong order. When you first load the GECK to create your plugin, go into File -> Data and press OK without selecting anything BEFORE you create any objects. Otherwise your objects will not be assigned a valid form ID. I do this all the time for scripted mods that do not need a master. I'm a little baffled by your script. Why spend time detecting an "improper" boolean? Link to comment Share on other sites More sharing options...
ThatOtherUser Posted March 9, 2017 Author Share Posted March 9, 2017 You can set a plugin as the active file without a master, but you appear to have done so in the wrong order. When you first load the GECK to create your plugin, go into File -> Data and press OK without selecting anything BEFORE you create any objects. Otherwise your objects will not be assigned a valid form ID. I do this all the time for scripted mods that do not need a master. I'm a little baffled by your script. Why spend time detecting an "improper" boolean? Mainly because I was going to be turning the script on in the game, and it was just so I'd catch myself if I set the value too high or low for it to work. That and it was just another thing I could try out in the meantime; error checking is always a good thing to include in your scripts. Thanks for the tip though. When I go into Data though, I see that all the DLC for Fallout New Vegas are selected for use as master files. I find just loading FalloutNV.esm works just as nicely. Though yeah, I definitely saw what you meant by valid form ID. I thought it very strange while working on the script, that the custom quest I'd made showed up as Form ID 00000000. That couldn't've been right. Again though, thanks! Link to comment Share on other sites More sharing options...
Ladez Posted March 10, 2017 Share Posted March 10, 2017 You can't set the value too high or low for it not to work, though. Any non-zero value, even in the negative, will evaluate to true, so unless you have some specific logic requiring otherwise, you can write your conditional like this: if bScriptEnabled ; do stuff endif Or if you prefer: if bScriptEnabled else return endif ; do stuff Losing the comparison operator has the benefit of (slightly) improving performance. Link to comment Share on other sites More sharing options...
ThatOtherUser Posted March 10, 2017 Author Share Posted March 10, 2017 Really? Huh, didn't know that. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts