This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cw4:4rpl_tools [2024/02/29 17:27] – Sound players now have an input delay. Vertu | cw4:4rpl_tools [2024/05/13 11:42] (current) – [Make Units Unselectable] Kalli | ||
---|---|---|---|
Line 2342: | Line 2342: | ||
New towers will be constructed if they can connect to: existing riftlab, m-rift, pylons, energy pods and towers. | New towers will be constructed if they can connect to: existing riftlab, m-rift, pylons, energy pods and towers. | ||
+ | |||
+ | To run the console script, simply let it run continuously. | ||
<hidden click here for source code> | <hidden click here for source code> | ||
Line 2348: | Line 2350: | ||
# AutoTowerGrid | # AutoTowerGrid | ||
# by Kalli | # by Kalli | ||
+ | # Script is to run continuously in the console! | ||
$pacMode:0 # Makes all units built by the pilot unselectable and undeletable by the player | $pacMode:0 # Makes all units built by the pilot unselectable and undeletable by the player | ||
Line 2920: | Line 2923: | ||
The snapping tool makes use of a unit for highlighting the nearest buildable cell, so it's a cpack instead of a script : [[https:// | The snapping tool makes use of a unit for highlighting the nearest buildable cell, so it's a cpack instead of a script : [[https:// | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== 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> | ||
+ | |||
+ | <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 | ||
+ | |||
+ | </ | ||
+ | |||
+ | </ | ||
---- | ---- |