Difference between revisions of "SetLocalPlayer"
BryanDerksen (Talk | contribs) m (1 revision: Importing auto-generated function articles) |
BryanDerksen (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
{{dafunction | {{dafunction | ||
|name=SetLocalPlayer | |name=SetLocalPlayer | ||
Line 20: | Line 19: | ||
== Description == | == Description == | ||
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. --> | <!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. --> | ||
− | Sets a local player variable sVarName on the specified | + | Sets a local player variable sVarName on the specified object. |
− | object. | + | |
== Remarks == | == Remarks == | ||
<!-- This section contains additional comments, observations and known issues. --> | <!-- This section contains additional comments, observations and known issues. --> | ||
+ | All local variables must be predefined in the target object's variables 2da file before this function can be used successfully. If a local variable is not predefined this function will fail silently. | ||
+ | |||
It is very important to note that a player is not a reference to a specific player, but rather is a reference to a player slot (player1, player2, player3... etc). So the values will not necessarily refer to the same players across a save/load. | It is very important to note that a player is not a reference to a specific player, but rather is a reference to a player slot (player1, player2, player3... etc). So the values will not necessarily refer to the same players across a save/load. | ||
+ | |||
+ | '''NOTE!''' This type of local variable is not saved/loaded via the save system. So, if a community member or designer wants to save information like this for use later, and someone saves/loads the game, that information is lost forever. Thus, using them outside of situations where you can guarantee no save/load occurs (i.e. during combat) is pretty much guaranteed to fail for some enduser. Furthermore, if you use these variable types in the var_ 2DAs, it will fail gloriously. | ||
+ | |||
+ | Don’t use this function. It will in all likelihood be removed in a future patch. | ||
<!-- == Examples == --> | <!-- == Examples == --> | ||
<!-- This section contains examples transcluded from the snippet library. --> | <!-- This section contains examples transcluded from the snippet library. --> | ||
− | |||
== See also == | == See also == | ||
<!-- This section contains links to articles, functions or constant groups. --> | <!-- This section contains links to articles, functions or constant groups. --> | ||
[[GetLocalPlayer]] | [[GetLocalPlayer]] | ||
[[Category: Variable functions]] | [[Category: Variable functions]] | ||
+ | [[Category:Deprecated functions]] |
Latest revision as of 19:55, 25 February 2010
Sets a local player variable on an object.
- Parameters:
- oObject
- Object to set the variable on
- sVarName
- The name of the variable to set
- pPlayer
- The value of the player variable
- Returns:
- Nothing.
- Source:
- script.ldf
Description
Sets a local player variable sVarName on the specified object.
Remarks
All local variables must be predefined in the target object's variables 2da file before this function can be used successfully. If a local variable is not predefined this function will fail silently.
It is very important to note that a player is not a reference to a specific player, but rather is a reference to a player slot (player1, player2, player3... etc). So the values will not necessarily refer to the same players across a save/load.
NOTE! This type of local variable is not saved/loaded via the save system. So, if a community member or designer wants to save information like this for use later, and someone saves/loads the game, that information is lost forever. Thus, using them outside of situations where you can guarantee no save/load occurs (i.e. during combat) is pretty much guaranteed to fail for some enduser. Furthermore, if you use these variable types in the var_ 2DAs, it will fail gloriously.
Don’t use this function. It will in all likelihood be removed in a future patch.