Difference between revisions of "Global Scripts/Extended"
imported>Haama (So far) |
imported>Haama (More) |
||
Line 3: | Line 3: | ||
This is an extremely limited way of using scripts, but it is possible to hack and abuse the system a bit to make global scripts. | This is an extremely limited way of using scripts, but it is possible to hack and abuse the system a bit to make global scripts. | ||
There are several types of global scripts, but essentially | There are several types of global scripts, but essentially they're used to control when they run, run all the time, share variables, or provide extra variables. | ||
---- | ---- | ||
Activators vs. Quests | |||
---- | ---- | ||
Functions | |||
Global scripts are | ---- | ||
Global scripts | |||
---- | |||
Adding and running a script on everything (every NPC, etc.) | |||
New OBSE ref walking script and a central script better than tokens | |||
Tokens are better than scripted effects | |||
---- | ---- | ||
Revision as of 16:38, 20 July 2008
Oblivion scripts, especially vanilla ones, tend to be object oriented, isolated, and independent. That is, the script is focused on the object alone, won't look at variables on other scripts, won't have variables that are set or even seen by other scripts, and the script will stop running once the player has left the cell. Even for quests, they act independent of other quests and only run until the quest is finished.
This is an extremely limited way of using scripts, but it is possible to hack and abuse the system a bit to make global scripts.
There are several types of global scripts, but essentially they're used to control when they run, run all the time, share variables, or provide extra variables.
Activators vs. Quests
Functions
Global scripts
Adding and running a script on everything (every NPC, etc.) New OBSE ref walking script and a central script better than tokens Tokens are better than scripted effects
MenuModes
Surprisingly, generic MenuMode blocks will run during the opening Main Menu (before the player has even loaded a game!). This is unnecessary and can even cause problems and CTDs. To prevent the script from running during this time, add a 1044 block with Return before the main, generic MenuMode block
begin GameMode ... end begin MenuMode 1044 ;Main Menu return end begin MenuMode ... end
There are other menus that may cause problems or that don't require the script to be running. This if statement will cause the script to Return during those unnecessary menus. (Note that, due to wiki limiatations, the single if line has been broken into several lines)
begin MenuMode ;If you're using an activator, make sure to test and set the Working variable if (MenuMode 1001) || (MenuMode 1007) || (MenuMode 1009) || (MenuMode 1012) || (MenuMode 1013) || (MenuMode 1015) || (MenuMode 1016) || (MenuMode 1017) || (MenuMode 1018) || (MenuMode 1019) || (MenuMode 1020) || (MenuMode 1021) || (MenuMode 1030) || (MenuMode 1032) || (MenuMode 1036) || (MenuMode 1038) || (MenuMode 1039) || (MenuMode 1044) || (MenuMode 1047) ;Loading Area screen, Dialog, Sleep/Wait, Pause, Options, Audio, Video, Video Display, Gameplay, Controls, Class, Skills, Race/Sex, Load, Save, Main, Credits return endif ...