Configstring: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (14 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
__NOEDITSECTION__ | __NOEDITSECTION__ | ||
Configstrings can be accessed with [[Lua_Mod_API#configstrings|et.trap_GetConfigstring and et.trap_SetConfigstring]] and the [[Lua_Mod_API#string_utility_functions|String utility functions]] | Configstrings can be accessed with <code>[[Lua_Mod_API#configstrings|et.trap_GetConfigstring]]</code> and <code>[[Lua_Mod_API#configstrings|et.trap_SetConfigstring]]</code> and the [[Lua_Mod_API#string_utility_functions|String utility functions]]. | ||
==What are Configstrings== | |||
* Configstrings are strings that are set on the server, and automatically sent to each client. | |||
* Configstrings are often, but not always, in the form of an infostring (a backslash delimited set of key\value pairs) | |||
* Each configstring is identified by a number, which is usually given refered to by a name #defined in the ET gamecode. | |||
* A group of related configstrings (such as CS_PLAYERS) usually only have a symbolic name for the first value, with a number (entity number in the case of CS_PLAYERS) added to to get a particular value. | |||
* Most configstrings have a specific meaning to the gamecode. You can use the etmain SDK find out what they do, but beware that etpro does not do things exactly the same as etmain. | |||
* A list of configstring numbers and names can be found in [http://www.sonic.net/~rfm/et/lua/etconst.lua etconst.lua] | |||
==User Configstring== | ==User Configstring== | ||
A user Configstring gets written in the log file with a line starting with ''UserInfoChanged'' which mustn't be mistaken for one with ''Userinfo''. | A user Configstring gets written in the log file with a line starting with ''UserInfoChanged'' which mustn't be mistaken for one with ''Userinfo''. | ||
To access a user's Configstring you can't just use et.trap_GetConfigstring(slotNumber) but must use et.trap_GetConfigstring(et.CS_PLAYERS< | To access a user's Configstring you can't just use <code>et.trap_GetConfigstring(slotNumber)</code> but must use <code>et.trap_GetConfigstring(et.CS_PLAYERS + slotNumber)</code>. | ||
<pitatable columns=3 headlines="key;name;description" widths="40;220;450" headerfontcolor="#FFFFFF"> | <pitatable columns=3 headlines="key;name;description" widths="40;220;450" headerfontcolor="#FFFFFF"> | ||
n;Nick; | n;Nick;Player nickname | ||
t;Team;1=Axis, 2=Allies, 3=Spectators | t;Team;1=Axis, 2=Allies, 3=Spectators | ||
c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps | c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps | ||
r;Rank; | r;Rank;0-10 | ||
m;Medals; | m;Medals;0=Highest Battle Sense, 1=Best Engineer, 2=Best Medic, 3=Best Field Ops, 4=Highest Light Weapons, 5=Best Soldier, 6=Best Covert Ops | ||
s;Skills; | s;Skills;Battle Sense, Engineering, First Aid, Signals, Light Weapons, Heavy Weapons, Covert Operations [0-4] | ||
dn;Disguised name; | dn;Disguised name; Covert op disguised as... | ||
dr;Disguised rank; | dr;Disguised rank; Covert op disguised as rank... | ||
w;Weapon | w;Weapon;2=Lugar, 3=MP40, 5=Panzerfaust, 6=Flamethrower, 7=Colt, 8=Thomson 10=Sten, 23=Engineer K43, 24=Engineer M1 Garand, 25=Covert Ops M1 Garand, 31=Mobile MG42, 32=Covert Ops K43 33=FG42, 35=Mortar, 37=Akimbo Colts, 38=Akimbo Lugars, 47=Silenced Akimbo Colts, 48=Silenced Akimbo Lugars | ||
lw;Latched weapon;Weapon on next spawn | lw;Latched weapon;Weapon on next spawn | ||
sw;Latched secondary weapon;Secondary weapon on next spawn | sw;Latched secondary weapon;Secondary weapon on next spawn | ||
p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth | mu;Muted;0=No, 1=Yes | ||
ss;Stat Saver; Stats restored by stat saver | ref;Referee;Referee status (0=not ref, 1=ref) | ||
sc;Shoutcaster;etpro only | p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth (ETPro only) | ||
tv;ETTV slave;etpro only | ss;Stat Saver; Stats have been restored by stat saver, etpro only (0=No, 1=Yes) | ||
sc;Shoutcaster;etpro only (0=No, 1=Yes) | |||
tv;ETTV slave;etpro only (0=No, 1=Yes) | |||
lc;?;0=? | |||
</pitatable> | </pitatable> | ||
Source: http://bani.anime.net/banimod/forums/viewtopic.php?t=5412 | |||
==LUA Example== | |||
et.CS_PLAYERS = <span style="color: darkblue;">689</span> | |||
<span style="color: green;">-- get the name of client #3 using configstrings</span> | |||
<span style="color: darkred;">local</span> cs = et.trap_GetConfigstring(et.CS_PLAYERS + <span style="color: darkblue;">3</span>) | |||
<span style="color: darkred;">local</span> name = et.Info_ValueForKey(cs, <span style="color: darkblue;">"n"</span>) | |||
==Notes== | |||
<code>et.CS_PLAYERS = 689</code> for those of you that don't use [[User:ReyalP|etconst.lua]]. | |||
<small>Source: http://bani.anime.net/banimod/forums/viewtopic.php?t=5412</small> | |||
[[Category:ETPro]] | [[Category:ETPro]] | ||
[[Category:Lua]] | [[Category:Lua]] | ||
[[Category:ETPro:Mods]] | [[Category:ETPro:Mods]] | ||
Latest revision as of 06:43, 30 May 2010
Configstrings can be accessed with et.trap_GetConfigstring and et.trap_SetConfigstring and the String utility functions.
What are Configstrings
- Configstrings are strings that are set on the server, and automatically sent to each client.
- Configstrings are often, but not always, in the form of an infostring (a backslash delimited set of key\value pairs)
- Each configstring is identified by a number, which is usually given refered to by a name #defined in the ET gamecode.
- A group of related configstrings (such as CS_PLAYERS) usually only have a symbolic name for the first value, with a number (entity number in the case of CS_PLAYERS) added to to get a particular value.
- Most configstrings have a specific meaning to the gamecode. You can use the etmain SDK find out what they do, but beware that etpro does not do things exactly the same as etmain.
- A list of configstring numbers and names can be found in etconst.lua
User Configstring
A user Configstring gets written in the log file with a line starting with UserInfoChanged which mustn't be mistaken for one with Userinfo.
To access a user's Configstring you can't just use et.trap_GetConfigstring(slotNumber) but must use et.trap_GetConfigstring(et.CS_PLAYERS + slotNumber).
|
LUA Example
et.CS_PLAYERS = 689 -- get the name of client #3 using configstrings local cs = et.trap_GetConfigstring(et.CS_PLAYERS + 3) local name = et.Info_ValueForKey(cs, "n")
Notes
et.CS_PLAYERS = 689 for those of you that don't use etconst.lua.
Source: http://bani.anime.net/banimod/forums/viewtopic.php?t=5412