Difference between revisions of "User:Haama/FAR"
Jump to navigation
Jump to search
imported>Haama m |
imported>Haama |
||
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 | ||
---- | |||
Functional Activators require 3 parts: the script, the base activator, and the reference activator. | |||
... | |||
empty cell, disable, persistent | |||
... | |||
can be any object, but activators are best | |||
---- | |||
General description | General description |
Revision as of 10:51, 26 March 2009
Functional Activators refer to scripts that behave like common programming functions. Like functions, they can:
- Be called from another script at any time
- Will happen immediately, before the next line of code is processed
- Can be nested (though note the limitation below)
- Take input parameters and can return output parameters
- Make your code easier to read and write
- Centralize sections of your code
Functional Activators require 3 parts: the script, the base activator, and the reference activator. ... empty cell, disable, persistent ... can be any object, but activators are best
General description
What they're useful for
- Centralize code
- Simplify code - can put complex if tests in separate FAR
Maybe go in order from least to most complex
- onActivate only
- Inputs/Outputs/Variables
- Heart-beat
Limitations
- Only 4 within each other
- Careful with Labels/loops
- Will take more processing due to more set/if statements, but those take 1000s to become a problem
- Probably not a good idea to trust between save/load
Preference over other script types (should really be on Global page)
- Compared to quest scripts
- Run instantly
- No need to handle timing issues and flags
- Quest scripts may be more reliable for long-term scripts
- Run instantly
- Compared to result scripts
- Longer
- Can store variables, use ref variables in functions
- However, result scripts can have an infinite nest depth
- Compared to token
- Store the information
- Tokens better at keeping information for each actor, etc.