Difference between revisions of "Category:About Modding Etiquette"

m
→‎Efficiency: minor fixes
imported>Haama
(→‎Bug Avoidance: Troubleshooting link)
imported>FMan
m (→‎Efficiency: minor fixes)
Line 21: Line 21:


== Efficiency ==
== Efficiency ==
* Don't unnecessarily make references persistent. Persistent objects are always loaded in memory.
* Don't unnecessarily make references persist. Persistent objects are always loaded in memory.


* Check "No Low Level Processing" for actors (creatures or NPCs, even dead/disabled ones) that are never intended to leave a given cell. Low level processing causes their scripts and AI to run once every 5 (?) seconds or so, even if PC is not near.
* Check "No Low Level Processing" for actors (creatures or NPCs, even dead/disabled ones) that are never intended to leave a given cell. Low level processing causes their scripts and AI to run once every 5 (?) seconds or so, even if PC is not near.


* Do NOT check '''Quest Item''' unless necessary. Scripts for Quest Item actors run every frame of the game even if PC is nowhere near. If quest item status is necessary, then it's best to turn it on and turn it off using scripts as required.
* Do NOT check '''Quest Item''' unless necessary. Scripts for Quest Item objects run every frame of the game even if PC is nowhere near. If quest item status is necessary, then it's best to turn it on and off using scripts as required.


* Keep your scripting as efficient as possible. Scripts can very rapidly add up and kill performance if too many are running at once - ensure that your scripts are '''only''' running when they need to be. Avoid [[Global Scripts]] as much as possible.
* Keep your scripting as efficient as possible. Scripts can very rapidly add up and kill performance if too many are running at once - ensure that your scripts are '''only''' running when they need to be. Avoid [[Global Scripts]] as much as possible.
** Avoid using gameMode blocks if possible. (E.g., if you can use an onLoad block instead, do so.)
** Avoid using '''GameMode''' blocks if possible. (E.g., if you can use an '''OnLoad''' block instead, do so.)
** If all the script does is enable/disable, consider enabling/disabling from an external script, or if there is a group of related refs, assign them all to a single parent ref and enable/disable the parent ref through a script.
** If all the script does is enable/disable, consider enabling/disabling from an external script, or if there is a group of related references, assign them all to a single parent reference and enable/disable the parent reference through a script.
** Use quick exits from gameMode block scripts when possible. I.e., rather than letting the script fall through several lengthy if statements, instead do a single test at the top to see if rest of script should be skipped, and if so, return.
** Use quick exits from '''GameMode''' block scripts when possible. I.e., rather than letting the script fall through several lengthy '''If''' statements, instead do a single test at the top to see if rest of script should be skipped, and if so, return.
** When initializing the state of multiple objects (e.g., setting three actor references to attack player under a certain condition), use a single script on one object which sets all, rather than scripting each of them separately.  
** When initializing the state of multiple objects (e.g., setting three actor references to attack player under a certain condition), use a single script on one object which sets all, rather than scripting each of them separately.  


Anonymous user