LocalN (deprecated)

Category: Variables
Since engine version: 4.9.1.0 GWE

Description

Returns a reference to an object local variable. This reference can be used for reading or writing this variable.

Syntax

&LocalN (string szName, object pObj);

Parameters

szName:
Name of the variable to which a reference is to be returned
pObj:
[opt] Object of which you want to retrieve a variable. Can be 0 in local calls.

Remark

This function exists in order to preserve compatibility to older game content. You should use obj["name"] or obj.name, the latter if #strict 3 is activated.

Examples

var obj;
if (obj = LocalN ("basement", FindObject (WTWR))) Explode (20, obj);
Explodes the basement of a wizard tower. Only works with a magic tower - all other objects use Local(9) to store a pointer to their basement.
func Initialize () {
  local Baum = CreateObject (TRE1);
}
//Mit Timer=1 in der DefCore.txt jeden Frame aufgerufen
func TimerCall () {
  SetPosition (GetX (), GetY (), LocalN("Baum"));
}
The object carries a tree around with it.
See also: GlobalN, IsRef, Local, VarN, named variables
Günther, November 2002
Der Tod, Oktober 2019