<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.herc.ws/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Getvariableofnpc</id>
		<title>Getvariableofnpc - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Getvariableofnpc"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Getvariableofnpc&amp;action=history"/>
		<updated>2026-05-05T05:43:10Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Getvariableofnpc&amp;diff=572&amp;oldid=prev</id>
		<title>Via: Created page with &quot;==Syntax== *'''getvariableofnpc'''(&lt;variable&gt;, &lt;&quot;npc name&quot;&gt;);  ==Description== This function retrieves a variable reference to a [[Variables#NPC_Variables|permanent NPC variab...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Getvariableofnpc&amp;diff=572&amp;oldid=prev"/>
				<updated>2013-08-06T07:40:28Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Syntax== *&amp;#039;&amp;#039;&amp;#039;getvariableofnpc&amp;#039;&amp;#039;&amp;#039;(&amp;lt;variable&amp;gt;, &amp;lt;&amp;quot;npc name&amp;quot;&amp;gt;);  ==Description== This function retrieves a variable reference to a [[Variables#NPC_Variables|permanent NPC variab...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Syntax==&lt;br /&gt;
*'''getvariableofnpc'''(&amp;lt;variable&amp;gt;, &amp;lt;&amp;quot;npc name&amp;quot;&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This function retrieves a variable reference to a [[Variables#NPC_Variables|permanent NPC variable]] in an another NPC script. Note, that the return value behaves like a variable, not like a value, which means, the return value of this function can be used in other script commands, which expect a variable as parameter.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
 [[mes]] &amp;quot;The current name of my co-worker is &amp;quot;+getvariableofnpc(.npcname$, &amp;quot;Site Co-Worker&amp;quot;);&lt;br /&gt;
Prints the value of the variable ''.npcname$'' as if it was used inside the NPC &amp;quot;Site Co-Worker&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 mes &amp;quot;Let's give him an another name...&amp;quot;;&lt;br /&gt;
 [[set]] getvariableofnpc(.npcname$, &amp;quot;Site Co-Worker&amp;quot;), &amp;quot;Sleeping Tom&amp;quot;;&lt;br /&gt;
Sets the variable ''.npcname$'' of the NPC &amp;quot;Site Co-Worker&amp;quot; to &amp;quot;Sleeping Tom&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 set .mynpcnamecopy$, getvariableofnpc(.npcname$, &amp;quot;Site Co-Worker&amp;quot;);&lt;br /&gt;
 set .mynpcnamecopy$, &amp;quot;Sleeping Tom&amp;quot;;&lt;br /&gt;
Will change the variable ''.mynpcnamecopy$'' to &amp;quot;Sleeping Tom&amp;quot;, but keep the variable ''.npcname$'' of NPC &amp;quot;Site Co-Worker&amp;quot; unaffected, because the first call to set copies the value of ''.npcname$'' to ''.mynpcnamecopy$'', rather than the reference.&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Command]]&lt;/div&gt;</summary>
		<author><name>Via</name></author>	</entry>

	</feed>