User:Phenomenon: Difference between revisions
Phenomenon (talk | contribs) mNo edit summary |
Phenomenon (talk | contribs) No edit summary |
||
| Line 3: | Line 3: | ||
<table><tr><td width=200>http://wowdev.org/wiki/images/thumb/9/95/Lua.gif/180px-Lua.gif</td><td> | <table><tr><td width=200>http://wowdev.org/wiki/images/thumb/9/95/Lua.gif/180px-Lua.gif</td><td> | ||
'''''Homepage''''' | '''''Homepage''''' | ||
:[http://www.force-opponents.de www.force-opponents.de] - Home of the Force Opponents Clan | :''[http://www.force-opponents.de www.force-opponents.de]'' - Home of the Force Opponents Clan | ||
'''''EMail''''' | '''''EMail''''' | ||
:[mailto:phenomenon@force-opponents.de phenomenon@force-opponents.de] | :''[mailto:phenomenon@force-opponents.de phenomenon@force-opponents.de]'' | ||
'''''[[IRC]]''''' | '''''[[IRC]]''''' | ||
:[irc://irc.quakenet.org:6667/force-opponents #force-opponents] - channel on QuakeNet | :''[irc://irc.quakenet.org:6667/force-opponents #force-opponents]'' - channel on QuakeNet | ||
</td></tr></table> | </td></tr></table> | ||
<br> | |||
<table width=100%> | |||
<tr> | |||
<td style="border: 1px solid #fabd23; color: #000; background-color: #fcfae3"> | |||
<div style="padding: .5em .9em .9em"> | |||
== ''Scripts'' == | |||
:*[[#LUA script - playsoundcmd.lua|playsoundcmd.lua]] | |||
:**[[#ETAdmin_mod spree sounds HowTo|ETAdmin_mod spree sounds HowTo]] | |||
== ''Functions'' == | |||
:*[[#LUA function - et.G_ClientSound()|et.G_ClientSound()]] | |||
</div> | |||
</td> | |||
</tr> | |||
</table> | |||
<br> | <br> | ||
== ''LUA script - <font color=blue>playsoundcmd.lua</font>'' == | == ''LUA script - <font color=blue>playsoundcmd.lua</font>'' == | ||
This script adds new console commands ''<font color=gray>playsound</font>'' and ''<font color=gray>playsound_env</font>'' to your server. The difference to the already existing ''[[User:RoadKillPuppy|playsound.lua]]'' is this one can play a sound only for a certain player and/or also for players in the proximity of this player (exactly [http://et.tjw.org/etpub ETPub] behavior). | This script adds new console commands ''<font color=gray>playsound</font>'' and ''<font color=gray>playsound_env</font>'' to your server. The difference to the already existing ''[[User:RoadKillPuppy|playsound.lua]]'' is this one can play a sound only for a certain player and/or also for players in the proximity of this player (exactly ''[http://et.tjw.org/etpub ETPub]'' behavior). | ||
===== '''''Requirements''''' ===== | ===== '''''Requirements''''' ===== | ||
:*Wolfenstein - Enemy Territory (patched to v2.60b) - ''[http://www.splashdamage.com splashdamage.com]'' | :*Wolfenstein - Enemy Territory (patched to v2.60b) - ''[http://www.splashdamage.com splashdamage.com]'' | ||
:*[[ETPro]] | :*''[[ETPro]]'' 3.2.6 or higher - ''[http://etpro.anime.net etpro.anime.net]'' | ||
===== '''''Installation''''' ===== | ===== '''''Installation''''' ===== | ||
:*Download the | :*Download the latest ''[http://www.force-opponents.de/lua/playsoundcmd.lua playsoundcmd.lua]'' script and save it into your ''[[ETPro]]'' folder. | ||
:*Add the following | :*Add the following line to your server configuration to instruct your server to load the script on startup.<pre>set lua_modules "playsoundcmd.lua"</pre> | ||
:*Restart your server | :*Restart your server. | ||
===== '''''Usage''''' ===== | ===== '''''Usage''''' ===== | ||
| Line 27: | Line 44: | ||
:''<font color=gray>\rcon (rconpassword) playsound [name/slot#] [sound]</font>'' plays '''sound''' for '''name/slot#''' only<br> | :''<font color=gray>\rcon (rconpassword) playsound [name/slot#] [sound]</font>'' plays '''sound''' for '''name/slot#''' only<br> | ||
:''<font color=gray>\rcon (rconpassword) playsound_env [name/slot#] [sound]</font>'' plays '''sound''' for '''name/slot#''' and surrounding clients only | :''<font color=gray>\rcon (rconpassword) playsound_env [name/slot#] [sound]</font>'' plays '''sound''' for '''name/slot#''' and surrounding clients only | ||
===== '''''[http://et.d1p.de/etadmin_mod/wiki/index.php ETAdmin_mod] spree sounds HowTo''''' ===== | |||
:*If needed you must update your ''[[ETPro]]'' to version 3.2.6 or higher. You can found the newest package available at ''[http://etpro.anime.net etpro.anime.net]''. | |||
:*Add the following line to your server configuration to instruct your server to load the script on startup.<pre>set lua_modules "playsoundcmd.lua"</pre> | |||
:*You must provide the sounds on your server to make them available to your players. Download the file ''[http://www.force-opponents.de/lua/etadmin_sounds.pk3 etadmin_sounds.pk3]'' and save it into your ''[[ETPro]]'' folder. This file contains the basic ''[http://et.d1p.de/etadmin_mod/wiki/index.php ETAdmin_mod]'' sounds. | |||
:*Download the latest ''[http://www.force-opponents.de/lua/playsoundcmd.lua playsoundcmd.lua]'' script and save it into your ''[[ETPro]]'' folder. | |||
:*Configure ''[http://et.d1p.de/etadmin_mod/wiki/index.php ETAdmin_mod]'' v0.29 or higher to use the ''<font color=gray>playsound</font>'' command.<br><br><p>''etadmin_mod/etc/etadmin.cfg'':</p><table cellspacing=0 cellpadding=0 width=100%><tr><td><pre><nowiki># Detect Multikills (UT like, 3 at once) | |||
# Note: The 3 kills have to be max. 3 seconds away from each other | |||
multikill_detector = 1 | |||
# Detect Monsterkills (UT like, 5 at once) | |||
# Note: 5 kills have to be max. 3 seconds away from each other | |||
monsterkill_detector = 1 | |||
# note: the spree_color is deprected. See [spree_messages] instead. | |||
# Announce first blood | |||
first_blood = 1</nowiki></pre></td></tr></table><p>''etadmin_mod/etc/sound.cfg'':</p><table cellspacing=0 cellpadding=0 width=100%><tr><td><pre><nowiki># -> THIS OPTION IS DEPRECATED, USE SOUND_MAPPINGS INSTEAD !!!! | |||
# its only here for people, that don't want to change their config from 0.28! | |||
spree_sounds = 0 | |||
# 1 = enable soundmappings, 0 = disable | |||
sound_mappings = 1 | |||
# rcon: means, that the regexp will apply to all rcon commands send from the etadmin_mod into the game. | |||
# clog: means, that the regexp apply to every line of the etconsole.log. | |||
# Remove # to activate sound. | |||
[sound_mappings] | |||
# First blood (also in spree sounds, don't mix spree_sounds = 1 and this): | |||
#rcon:drew \^1first \^1BLOOD = sound/misc/firstblood.wav | |||
rcon:"-PLAYERNAME- \^1drew \^1first \^1BLOOD \^1! = sound/misc/firstblood.wav | |||
# Sounds on Monster / Multikill (also in spree sounds, don't mix spree_sounds = 1 and this) | |||
rcon:\^7!!!! \^1Multikill = sound/misc/multikill.wav | |||
rcon:\^1OMG, MONSTERKILL = sound/misc/monsterkill.wav | |||
# private sounds (only use these or the above, don't mix!): | |||
#rcon:Multikill \^7> \^7-PLAYERNAME- \^7< \^1Multikill = sound/misc/multikill.wav | |||
#rcon:^1MONSTERKILL \^7>>> \^7-PLAYERNAME- \^7<<< ^1MONSTER KILL = sound/misc/monsterkill.wav | |||
# Spree messages (global) | |||
rcon:\^8is \^8on \^8a \^8killing \^8spree = sound/misc/killingspree.wav | |||
rcon:\^8is \^8on \^8a \^8rampage = sound/misc/rampage.wav | |||
rcon:\^8is \^8dominating = sound/misc/dominating.wav | |||
rcon:\^8is \^8unstoppable = sound/misc/unstoppable.wav | |||
rcon:\^8is \^8godlike = sound/misc/godlike.wav | |||
rcon:\^8is \^8wicked \^8sick = sound/misc/wickedsick.wav</nowiki></pre></td></tr></table> | |||
:* Restart your ''[http://et.d1p.de/etadmin_mod/wiki/index.php ETAdmin_mod]'' and your server. | |||
<br> | <br> | ||
| Line 34: | Line 100: | ||
===== '''''Requirements''''' ===== | ===== '''''Requirements''''' ===== | ||
:*[[ETPro]] | :*''[[ETPro]]'' 3.2.6 or higher - ''[http://etpro.anime.net etpro.anime.net]'' | ||
===== '''''Usage''''' ===== | ===== '''''Usage''''' ===== | ||
| Line 40: | Line 106: | ||
::Plays a global sound '''soundfile''' for a certain client '''clientnum''' only. | ::Plays a global sound '''soundfile''' for a certain client '''clientnum''' only. | ||
===== ''''' | ===== '''''Source''''' ===== | ||
<table><tr><td> | :<table cellspacing=0 cellpadding=0 width=100%><tr><td><pre><nowiki>EV_GLOBAL_CLIENT_SOUND = 54 | ||
EV_GLOBAL_CLIENT_SOUND = 54 | |||
function et.G_ClientSound(clientnum, soundfile) | function et.G_ClientSound(clientnum, soundfile) | ||
| Line 48: | Line 113: | ||
et.gentity_set(tempentity, "s.teamNum", clientnum) | et.gentity_set(tempentity, "s.teamNum", clientnum) | ||
et.gentity_set(tempentity, "s.eventParm", et.G_SoundIndex(soundfile)) | et.gentity_set(tempentity, "s.eventParm", et.G_SoundIndex(soundfile)) | ||
end | end</nowiki></pre></td></tr></table> | ||
</pre></td></tr></table> | |||
__NOTOC__ | __NOTOC__ | ||
__NOEDITSECTION__ | __NOEDITSECTION__ | ||
Revision as of 21:09, 27 July 2006
| http://wowdev.org/wiki/images/thumb/9/95/Lua.gif/180px-Lua.gif |
Homepage
|
LUA script - playsoundcmd.lua
This script adds new console commands playsound and playsound_env to your server. The difference to the already existing playsound.lua is this one can play a sound only for a certain player and/or also for players in the proximity of this player (exactly ETPub behavior).
Requirements
- Wolfenstein - Enemy Territory (patched to v2.60b) - splashdamage.com
- ETPro 3.2.6 or higher - etpro.anime.net
Installation
- Download the latest playsoundcmd.lua script and save it into your ETPro folder.
- Add the following line to your server configuration to instruct your server to load the script on startup.
set lua_modules "playsoundcmd.lua"
- Restart your server.
Usage
- \rcon (rconpassword) playsound [sound] plays sound for all clients
- \rcon (rconpassword) playsound [name/slot#] [sound] plays sound for name/slot# only
- \rcon (rconpassword) playsound_env [name/slot#] [sound] plays sound for name/slot# and surrounding clients only
ETAdmin_mod spree sounds HowTo
- If needed you must update your ETPro to version 3.2.6 or higher. You can found the newest package available at etpro.anime.net.
- Add the following line to your server configuration to instruct your server to load the script on startup.
set lua_modules "playsoundcmd.lua"
- You must provide the sounds on your server to make them available to your players. Download the file etadmin_sounds.pk3 and save it into your ETPro folder. This file contains the basic ETAdmin_mod sounds.
- Download the latest playsoundcmd.lua script and save it into your ETPro folder.
- Configure ETAdmin_mod v0.29 or higher to use the playsound command.
etadmin_mod/etc/etadmin.cfg:
# Detect Multikills (UT like, 3 at once) # Note: The 3 kills have to be max. 3 seconds away from each other multikill_detector = 1 # Detect Monsterkills (UT like, 5 at once) # Note: 5 kills have to be max. 3 seconds away from each other monsterkill_detector = 1 # note: the spree_color is deprected. See [spree_messages] instead. # Announce first blood first_blood = 1
etadmin_mod/etc/sound.cfg:
# -> THIS OPTION IS DEPRECATED, USE SOUND_MAPPINGS INSTEAD !!!!
- its only here for people, that don't want to change their config from 0.28!
spree_sounds = 0
- 1 = enable soundmappings, 0 = disable
sound_mappings = 1
- rcon: means, that the regexp will apply to all rcon commands send from the etadmin_mod into the game.
- clog: means, that the regexp apply to every line of the etconsole.log.
- Remove # to activate sound.
[sound_mappings]
- First blood (also in spree sounds, don't mix spree_sounds = 1 and this):
- rcon:drew \^1first \^1BLOOD = sound/misc/firstblood.wav
rcon:"-PLAYERNAME- \^1drew \^1first \^1BLOOD \^1! = sound/misc/firstblood.wav
- Sounds on Monster / Multikill (also in spree sounds, don't mix spree_sounds = 1 and this)
rcon:\^7!!!! \^1Multikill = sound/misc/multikill.wav rcon:\^1OMG, MONSTERKILL = sound/misc/monsterkill.wav
- private sounds (only use these or the above, don't mix!):
- rcon:Multikill \^7> \^7-PLAYERNAME- \^7< \^1Multikill = sound/misc/multikill.wav
- rcon:^1MONSTERKILL \^7>>> \^7-PLAYERNAME- \^7<<< ^1MONSTER KILL = sound/misc/monsterkill.wav
- Spree messages (global)
rcon:\^8is \^8on \^8a \^8killing \^8spree = sound/misc/killingspree.wav rcon:\^8is \^8on \^8a \^8rampage = sound/misc/rampage.wav rcon:\^8is \^8dominating = sound/misc/dominating.wav rcon:\^8is \^8unstoppable = sound/misc/unstoppable.wav rcon:\^8is \^8godlike = sound/misc/godlike.wav
rcon:\^8is \^8wicked \^8sick = sound/misc/wickedsick.wav- Restart your ETAdmin_mod and your server.
LUA function - et.G_ClientSound()
Use this function in your own projects to play a sound for a certain client only.
Requirements
- ETPro 3.2.6 or higher - etpro.anime.net
Usage
- et.G_ClientSound(clientnum, soundfile)
- Plays a global sound soundfile for a certain client clientnum only.
Source
EV_GLOBAL_CLIENT_SOUND = 54
function et.G_ClientSound(clientnum, soundfile) local tempentity = et.G_TempEntity(et.gentity_get(clientnum, "r.currentOrigin"), EV_GLOBAL_CLIENT_SOUND) et.gentity_set(tempentity, "s.teamNum", clientnum) et.gentity_set(tempentity, "s.eventParm", et.G_SoundIndex(soundfile))
end