User:Haama/FAR
< User:Haama
Jump to navigation
Jump to search
Revision as of 10:21, 26 March 2009 by imported>Haama
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
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
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.