Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
cw4:4rpl_tools [2024/01/18 15:57] – [Automated Tower Grid Building] Kalli | cw4:4rpl_tools [2024/02/29 17:27] – Sound players now have an input delay. Vertu |
---|
| |
$rmb:1 # right click button | $rmb:1 # right click button |
$index:0 | |
| |
Once | |
@MakeSoundList | |
endOnce | |
| |
if (GetMappedKey("Custom1" false)) | if(<-inputDelay gt0) <-inputDelay 1 - ->inputDelay endif |
Mod(<-Index 1 +, <-soundCount) ->index | |
| if (GetMappedKey("Custom1" false) <-inputDelay eq0 &&) |
| 2 ->inputDelay |
| Mod(<-index 1 +, <-soundCount) ->index |
<-soundList[<-index] ->soundName | <-soundList[<-index] ->soundName |
TraceAll ("This is sound #" <-index ", " DQ <-soundName DQ) | TraceAll ("This is sound #" <-index ", " DQ <-soundName DQ) |
endIf | endIf |
| |
if (GetMappedKey("Custom2" false)) | if(GetMappedKey("Custom2" false) <-inputDelay eq0 &&) |
Mod2(<-Index 1 -, <-soundCount) ->index | 2 ->inputDelay |
| Mod2(<-index 1 -, <-soundCount) ->index |
<-soundList[<-index] ->soundName | <-soundList[<-index] ->soundName |
TraceAll ("This is sound #" <-index ", " DQ <-soundName DQ) | TraceAll ("This is sound #" <-index ", " DQ <-soundName DQ) |
| |
if (GetMouseButtonDown(<-rmb true )) | if (GetMouseButtonDown(<-rmb true )) |
PlaySoundAtPosition(<-soundName 8 GetCameraPosition) | PlaySoundAtPosition(<-soundName 8 GetCameraPosition V3(0 0.1 0) +) |
endif | endif |
| |
| :Once |
| -1 ->index #So we start at 0, not 1. |
| @MakeSoundList |
:MakeSoundList | :MakeSoundList |
| |
"ADAMessage" | "ADAMessage" |
"ADAMessagesClose" | "ADAMessagesClose" |
"Explosion" | "Explosion" |
"Explosion_1" | "Explosion_1" |
"Explosion_10" | |
"Explosion_11" | |
"Explosion_12" | |
"Explosion_2" | "Explosion_2" |
"Explosion_3" | "Explosion_3" |
"Explosion_8" | "Explosion_8" |
"Explosion_9" | "Explosion_9" |
| "Explosion_10" |
| "Explosion_11" |
| "Explosion_12" |
"HoverOpen" | "HoverOpen" |
"InfoCacheCollected" | "InfoCacheCollected" |
"Warning2" | "Warning2" |
List ->soundList | List ->soundList |
| |
"AlarmClock" | "AlarmClock" |
"GreenarRefinery" | "GreenarRefinery" |
"SoundLoop_alarm0" | "SoundLoop_alarm0" |
"SoundLoop_alarm1" | "SoundLoop_alarm1" |
"SoundLoop_alarm10" | |
"SoundLoop_alarm11" | |
"SoundLoop_alarm12" | |
"SoundLoop_alarm13" | |
"SoundLoop_alarm14" | |
"SoundLoop_alarm15" | |
"SoundLoop_alarm2" | "SoundLoop_alarm2" |
"SoundLoop_alarm3" | "SoundLoop_alarm3" |
"SoundLoop_alarm8" | "SoundLoop_alarm8" |
"SoundLoop_alarm9" | "SoundLoop_alarm9" |
| "SoundLoop_alarm10" |
| "SoundLoop_alarm11" |
| "SoundLoop_alarm12" |
| "SoundLoop_alarm13" |
| "SoundLoop_alarm14" |
| "SoundLoop_alarm15" |
"SoundLoop_ambience0" | "SoundLoop_ambience0" |
"SoundLoop_ambience1" | "SoundLoop_ambience1" |
"SoundLoop_ambience10" | |
"SoundLoop_ambience2" | "SoundLoop_ambience2" |
"SoundLoop_ambience3" | "SoundLoop_ambience3" |
"SoundLoop_ambience8" | "SoundLoop_ambience8" |
"SoundLoop_ambience9" | "SoundLoop_ambience9" |
| "SoundLoop_ambience10" |
"SoundLoop_gun0" | "SoundLoop_gun0" |
"SoundLoop_gun1" | "SoundLoop_gun1" |
"SoundLoop_gun3" | "SoundLoop_gun3" |
"SoundLoop_hum0" | "SoundLoop_hum0" |
"SoundLoop_hum1" | "SoundLoop_hum1" |
| "SoundLoop_hum2" |
| "SoundLoop_hum3" |
| "SoundLoop_hum4" |
| "SoundLoop_hum5" |
| "SoundLoop_hum6" |
| "SoundLoop_hum7" |
| "SoundLoop_hum8" |
| "SoundLoop_hum9" |
"SoundLoop_hum10" | "SoundLoop_hum10" |
"SoundLoop_hum11" | "SoundLoop_hum11" |
"SoundLoop_hum17" | "SoundLoop_hum17" |
"SoundLoop_hum18" | "SoundLoop_hum18" |
"SoundLoop_hum2" | |
"SoundLoop_hum3" | |
"SoundLoop_hum4" | |
"SoundLoop_hum5" | |
"SoundLoop_hum6" | |
"SoundLoop_hum7" | |
"SoundLoop_hum8" | |
"SoundLoop_hum9" | |
"SoundLoop_machine0" | "SoundLoop_machine0" |
"SoundLoop_machine1" | "SoundLoop_machine1" |
"SoundLoop_machine10" | |
"SoundLoop_machine11" | |
"SoundLoop_machine12" | |
"SoundLoop_machine2" | "SoundLoop_machine2" |
"SoundLoop_machine3" | "SoundLoop_machine3" |
"SoundLoop_machine8" | "SoundLoop_machine8" |
"SoundLoop_machine9" | "SoundLoop_machine9" |
| "SoundLoop_machine10" |
| "SoundLoop_machine11" |
| "SoundLoop_machine12" |
"SoundLoop_misc0" | "SoundLoop_misc0" |
"SoundLoop_misc1" | "SoundLoop_misc1" |
"ambient" | "ambient" |
List ->loopSoundList | List ->loopSoundList |
| |
GetListCount(<-soundList) ->soundCount | GetListCount(<-soundList) ->soundCount |
TraceAllSp ("List of " <-soundCount "sounds available") | TraceAllSp("List of " <-soundCount "sounds available") |
TraceAllSp ("There are also " GetListCOunt(<-loopSoundList) "looping sounds that cannot be played in this module") | TraceAllSp("There are also " GetListCOunt(<-loopSoundList) "looping sounds that cannot be played in this module") |
TraceAllSP ("Press and hold user key 1/2 to scroll through the sound list." ) | TraceAllSP("Press and hold KeyPad 1 / 2 to scroll through the sound list.") |
TraceAllSp ("Left-click mouse to listen to it.") | TraceAllSp("Left-click mouse to listen to it.") |
</code> | </code> |
| |
| |
A few notes. | A few notes. |
| * The script will attempt to unpause the game, since looping sounds only play when not paused due to being attached to a unit. |
* 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. | |
* The script will attempt to unpause the game, since looping sounds only play when not paused. | |
* Remember to unmute game music. | * Remember to unmute game music. |
| |
| |
$rmb:1 # right click button | $rmb:1 # right click button |
$index:0 | |
| |
Once | if(<-inputDelay gt0) <-inputDelay 1 - ->inputDelay endif |
@MakeSoundList | |
CreateUnitOnTerrain("infocache" 1 1 1) ->unitUID | |
false ->soundOn | |
Getpause ->pause | |
endOnce | |
SetUnitPosition(<-unitUID GetCameraPosition V3(0 1.5 0) +) | SetUnitPosition(<-unitUID GetCameraPosition V3(0 1.5 0) +) |
| |
if (GetMappedKey("Custom1" false)) | if(GetMappedKey("Custom1" false) <-inputDelay eq0 &&) |
Mod(<-Index 1 +, <-soundCount) ->index | 2 ->inputDelay |
| Mod(<-index 1 +, <-soundCount) ->index |
<-loopSoundList[<-index] ->soundName | <-loopSoundList[<-index] ->soundName |
TraceAll ("This is sound #" <-index ", " DQ <-soundName DQ) | TraceAll("This is sound #" <-index ", " DQ <-soundName DQ) |
endIf | endIf |
| |
if (GetMappedKey("Custom2" false)) | if(GetMappedKey("Custom2" false) <-inputDelay eq0 &&) |
Mod2(<-Index 1 -, <-soundCount) ->index | 2 ->inputDelay |
| Mod2(<-index 1 -, <-soundCount) ->index |
<-loopSoundList[<-index] ->soundName | <-loopSoundList[<-index] ->soundName |
TraceAll ("This is sound #" <-index ", " DQ <-soundName DQ) | TraceAll("This is sound #" <-index ", " DQ <-soundName DQ) |
endIf | endIf |
| |
if (GetMouseButtonDown(<-rmb true )) | if(GetMouseButtonDown(<-rmb true)) |
If (<-soundOn) | If(<-soundOn) |
StopSoundLoop(<-unitUID) | StopSoundLoop(<-unitUID) |
Not(<-soundOn) ->soundOn | Not(<-soundOn) ->soundOn |
SetPause(<-pause) | SetPause(<-pause) |
TraceAllSp ("Stopping " <-soundName " from playing") | TraceAllSp("Stopping " <-soundName " from playing") |
else | else |
TraceAllSp ("Can you hear " <-soundName " playing?") | TraceAllSp("Can you hear " <-soundName " playing?") |
SetPause (false) | SetPause (false) |
PlaySoundLoop(<-soundName 5 <-unitUID) | PlaySoundLoop(<-soundName 5 <-unitUID) |
Not(<-soundOn) ->soundOn | Not(<-soundOn) ->soundOn |
endif | endif |
| |
endif | endif |
| |
TraceAllSp("Goodbye!") | TraceAllSp("Goodbye!") |
DestroyUnit(<-unitUID true true true) | DestroyUnit(<-unitUID true true true) |
| if(<-soundOn) SetPause(true) endif |
| |
| :Once |
| -1 ->index #So we start at 0, not 1. |
| @MakeSoundList |
| CreateUnitOnTerrain("infocache" 1 1 1) ->unitUID |
| false ->soundOn |
| Getpause ->pause |
| |
| |
:MakeSoundList | :MakeSoundList |
| |
"ADAMessage" | "ADAMessage" |
"ADAMessagesClose" | "ADAMessagesClose" |
"Explosion" | "Explosion" |
"Explosion_1" | "Explosion_1" |
"Explosion_10" | |
"Explosion_11" | |
"Explosion_12" | |
"Explosion_2" | "Explosion_2" |
"Explosion_3" | "Explosion_3" |
"Explosion_8" | "Explosion_8" |
"Explosion_9" | "Explosion_9" |
| "Explosion_10" |
| "Explosion_11" |
| "Explosion_12" |
"HoverOpen" | "HoverOpen" |
"InfoCacheCollected" | "InfoCacheCollected" |
"MissionObjectiveFail" | "MissionObjectiveFail" |
"MissionObjectiveRequiredComplete" | "MissionObjectiveRequiredComplete" |
"MissionScan" | "MissionScan" "InhibitorFiring" |
"InhibitorFiring" | |
"MissionSpaceInitiateJump" | "MissionSpaceInitiateJump" |
"MissionSpacePanelClose" | "MissionSpacePanelClose" |
"SporePrelaunch" | "SporePrelaunch" |
"SprayerFire" | "SprayerFire" |
"Stun" | "Stun" "CannonFire" |
"CannonFire" | |
"SurviveBaseOffline" | "SurviveBaseOffline" |
"SurviveBaseWarn" | "SurviveBaseWarn" |
"ThorGun" | "ThorGun" |
"TotemExplosion" | "TotemExplosion" "UnitHoverLand" |
"UnitHoverLand" | |
"UnitBuild" | "UnitBuild" |
"UnitExplosion" | "UnitExplosion" |
"SoundLoop_alarm0" | "SoundLoop_alarm0" |
"SoundLoop_alarm1" | "SoundLoop_alarm1" |
"SoundLoop_alarm10" | |
"SoundLoop_alarm11" | |
"SoundLoop_alarm12" | |
"SoundLoop_alarm13" | |
"SoundLoop_alarm14" | |
"SoundLoop_alarm15" | |
"SoundLoop_alarm2" | "SoundLoop_alarm2" |
"SoundLoop_alarm3" | "SoundLoop_alarm3" |
"SoundLoop_alarm8" | "SoundLoop_alarm8" |
"SoundLoop_alarm9" | "SoundLoop_alarm9" |
| "SoundLoop_alarm10" |
| "SoundLoop_alarm11" |
| "SoundLoop_alarm12" |
| "SoundLoop_alarm13" |
| "SoundLoop_alarm14" |
| "SoundLoop_alarm15" |
"SoundLoop_ambience0" | "SoundLoop_ambience0" |
"SoundLoop_ambience1" | "SoundLoop_ambience1" |
"SoundLoop_ambience10" | |
"SoundLoop_ambience2" | "SoundLoop_ambience2" |
"SoundLoop_ambience3" | "SoundLoop_ambience3" |
"SoundLoop_ambience8" | "SoundLoop_ambience8" |
"SoundLoop_ambience9" | "SoundLoop_ambience9" |
| "SoundLoop_ambience10" |
"SoundLoop_gun0" | "SoundLoop_gun0" |
"SoundLoop_gun1" | "SoundLoop_gun1" |
"SoundLoop_gun3" | "SoundLoop_gun3" |
"SoundLoop_hum0" | "SoundLoop_hum0" |
"SoundLoop_hum1" | "SoundLoop_hum1" |
| "SoundLoop_hum2" |
| "SoundLoop_hum3" |
| "SoundLoop_hum4" |
| "SoundLoop_hum5" |
| "SoundLoop_hum6" |
| "SoundLoop_hum7" |
| "SoundLoop_hum8" |
| "SoundLoop_hum9" |
"SoundLoop_hum10" | "SoundLoop_hum10" |
"SoundLoop_hum11" | "SoundLoop_hum11" |
"SoundLoop_hum17" | "SoundLoop_hum17" |
"SoundLoop_hum18" | "SoundLoop_hum18" |
"SoundLoop_hum2" | |
"SoundLoop_hum3" | |
"SoundLoop_hum4" | |
"SoundLoop_hum5" | |
"SoundLoop_hum6" | |
"SoundLoop_hum7" | |
"SoundLoop_hum8" | |
"SoundLoop_hum9" | |
"SoundLoop_machine0" | "SoundLoop_machine0" |
"SoundLoop_machine1" | "SoundLoop_machine1" |
"SoundLoop_machine10" | |
"SoundLoop_machine11" | |
"SoundLoop_machine12" | |
"SoundLoop_machine2" | "SoundLoop_machine2" |
"SoundLoop_machine3" | "SoundLoop_machine3" |
"SoundLoop_machine8" | "SoundLoop_machine8" |
"SoundLoop_machine9" | "SoundLoop_machine9" |
| "SoundLoop_machine10" |
| "SoundLoop_machine11" |
| "SoundLoop_machine12" |
"SoundLoop_misc0" | "SoundLoop_misc0" |
"SoundLoop_misc1" | "SoundLoop_misc1" |
"ambient" | "ambient" |
List ->loopSoundList | List ->loopSoundList |
| |
GetListCount(<-loopSoundList) ->soundCount | GetListCount(<-loopSoundList) ->soundCount |
TraceAllSp ("List of " <-soundCount "looping sounds available") | TraceAllSp("List of " <-soundCount "looping sounds available") |
TraceAllSP ("Press and hold user key 1/2 to scroll through the sound list." ) | TraceAllSP("Press and hold KeyPad 1 / 2 to scroll through the sound list.") |
TraceAllSp ("Move mouse out of edit box. Left-click mouse to listen to a sound. " ) | TraceAllSp("Move mouse out of edit box. Left-click mouse to listen to a sound. ") |
TraceAllSP ("Left-click to turn off again.") | TraceAllSP("Left-click to turn off again.") |
TraceAllSp ("Remember to mute music!") | TraceAllSp("Remember to mute music!") |
</code> | </code> |
| |