This wiki is out of date, use the continuation of this wiki instead

ProcessID

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 11:03, 18 April 2007 (edit)
Sandman (Talk | contribs)
m (processType)
← Previous diff
Revision as of 23:39, 18 April 2007 (edit) (undo)
Sandman (Talk | contribs)
m (fuction -> function)
Next diff →
Line 16: Line 16:
*[[store|Stored]] as the [[local]] [[variable]] [[smallbro]] (holds the ProcessID of the [[process]] [[call|called]] by the [[father]] immediately after the current [[process]]). *[[store|Stored]] as the [[local]] [[variable]] [[smallbro]] (holds the ProcessID of the [[process]] [[call|called]] by the [[father]] immediately after the current [[process]]).
<br /> <br />
-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]].+The ProcessID can either be used as an [[argument]] for a [[function]] 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]].
== Example == == Example ==

Revision as of 23:39, 18 April 2007

Definition

A ProcessID is a unique identification code, for one instance of a processType. A ProcessID is always odd and larger than 65536 (2^16).
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.

Usage

ProcessID is used when referring to specific process (an instance of a processType) and access/edit its local variables. The ProcessID of a process is found by on of the following methods:


The ProcessID can either be used as an argument for a function 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.

Example

Private
    int ballID;
    int ballx;
    int bally;
Begin
    ballID = BallProcess();
    ballx = ball.x;
    bally = ball.y;
End
Process BallProcess( )
Begin
    Loop
        frame;
    End
End


This demonstrates using the period (".") character between the ProcessID and the variable name to access a local variable.

Note that functions do NOT have a ProcessID, as a ProcessID is assigned when the frame; statement is reached in the code, making it a process.

Personal tools