This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| prpl:isemergent [2016/12/02 23:34] – external edit 127.0.0.1 | prpl:isemergent [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <- [[.: | + | <- [[.: | 
| - | ===== | + | ===== | 
| ^Arguments^Result^Notation^ | ^Arguments^Result^Notation^ | ||
| - | | | | [ - ] | | + | | pid | bool | [ int - bool ] | | 
| === Description === | === Description === | ||
| + | Emergent is implemented as a virtual particle. Virtual particles exists for hit detection purpouses, but they are not discoverable by functions like [[prpl: | ||
| + | |||
| + | This function checks if the given pid is an virtual emergent particle. | ||
| + | |||
| + | One way to get the emergent ID is to watch the current PID counter (by creating a particle on each frame) and calling this function (IsEmergent) to check if that particle is a virtual emergent particle. | ||
| + | |||
| + | There are also virtual particles under each ship's hull (see [[prpl: | ||
| === Examples === | === Examples === | ||
| - | < | + | < | 
| - | stack.Push(new Data(p != null ? 1 : 0)); | + | #init | 
| - | + | once | |
| + | 0 -> | ||
| + | endonce | ||
| + | |||
| + | #get the current pid | ||
| + | 0 0 0 0 0 0 CreateParticle ->pid | ||
| + | < | ||
| + | |||
| + | #count hull particles | ||
| + | CreateList -> | ||
| + | <-pid < | ||
| + | I IsEmergent if | ||
| + | < | ||
| + | endif | ||
| + | loop | ||
| + | |||
| + | #update last Pid for the next frame | ||
| + | <-pid -> | ||
| + | |||
| + | #print the list of not empty | ||
| + | < | ||
| + | " | ||
| + | endif | ||
| </ | </ | ||