IsharaMeradin Posted February 12, 2015 Share Posted February 12, 2015 Guess I'll have to try it. I need to use it in two separate functions which are already setup to take bool parameters. It'll be wasted processing to cast it multiple times. If it will let me store it as a variable, that would be just ducky. Link to comment Share on other sites More sharing options...
cdcooley Posted February 13, 2015 Share Posted February 13, 2015 If you aren't using that quest variable later I would either get rid of it or make it a local variable in the function.outside of events & functions MyMCMQuestScript MCMScript some event/function() MyMCMQuestScript MCMScript = (Game.GetFormFromFile(0x01234567,"My Mod.esp") as Quest) as MyMCMQuestScript or outside of events & functions MyMCMQuestScript MCMScript some event/function() Quest MCMQuest = Game.GetFormFromFile(0x01234567,"My Mod.esp") as Quest MyMCMQuestScript MCMScript = MCMQuest as MyMCMQuestScript The first is slightly faster and smaller, but a bit ugly. Of course if you're using GFFF then you obviously have some tolerance for ugly. Link to comment Share on other sites More sharing options...
Ellorienne Posted February 13, 2015 Share Posted February 13, 2015 What would I need to add to this script to run a check that the player is at the smelter? Scriptname ElloAddImproversScript extends ReferenceAlias Keyword Property VendorItemOreIngot auto LeveledItem Property ElloLItemImprovers10 auto Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if akBaseItem.HasKeyword(VendorItemOreIngot) ; debug.trace(self + "player has smelted an ingot") Game.GetPlayer().AddItem(ElloLItemImprovers10, 1, true) endif EndEvent Clearly the trace is not enough. I had a feeling that it wouldn't be. Whenever the player picks up or receives an item with the keyword, there is a chance of getting the improvers (tempers) too. I want it to be restricted solely to smelting. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 13, 2015 Share Posted February 13, 2015 Two options that I know will work: 1. A perk entry point with the activate option. Conditions for the target would be that it has the appropriate smelter keyword. Add a small script fragment which will set a global variable (GV) to indicate to other scripts that the smelter is in use by the player. The other script (probably on player alias) would use SKSE's OnMenuOpen and OnMenuClose events checking for the opening of the crafting menu. If the GV is set, then it is the smelter. 2. Instead of a perk entry point use SKSE's OnCrosshairRefChange event and check the passed over reference to see if it is a furniture object. If furniture object check to see if it has the correct keywords. Set the GV to indicate that the smelter was in the crosshairs. Then use the OnMenuOpen and OnMenuClose events to determine if the crafting menu is in use. If the GV is set, then it is likely that the smelter is in use. #1 would be incompatible with other mods that add perk entry points to the same objects.#2 would not have the incompatibility but there is a small chance depending upon how you set and unset the GV that it won't return correct results since the crosshair can pass over other objects such as a follower while moving the player into position. There is also the story manager which triggers quests that have specific comments for the alchemy and enchanting stations, may be able to replicate something there for the smelter. But I've had no success with that myself... Link to comment Share on other sites More sharing options...
XSDStitch Posted February 13, 2015 Share Posted February 13, 2015 Question: Does a tool exist that allows me to plan a layout for buildings, dungeons and whatever I might want to create in Creation Kit? It should take away the actual work in the CK but help me to outline how large I have to make the corridors or how decoration should be placed without cramming too much. Just like a normal room planner but made for Skyrim. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 13, 2015 Share Posted February 13, 2015 If you aren't using that quest variable later I would either get rid of it or make it a local variable in the function. outside of events & functions MyMCMQuestScript MCMScript some event/function() MyMCMQuestScript MCMScript = (Game.GetFormFromFile(0x01234567,"My Mod.esp") as Quest) as MyMCMQuestScript Ended up using this. The local variable for the script allows me to utilize variables from the MCM. Calling the variable from the MCM is probably faster than setting a global variable in the MCM then calling that with GFFF when needed. Link to comment Share on other sites More sharing options...
SerchBoogie Posted February 13, 2015 Share Posted February 13, 2015 Trying to connect my new exterior world to skyrim using a statue and a xmarkerheading. I compile and save my script successfully but when I click Properties in order to link the marker in skyrim with the marker on my world I get this error message: "error encountered while attempting to reload the script" Then the window appears empty. What's going on? This is the tutorial I'm following: Thanks. Link to comment Share on other sites More sharing options...
Mattiewagg Posted February 13, 2015 Author Share Posted February 13, 2015 Question: Does a tool exist that allows me to plan a layout for buildings, dungeons and whatever I might want to create in Creation Kit? It should take away the actual work in the CK but help me to outline how large I have to make the corridors or how decoration should be placed without cramming too much. Just like a normal room planner but made for Skyrim.No. You can draw out the layout on a piece of paper, PS, or something like that but it cannot be auto created in the CK from that. You have to do work yourself on it. Link to comment Share on other sites More sharing options...
XSDStitch Posted February 13, 2015 Share Posted February 13, 2015 Question: Does a tool exist that allows me to plan a layout for buildings, dungeons and whatever I might want to create in Creation Kit? It should take away the actual work in the CK but help me to outline how large I have to make the corridors or how decoration should be placed without cramming too much. Just like a normal room planner but made for Skyrim.No. You can draw out the layout on a piece of paper, PS, or something like that but it cannot be auto created in the CK from that. You have to do work yourself on it. I wasn't expecting to find an auto modder in CK. I was just curious since I want to make sure that my outlines have the right sizes. PS: Just realized that I made a mistype in the original post... wanted to write "shouldn't" and not should ^^; Link to comment Share on other sites More sharing options...
Ellorienne Posted February 14, 2015 Share Posted February 14, 2015 Two options that I know will work: 1. A perk entry point with the activate option. Conditions for the target would be that it has the appropriate smelter keyword. Add a small script fragment which will set a global variable (GV) to indicate to other scripts that the smelter is in use by the player. The other script (probably on player alias) would use SKSE's OnMenuOpen and OnMenuClose events checking for the opening of the crafting menu. If the GV is set, then it is the smelter. 2. Instead of a perk entry point use SKSE's OnCrosshairRefChange event and check the passed over reference to see if it is a furniture object. If furniture object check to see if it has the correct keywords. Set the GV to indicate that the smelter was in the crosshairs. Then use the OnMenuOpen and OnMenuClose events to determine if the crafting menu is in use. If the GV is set, then it is likely that the smelter is in use. #1 would be incompatible with other mods that add perk entry points to the same objects.#2 would not have the incompatibility but there is a small chance depending upon how you set and unset the GV that it won't return correct results since the crosshair can pass over other objects such as a follower while moving the player into position. There is also the story manager which triggers quests that have specific comments for the alchemy and enchanting stations, may be able to replicate something there for the smelter. But I've had no success with that myself... Thank you for the clear, detailed instructions. I understand the steps, but not how to implement them. Specifically, I don't understand how fragments work (only know that they are small scripts, and somehow linked to the bigger parent script), nor how to set the global variable (google-fu failed me). I found some information on the OnMenuOpen event, but don't know how to add it to the script that I already have. I'm guessing that part of the bits that I would need to add look something like this? Event OnInit() RegisterForMenu("Crafting Menu") EndEvent Event OnMenuOpen(OpenedMenu) if (OpenedMenu == "Crafting Menu") Do Stuff RegisterForMenu("Crafting Menu") endif EndEvent But I don't know how to make the 'do stuff' do the stuff that I already have, nor where to put all of this in relation to what I have already done. Lastly, for the GV, would that need to be put in the perk section under activators, and/or on the smelter? I would have liked to have strived for compatibility, but the mod is so extensive, I don't think that it will end up being very compatible. Lofgren mentioned something about my armor/weapon script making it incompatible, too (though it's only attached to my custom-duplicated armors and weapons). Link to comment Share on other sites More sharing options...
Recommended Posts