- This wiki is out of date, use the continuation of this wiki instead
ProcessID
From FenixWiki
A ProcessID is a unique identification code, for one instance of a processtype. A ProcessID is always odd and larger than 65536 (2^16).
It is used when needing to referece to a specific process and access/edit it's local variables. The ProcessID of a function is found by on of the following methods:
- Returned when the frame statement is found in the process.
- Returned by the get_id() function.
- Returned by the collision() function.
- Stored as the local variable id (holds the value of the process' own ProcessID).
- Stored as the local variable father (holds the value of the ProcessID of the process that called the current process).
- Stored as the local variable son (holds the value of the ProcessID of the process last called from the curren process).
- Stored as the local variable bigbro (holds the value of the ProcessID of the process called by the father immediately before the current process).
- Stored as the local variable smallbro (holds the value of the ProcessID of the process called by the father immediately after the current process was called).
The ProcessID can either be used as an argument for a fuction such as get_angle() or get_dist() or as a way of using the local variable of another process. For example, to use the x and y local variables of a process:
private :ball; :ballx; :bally; begin :ball = get_id(type ballprocess); :ballx = ball.x; :bally = ball.y; end
This demonstrates using the period (".") character between the ProcessID and the variable name to access a local variable.
This makes it possible to use for example the function collision() in an if() statement. This is because collision() returns the ProcessID the process calling collision() has collided with. <p> Please note that functions do NOT have a ProcessID as the ProcessID is assigned when the frame statement is used in the process.
--Sandman 14:56, 23 March 2007 (CET)