Difference between revisions of "Activation Functions"

443 bytes added ,  20:15, 11 September 2006
m
no edit summary
imported>Elder
imported>Elder
m
Line 5: Line 5:
It relies on the fact that the Activator method can be called on a persistant object at any time and operates immediately.
It relies on the fact that the Activator method can be called on a persistant object at any time and operates immediately.


In-game functions are easier to create. They also do not have the restrictions that Stage functions have and allow for looping code through clever use of the additional GameMode block (using flags, counters, etc.). Additionally, they are an alternative way to add global variables to the game.
In-game functions are easier to create. They also do not have the restrictions that Stage functions have (number of lines, refernce object calls, variable definiton, etc.) and allow for looping code through clever use of the additional GameMode block (using flags, counters, etc.). Additionally, they are an alternative way to add global variables to the game.




Line 102: Line 102:




One extra note on Stage functions (as discussed on the CS Wiki).
Another thing to watch for is how many times you call the same IGF activator within a single frame. Like Stage functions, they can 'time-out' if too many calls are made. Additionally, as with (recursive) PlaceAtMe calls, there appears to be a limit of only 4 or 5 activation calls you are allowed to make in one frame - probably due to a general hard-coded recursion call trap that the interpretor makes.
Apart from being useful in their own right, they have a very nice goto # / call # functionality.


One extra note on Stage functions. Apart from being useful in their own right, they have a very nice goto # / call # functionality.


  set x to 10; any value between 0-255
  set x to 10; any value between 0-255
Anonymous user