Difference between revisions of "User:Haama/FAR"
Jump to navigation
Jump to search
m
no edit summary
imported>Haama m |
imported>Haama m |
||
Line 1: | Line 1: | ||
Functional | A Functional Activator Script is a type of global script that behaves like common programming [http://en.wikipedia.org/wiki/Function_(computer_science) functions]. Like functions, they can: | ||
#Be called from another script at any time | #Be called from another script at any time | ||
#Will happen immediately, before the next line of code is processed | #Will happen immediately, before the next line of code is processed | ||
Line 6: | Line 6: | ||
#Make your code easier to read and write | #Make your code easier to read and write | ||
#Centralize sections of your code | #Centralize sections of your code | ||
==Background== | |||
The script is really what defines the function, what it will do, and does the work. In most programming languages, you would simply write the function code, give it a name, and call it with the function's name. However, you're not able to simply call a script in Oblivion. Instead, FASs rely on some particular oddities of [[Activate]] to mimic function behavior. | |||
there are 3 important parts here - the Activate call, the script, and the reference stuff (or hoops/hacks) | |||
---- | ---- | ||
==In which Bethesda makes things harder (or you realize this is a bit of a hack)== | ==In which Bethesda makes things harder (or you realize this is a bit of a hack)== | ||
The script is really what defines the | The script is really what defines the function, what it will do, and does the work. However, you're not able to simply call a script in Oblivion... like quests, added items have to use a function... here we use Activate, and so we need to have a reference to actually Activate... | ||
Functional Activator Scripts rely on some particular oddities of the [[Activate]] function. When you use the '''onActivate''' flag of the '''Activate''' function, it will instantly run the Activated reference's script. | |||
You have to call a specific reference. there are a few steps you need to go through to set up each Functional Activator. | You have to call a specific reference. there are a few steps you need to go through to set up each Functional Activator. |