This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| prpl:setfieldcell [2020/09/27 16:43] – Added arguments and description, fixed examples Grabz | prpl:setfieldcell [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ^Arguments^Result^Notation^ | ^Arguments^Result^Notation^ | ||
| - | | X, Y, PowerX, PowerY | + | | X, Y, VectorUp, VectorRight |
| === Description === | === Description === | ||
| Assigns a directional field on a specified cell. Only one field can exist on a cell - changing a field again will fully override the previous field. | Assigns a directional field on a specified cell. Only one field can exist on a cell - changing a field again will fully override the previous field. | ||
| + | |||
| + | VectorUp and VectorRight control the direction of the field. For example, values of: | ||
| + | * 1 1 will create a field that points in the upper right. | ||
| + | * 1 0 will create a field that points up. | ||
| + | * -5 0 will create a stronger field that points down. | ||
| === Examples === | === Examples === | ||
| - | Spawn a field at coordinates 5,5. | + | Spawn a weak field that points right at coordinates 5,5. |
| < | < | ||
| 5 5 0.0 1.0 SetFieldCell | 5 5 0.0 1.0 SetFieldCell | ||
| Line 32: | Line 37: | ||
| | | ||
| #Multiply the directional vector by power to increase the strength of the field. | #Multiply the directional vector by power to increase the strength of the field. | ||
| - | < | + | < |
| - | < | + | < |
| | | ||
| #Spawn the fields in a radius relative to the center of the unit. | #Spawn the fields in a radius relative to the center of the unit. | ||
| Line 39: | Line 44: | ||
| <-Y < | <-Y < | ||
| <-X < | <-X < | ||
| - | I J <-VectorY | + | I J <-VectorUp |
| loop | loop | ||
| loop | loop | ||