LocalN (deprecated since 4.9.10.7 [335] LC)

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

any& LocalN (string szName, object pObj);

Parameters

szName:
Name of the variable to which a reference is to be returned
pObj:
[optional] 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.

Changelog

Date Author Version Description
4th September 2019 DerTod 4.9.10.7 [335] LC Deprecated: 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.
See also: GlobalN, IsRef, Local, Named Variables, VarN
Günther, November 2002
Der Tod, October 2019