This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 4rpl:commands:pingpong [2024/05/24 14:43] – Fix title Up-Level | 4rpl:commands:pingpong [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| ===== Examples ===== | ===== Examples ===== | ||
| <code 4rpl> | <code 4rpl> | ||
| - | # need worked | + | # An example |
| + | # The brightness of the unit and beam fluctuates while paused. | ||
| + | # The interval of t is 60+60 frames = 4 seconds. | ||
| + | |||
| + | :once | ||
| + | # Running the code in :PostUpdate allows it to work while paused when inside a unit script. | ||
| + | RegisterForMSG(" | ||
| + | |||
| + | # To Differentiate against other units of the same type, the pulse time is set out of sync: | ||
| + | self getunittype 0 getunitsbytype -> | ||
| + | < | ||
| + | # tickcount instead of updatecount since this will run while paused. | ||
| + | |||
| + | # Creating a beam between the unit and another unit | ||
| + | " | ||
| + | < | ||
| + | < | ||
| + | |||
| + | : | ||
| + | <-t 1 add dup ->t 60 pingpong -> | ||
| + | self " | ||
| + | < | ||
| </ | </ | ||
| < | < | ||