Need help with a script for moving companion NPCs to me
Posted: Fri May 17, 2013 5:15 pm
The problems I'm having with the code is this: After executing the code for the first time, it will not let me execute it again, even if I manually stop the script in the console. I have no idea why this is, but I want a script that can be used as many times as needed. I'm thinking that MAYBE the script doesn't close and kill itself like it should, but "StopScript" should handle that, which it apparently doesn't.
Second problem is that although this works the first time, it ONLY works if I manually disable (close console, reopen) and enable the NPC, even though it enables and disables it in the script, it may have to do with how fast it's going. I might have to set a timer for about a second or two before it disables and enables... (note to self right there)
Lastly, I suppose the third selection where summons all at once, would cause some problems since they would all be in the same place... Perhaps I could set a timer between when each NPC appeared, or even better, find a way implement a way to make the NPCs spawn in different spots based on my location... might not be so hard, really, but it's difficult to test the script because I have to repeatedly close out Morrowind since I have the script inside of the Main plugin + the companion plugins.
A side note is that ever since doing it, while loading, the blue spinning wheel that normally comes up when a process is not responding comes up, yet it works perfectly fine after, however any clicking will cause it ask me to close it due to it's unresponsiveness. A possible remedy for this would be great too... like where to store my scripts without touching the main plugin.
Another side note, I only learned it in, like, 3 hours ago, so it may be amateurish and riddled with easy mistakes, but bear with me.
Thanks in advance!
Code here: http://pastebin .com/XKpmsFcx <- Remove spaces in between
~~~~~~~~~~~~~~~~~~~~~
Kind of copy and pasted from both Reddit and SPUF, but this seems like another good place to seek help at. I know it's not really a mod... but it is semi-related to it. I originally wanted to make it because when one companion teleported me to another area, another didn't teleport with me, and it would have been an extremely long walk back. I managed to recall the companion that got left behind with the script, but I had to manually disable and enable so she would appear. However, once again as stated above, I couldn't execute the script again to further test it out.
I'd also like to find a way to have a script that will be applied to whatever the player has selected in console (like when you click an NPC when the console, it shows it's base ID) or typed in console (I.E "foobar"->moveToNPC) or ("foobar"->StartScript "moveToNPC") so anyone, anywhere can use it to fix an NPC without having to reset it's actors or reload a previous save.
Second problem is that although this works the first time, it ONLY works if I manually disable (close console, reopen) and enable the NPC, even though it enables and disables it in the script, it may have to do with how fast it's going. I might have to set a timer for about a second or two before it disables and enables... (note to self right there)
Lastly, I suppose the third selection where summons all at once, would cause some problems since they would all be in the same place... Perhaps I could set a timer between when each NPC appeared, or even better, find a way implement a way to make the NPCs spawn in different spots based on my location... might not be so hard, really, but it's difficult to test the script because I have to repeatedly close out Morrowind since I have the script inside of the Main plugin + the companion plugins.
A side note is that ever since doing it, while loading, the blue spinning wheel that normally comes up when a process is not responding comes up, yet it works perfectly fine after, however any clicking will cause it ask me to close it due to it's unresponsiveness. A possible remedy for this would be great too... like where to store my scripts without touching the main plugin.
Another side note, I only learned it in, like, 3 hours ago, so it may be amateurish and riddled with easy mistakes, but bear with me.
Thanks in advance!
Code here: http://pastebin .com/XKpmsFcx <- Remove spaces in between
~~~~~~~~~~~~~~~~~~~~~
Kind of copy and pasted from both Reddit and SPUF, but this seems like another good place to seek help at. I know it's not really a mod... but it is semi-related to it. I originally wanted to make it because when one companion teleported me to another area, another didn't teleport with me, and it would have been an extremely long walk back. I managed to recall the companion that got left behind with the script, but I had to manually disable and enable so she would appear. However, once again as stated above, I couldn't execute the script again to further test it out.
I'd also like to find a way to have a script that will be applied to whatever the player has selected in console (like when you click an NPC when the console, it shows it's base ID) or typed in console (I.E "foobar"->moveToNPC) or ("foobar"->StartScript "moveToNPC") so anyone, anywhere can use it to fix an NPC without having to reset it's actors or reload a previous save.