This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cw4:4rpl_tools [2024/01/18 15:56] – [Next Utility goes here] Kalli | cw4:4rpl_tools [2024/05/12 15:35] – [Make Units Unselectable] Kalli | ||
---|---|---|---|
Line 582: | Line 582: | ||
$rmb:1 # right click button | $rmb:1 # right click button | ||
- | $index:0 | ||
- | Once | ||
- | @MakeSoundList | ||
- | endOnce | ||
- | if (GetMappedKey(" | + | if(< |
- | Mod(<-Index 1 +, < | + | |
+ | if (GetMappedKey(" | ||
+ | 2 -> | ||
+ | Mod(<-index 1 +, < | ||
< | < | ||
TraceAll ("This is sound #" <-index ", " DQ < | TraceAll ("This is sound #" <-index ", " DQ < | ||
endIf | endIf | ||
- | if (GetMappedKey(" | + | if(GetMappedKey(" |
- | Mod2(<-Index 1 -, < | + | 2 -> |
+ | Mod2(<-index 1 -, < | ||
< | < | ||
TraceAll ("This is sound #" <-index ", " DQ < | TraceAll ("This is sound #" <-index ", " DQ < | ||
Line 601: | Line 601: | ||
if (GetMouseButtonDown(< | if (GetMouseButtonDown(< | ||
- | PlaySoundAtPosition(< | + | PlaySoundAtPosition(< |
endif | endif | ||
- | + | ||
+ | :Once | ||
+ | -1 ->index #So we start at 0, not 1. | ||
+ | @MakeSoundList | ||
: | : | ||
- | + | ||
" | " | ||
" | " | ||
Line 633: | Line 637: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 643: | Line 644: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 715: | Line 719: | ||
" | " | ||
List -> | List -> | ||
- | + | ||
" | " | ||
" | " | ||
Line 724: | Line 728: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 738: | Line 736: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | + | " |
- | " | + | |
" | " | ||
" | " | ||
Line 749: | Line 752: | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 754: | Line 758: | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 764: | Line 776: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 785: | Line 786: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 797: | Line 801: | ||
" | " | ||
List -> | List -> | ||
- | + | ||
GetListCount(< | GetListCount(< | ||
- | TraceAllSp ("List of " < | + | TraceAllSp(" |
- | TraceAllSp (" | + | TraceAllSp(" |
- | TraceAllSP (" | + | TraceAllSP(" |
- | TraceAllSp (" | + | TraceAllSp(" |
</ | </ | ||
Line 812: | Line 816: | ||
A few notes. | A few notes. | ||
- | + | | |
- | * The Greenar Refinery sound is spatial and you have to be in freeview and right upon the unit in location (1,1) to hear it. | + | |
- | | + | |
* Remember to unmute game music. | * Remember to unmute game music. | ||
Line 824: | Line 826: | ||
$rmb:1 # right click button | $rmb:1 # right click button | ||
- | $index:0 | ||
- | Once | + | if(< |
- | @MakeSoundList | + | |
- | CreateUnitOnTerrain(" | + | |
- | false | + | |
- | Getpause | + | |
- | endOnce | + | |
SetUnitPosition(< | SetUnitPosition(< | ||
- | if (GetMappedKey(" | + | if(GetMappedKey(" |
- | Mod(<-Index 1 +, < | + | 2 -> |
+ | Mod(<-index 1 +, < | ||
< | < | ||
- | TraceAll ("This is sound #" <-index ", " DQ < | + | TraceAll(" |
endIf | endIf | ||
- | if (GetMappedKey(" | + | if(GetMappedKey(" |
- | Mod2(<-Index 1 -, < | + | 2 -> |
+ | Mod2(<-index 1 -, < | ||
< | < | ||
- | TraceAll ("This is sound #" <-index ", " DQ < | + | TraceAll(" |
endIf | endIf | ||
- | if (GetMouseButtonDown(< | + | if(GetMouseButtonDown(< |
- | If (< | + | If(< |
StopSoundLoop(< | StopSoundLoop(< | ||
Not(< | Not(< | ||
SetPause(< | SetPause(< | ||
- | TraceAllSp (" | + | TraceAllSp(" |
else | else | ||
- | TraceAllSp ("Can you hear " < | + | TraceAllSp(" |
SetPause (false) | SetPause (false) | ||
PlaySoundLoop(< | PlaySoundLoop(< | ||
Not(< | Not(< | ||
endif | endif | ||
- | |||
endif | endif | ||
Line 864: | Line 862: | ||
TraceAllSp(" | TraceAllSp(" | ||
DestroyUnit(< | DestroyUnit(< | ||
+ | if(< | ||
+ | |||
+ | :Once | ||
+ | -1 ->index #So we start at 0, not 1. | ||
+ | @MakeSoundList | ||
+ | CreateUnitOnTerrain(" | ||
+ | false -> | ||
+ | Getpause ->pause | ||
- | |||
: | : | ||
- | + | ||
" | " | ||
" | " | ||
Line 895: | Line 900: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 905: | Line 907: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 915: | Line 920: | ||
" | " | ||
" | " | ||
- | " | + | " |
- | " | + | |
" | " | ||
" | " | ||
Line 964: | Line 968: | ||
" | " | ||
" | " | ||
- | " | + | " |
- | " | + | |
" | " | ||
" | " | ||
" | " | ||
- | " | + | " |
- | " | + | |
" | " | ||
" | " | ||
Line 989: | Line 991: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 1003: | Line 999: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | + | " |
- | " | + | |
" | " | ||
" | " | ||
Line 1014: | Line 1015: | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1019: | Line 1021: | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1029: | Line 1039: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 1050: | Line 1049: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1062: | Line 1064: | ||
" | " | ||
List -> | List -> | ||
- | + | ||
GetListCount(< | GetListCount(< | ||
- | TraceAllSp ("List of " < | + | TraceAllSp(" |
- | TraceAllSP (" | + | TraceAllSP(" |
- | TraceAllSp ("Move mouse out of edit box. Left-click mouse to listen to a sound. " ) | + | TraceAllSp(" |
- | TraceAllSP (" | + | TraceAllSP(" |
- | TraceAllSp (" | + | TraceAllSp(" |
</ | </ | ||
Line 2337: | Line 2339: | ||
The below script originally existed as a map script that builds out the tower grid for/ | The below script originally existed as a map script that builds out the tower grid for/ | ||
- | If you have a large map with varied terrain and you want to want wire it up fast, then this script is worth a try. | + | If you have a large map with varied terrain and you want to want to wire it up fast, then this script is worth a try. |
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 2346: | 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 2917: | Line 2922: | ||
===== Faster vanilla unit placement : Snapping Tool ===== | ===== Faster vanilla unit placement : Snapping Tool ===== | ||
- | The snapping tool makes use of a unit for highlighting the nearest buildable cell, so it's a cpack instead of a script. For more information see: [[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 asfloat -> | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | |||
+ | </ | ||
</ | </ |