Category: Objects
/ Vertices
Since engine version: 1.0 OC
SetVertex
Description
Sets the offset coordinates of a given object vertex (seeDefCore.txt). Coordinates are relative to the object center.
Syntax
int SetVertex(int index, int select, int value, int set_custom_permanent);
Parameters
- index:
- Index of the vertex to be changed.
- select:
- Determines which vertex data is to be changed.
Value Meaning VTX_X X coordinate of the vertex. VTX_Y Y coordinate of the vertex VTX_CNAT CNAT value of the vertex. VTX_Friction Friction of the vertex. - value:
- Value to be set to.
- set_custom_permanent:
- [opt] Special vertex mode. If 1 or 2 the new value will be stored in the last 25 vertices and copied from there during the next shape update. Using this parameter, script changed vertices will be kept during stretch or rotation operations. With value 2, vertices will be updated immediately, not only with the next shape update.
Remark
Notice: with any vertex updated caused by stretching or rotation of the object (e.g. building or growth) the vertices will be reset to their original defined position unless a special vertex mode is selected using the set_custom_permanent parameter.