sp0ckrates Posted May 18, 2018 Share Posted May 18, 2018 (edited) Just curious when Import Game is necessary or useful when scripting. Also curious about when to use Import Utility and Import Math. Also, are there others that can can be imported? Edit: Iâm asking about scripting for Skyrim SE. :) Edited May 18, 2018 by sp0ckrates Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted May 18, 2018 Share Posted May 18, 2018 Hmm, which of the 544 supported games are you talking of now? Link to comment Share on other sites More sharing options...
sp0ckrates Posted May 18, 2018 Author Share Posted May 18, 2018 LOL! Sorry. Skyrim SE. Link to comment Share on other sites More sharing options...
FrankFamily Posted May 18, 2018 Share Posted May 18, 2018 That's simply so you can do: Wait(847.0)instead of Utility.Wait(847.0)in your script. Convenience basically, afaik there's zero difference in the compiled script, if you use many global functions from one script, say math, utility, etc (any really) then you can import it so you don't have to type it everytime. Link to comment Share on other sites More sharing options...
sp0ckrates Posted May 18, 2018 Author Share Posted May 18, 2018 That's simply so you can do: Wait(847.0)instead of Utility.Wait(847.0)in your script. Convenience basically, afaik there's zero difference in the compiled script, if you use many global functions from one script, say math, utility, etc (any really) then you can import it so you don't have to type it everytime.Got it! Thanks! Link to comment Share on other sites More sharing options...
sp0ckrates Posted May 18, 2018 Author Share Posted May 18, 2018 OK, so, what about Import Game? Is the only advantage that you can use GetPlayer() instead of Game.GetPlayer() and similar shortcuts? Link to comment Share on other sites More sharing options...
FrankFamily Posted May 18, 2018 Share Posted May 18, 2018 (edited) Yeah, as far as I know, that's all.For future reference, papyrus questions fit more in the appropiate game-specific thread, i.e: https://forums.nexusmods.com/index.php?/forum/3930-skyrim-creation-kit-and-modders/ or https://forums.nexusmods.com/index.php?/forum/4070-skyrim-special-edition-creation-kit-and-modders/ Edited May 18, 2018 by FrankFamily Link to comment Share on other sites More sharing options...
sp0ckrates Posted May 18, 2018 Author Share Posted May 18, 2018 Thanks much! Link to comment Share on other sites More sharing options...
Evangela Posted May 19, 2018 Share Posted May 19, 2018 (edited) They are useful when you know you're going to be using a lot of functions that are defined in a certain script. Import Math when you know you gonna need to type a lot of math functions. If you made a script that extends no other scripts, and it contains global functions, you can import that script in another script when you don't want to prefix the functionwith scriptname.Function. Basically they just save a little time on typing. This is similar to the concept that C++ has(but the C++ version is much more powerful and can be dangerous if used improperly. Importing in papyrus doesn't appear to have this drawback). Edited May 19, 2018 by Rasikko Link to comment Share on other sites More sharing options...
sp0ckrates Posted May 19, 2018 Author Share Posted May 19, 2018 They are useful when you know you're going to be using a lot of functions that are defined in a certain script. Import Math when you know you gonna need to type a lot of math functions. If you made a script that extends no other scripts, and it contains global functions, you can import that script in another script when you don't want to prefix the functionwith scriptname.Function. Basically they just save a little time on typing. This is similar to the concept that C++ has(but the C++ version is much more powerful and can be dangerous if used improperly. Importing in papyrus doesn't appear to have this drawback).Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts