FindSystemNode

From HEWIKI
Jump to: navigation, search

Contents

FindSystemNode

FindSystemNode(prototypeName as String, createNode as Boolean, systemNode references NodeRef) as Boolean

Arguments

<prototypeName> 
The name of the prototype who's system node is being searched for.
<createNode> 
When looking for the system node, this flag will cause the system node to be instantiated if it does not already exist.
<systemNode> 
A noderef that will be filled in with the instantiation of the system node, or None if the system node is not instantiated (which can only happen if createNode is false).

Description

This is a built-in function, usable on both client and server, which looks for the instantiation of a system node. If the prototype name given to the function is valid, it will return true. If the prototype has been instantiated as a system node, the NodeRef will be set to that instantiation. If the prototype name is a valid prototype, but the prototype has not been instantiated as a system node, the noderef will be set to None, unless createNode is TRUE, in which case the system node will be instantiated and systemNode will address it. If there is no prototype with the given name, the function will return FALSE, and the value of systemNode will not be changed.

For more information, please see the section on Functions.

Example

If a script has the name of a system node given as a string, then this function is useful to create the system node.

function CreateSystemNodeDynamically(player as noderef, prototypeName as String) as NodeRef
  aSystemNode as NodeRef
  if ( FindSystemNode(prototypeName, true, aSystemNode) )
    return aSystemNode
  else
    $CHAT.CHATPLAYER(player, "default", "Bad Prototype Name")
  .
.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox