Difference between revisions of "Category:About Modding Etiquette"
Category:About Modding Etiquette (edit)
Revision as of 21:39, 10 August 2007
, 21:39, 10 August 2007→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 | * 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 | * 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 | ** 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 | ** 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 | ** 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. | ||