This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cw4:4rpl_tools [2024/05/12 15:18] – Kalli | cw4:4rpl_tools [2024/05/13 11:42] (current) – [Make Units Unselectable] Kalli | ||
---|---|---|---|
Line 2926: | Line 2926: | ||
---- | ---- | ||
- | ===== Next Utility goes here ===== | + | ===== Make Units Unselectable |
+ | |||
+ | You can make friendly/ | ||
+ | |||
+ | The $ variables are now set so that friendly (=human) units are set unselectable and undestroyable, | ||
+ | |||
+ | Enemy (=creeper) units are always undestroyable. Changing this setting with 4rpl does nothing, but also doesn' | ||
+ | |||
+ | The script can be used from the console, or be added as a global script to a cpack. If used as a global script, then the script must run while paused. It will only apply to units that exist at map start. | ||
<hidden click here for source code> | <hidden click here for source code> | ||
- | <code 4rpl file name.4rpl> | + | <code 4rpl MakeUnitsUnselectable.4rpl> |
+ | |||
+ | # MakeUnitsUnselectable | ||
+ | |||
+ | # The script can be used from the console, or be added as a global script to a cpack. | ||
+ | # If used as a global script, then the script must run while paused. It will only apply to units that exist at map start. | ||
+ | |||
+ | $applyToFriendlyUnits: | ||
+ | |||
+ | $applyToEnemyUnits: | ||
+ | |||
+ | $applyToAllUnits: | ||
+ | |||
+ | $makeUnitsSelectable: | ||
+ | $makeUnitsDestroyable: | ||
+ | |||
+ | :once | ||
+ | GetMapSize 2 div -> | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | 0 -> | ||
+ | else | ||
+ | < | ||
+ | endif | ||
+ | |||
+ | # The position is the center of the map. The max possible range for units within the map boundaries is (512/2^2 + 128/ | ||
+ | "" | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | loop | ||
</ | </ |