- This wiki is out of date, use the continuation of this wiki instead
Signal
From FenixWiki
(Difference between revisions)
Revision as of 11:14, 18 April 2007 (edit) Sandman (Talk | contribs) ← Previous diff |
Current revision (11:23, 21 July 2008) (edit) (undo) Sandman (Talk | contribs) m |
||
(7 intermediate revisions not shown.) | |||
Line 3: | Line 3: | ||
== Definition == | == Definition == | ||
- | '''INT''' | + | '''INT''' signal ( <'''INT''' processID|processTypeID> , <'''INT''' signal> ) |
- | Allows | + | Allows a [[process]]/[[function]] or a range of processes/functions of certain [[processType]] to be controlled in a limited number of ways, by sending [[signals]]. |
+ | |||
+ | == Parameters == | ||
+ | {| | ||
+ | | '''INT''' processID<nowiki>|</nowiki>processTypeID || - The [[ProcessID]] of the process or the [[ProcessTypeID]] of the type of processes to which the signal is to be sent. | ||
+ | |- | ||
+ | | '''INT''' signal || - The code of the [[signals|signal]] that is to be sent to the target process. | ||
+ | |} | ||
== Returns == | == Returns == | ||
- | '''INT''' - | + | '''INT''' : |
+ | {| | ||
+ | | [[false]] || - The specified processID<nowiki>|</nowiki>processTypeID was 0 or a [[processTypeID]]. | ||
+ | |- | ||
+ | | [[true]] || - The specified processID<nowiki>|</nowiki>processTypeID was a [[processID]]. | ||
+ | |} | ||
- | == | + | == Errors == |
{| | {| | ||
- | | | + | | Invalid processID || - The [[process]] with specified processID is not alive. ''(Pre [[0.90.2]] only)'' |
|- | |- | ||
- | | | + | | Invalid signal || - The specified [[signals|signal]] is invalid. |
|} | |} | ||
== Notes == | == Notes == | ||
- | To obtain the processType of a function, the operator | + | To obtain the processType of a function, the operator [[Type]] can be used. |
For a process to send a signal to itself, the [[local variable]] [[id]] can be used. | For a process to send a signal to itself, the [[local variable]] [[id]] can be used. | ||
- | The parameter | + | The parameter signal is passed by way of a set of [[signals]] which denote the signal which is to be sent. |
+ | |||
+ | To kill all processes at once, except the calling one, use [[let_me_alone]](). | ||
== Example == | == Example == | ||
<pre> | <pre> | ||
- | + | signal( get_id(type enemy) , s_kill ); // Kills a process of type enemy | |
- | + | signal( id , s_kill_tree ); // Kills the process that calls it, and all of its descendants | |
- | + | signal( Type player , s_freeze ); // Freezes all processes of type player so that they are | |
// still displayed, but do not execute any code. | // still displayed, but do not execute any code. | ||
</pre> | </pre> | ||
+ | |||
+ | {{Funcbox | ||
+ | | category = Processinteraction | ||
+ | }} |
Current revision
Contents |
[edit] Definition
INT signal ( <INT processID|processTypeID> , <INT signal> )
Allows a process/function or a range of processes/functions of certain processType to be controlled in a limited number of ways, by sending signals.
[edit] Parameters
INT processID|processTypeID | - The ProcessID of the process or the ProcessTypeID of the type of processes to which the signal is to be sent. |
INT signal | - The code of the signal that is to be sent to the target process. |
[edit] Returns
INT :
false | - The specified processID|processTypeID was 0 or a processTypeID. |
true | - The specified processID|processTypeID was a processID. |
[edit] Errors
Invalid processID | - The process with specified processID is not alive. (Pre 0.90.2 only) |
Invalid signal | - The specified signal is invalid. |
[edit] Notes
To obtain the processType of a function, the operator Type can be used. For a process to send a signal to itself, the local variable id can be used. The parameter signal is passed by way of a set of signals which denote the signal which is to be sent.
To kill all processes at once, except the calling one, use let_me_alone().
[edit] Example
signal( get_id(type enemy) , s_kill ); // Kills a process of type enemy signal( id , s_kill_tree ); // Kills the process that calls it, and all of its descendants signal( Type player , s_freeze ); // Freezes all processes of type player so that they are // still displayed, but do not execute any code.
Processinteraction Functions | |
• Advance() • Collision() • Exists() • Get_angle() • Get_dist() • Get_id() • Let_me_alone() • Signal() • Xadvance() • |