4rpl:commands:setunitspecifiedtarget
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
4rpl:commands:setunitspecifiedtarget [2024/01/14 22:11] – [Description] Minor Note on Integers durikkan | 4rpl:commands:setunitspecifiedtarget [2025/02/14 14:57] (current) – external edit 127.0.0.1 |
---|
Sets a unit's specified target location. The specified target is a map cell location that is set either by player interaction or by script. | Sets a unit's specified target location. The specified target is a map cell location that is set either by player interaction or by script. |
| |
The value to set is a vector consisting of three coordinates. The map position is in the X and Z locations. The Y-value/2nd vector of this V3 is ignored but still needs to "exist" so you can't use only a V2 as the 2nd vector of the V2 will be placed in the Y-vector of the V3 only to then be ignored, causing a V3 of (X Z 0). To avoid this, either use a V3 like in the example or organize a V3 like so: "V3(<-X 0 <-Z)" or "V3(<-.x 0 <-.z)". You can not directly input a V2 into this API because of this need of organizing the stack around the Y-value vector. | ''<-pos'' must be a V3, despite the Y location being completely unused. It expects the vector to be this: ''V3(<-X 0 <-Z)'', so if your input is this; ''V2(<-X <-Z)'' the Z value will be read incorrectly. You may easily "convert" vectors as such: ''V3(swap(EV2(<-vector) 0))'' or ''EV2 0 swap V3'' or ''<-vector.y ->vector.z'' If you are converting two ints into a V3, (like what [[GetUnitCell]] returns,) simply push a 0 and [[swap]]. |
| |
---- | ---- |
4rpl/commands/setunitspecifiedtarget.1705270284.txt.gz · Last modified: 2025/02/14 14:56 (external edit)