4rpl:commands:setunituioptions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
4rpl:commands:setunituioptions [2024/08/24 20:35] – Recovered draft about unreliability Vertu | 4rpl:commands:setunituioptions [2025/02/14 14:57] (current) – external edit 127.0.0.1 |
---|
Note that this call only works on custom units. If used on a built in unit, it will do nothing. | Note that this call only works on custom units. If used on a built in unit, it will do nothing. |
| |
:WARNING: Changes set by this API do not persist between saves. You will have to apply this API in :Gameloaded to prevent errors.\\ | :WARNING: Should you use this API, all Choice widgets will get wiped on a new gameload. It doesn't matter what widget you use this API on or what type, gameload will wipe all choice widgets. The only solution is to use this API to set all choice widgets when the unit is reloaded. You will want to use [[4rpl:commands:func_awake|Awake]] (triggered on the unit being loaded in) or [[4rpl:commands:func_gameloaded|Gameloaded]] (when the mission is loaded). |
Theorized erros are:\\ | |
* Flip widgets for the unit using this API will change states visually but not internally. When you have a flip widget as "ON/OFF" and its currently "OFF" (state 1), when this API is used, it will still say "OFF" but is actually "ON" (state 0). | |
* Other choice widgets that are not set via this API, get wiped. Example: Choice: "1,2,3,4,5" is in widget 3 in the CPACK settings, widget 2, choice, is set by this API. After gameload, that widget becomes: "".\\ | |
:NOTE: Advanced investigation not done on this. | |
| |
===== Examples ===== | ===== Examples ===== |
<code 4rpl> | <code 4rpl> |
SetUnitUIOptions(self 0 ListN("Larry" "Moe" "Curly" 3)) | SetUnitUIOptions(self 0 ListN("Larry" "Moe" "Curly" 3)) |
| </code> |
| <code 4rpl> |
| SetUnitUIOptions(self 5 Split("Larry jim,Moe Curly" ",")) |
</code> | </code> |
<=[[4rpl:start| Index]] | <=[[4rpl:start| Index]] |
| |
4rpl/commands/setunituioptions.1724531749.txt.gz · Last modified: 2025/02/14 14:56 (external edit)