<?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=RID</id>
		<title>RID - 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=RID"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=RID&amp;action=history"/>
		<updated>2026-05-01T06:33:27Z</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=RID&amp;diff=241&amp;oldid=prev</id>
		<title>Mysterious: Created page with &quot;{{OtherUse|the script state reference id|game object id|GID}}  Most scripting commands and functions will want to request data about a character, store variables referenced to...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=RID&amp;diff=241&amp;oldid=prev"/>
				<updated>2013-02-12T00:05:46Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{OtherUse|the script state reference id|game object id|GID}}  Most scripting commands and functions will want to request data about a character, store variables referenced to...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{OtherUse|the script state reference id|game object id|GID}}&lt;br /&gt;
&lt;br /&gt;
Most scripting commands and functions will want to request data about a character, store variables referenced to that character, send stuff to the client connected to that specific character. Whenever a script is invoked by a character, it is passed a so-called RID - this is the account ID number of a character that caused the code to execute by clicking on it, walking into it's [[OnTouch]] zone, or otherwise.&lt;br /&gt;
&lt;br /&gt;
=Usage=&lt;br /&gt;
When writing simple [[NPC|NPCs]] only, this topic will not require much attention. However, when using [[Functions|functions]], [[Timers (Scripting)|timers]], or clock-based script activation, one requires to be aware of all cases when a script execution can be triggered without a RID attached. This will make a lot of commands and functions unusable, since they request data from a specific character, send data to a specific client, or store variables specific to a character, which are unavailable, if there's no RID, which refers to the character to work with, unless [[attachrid]] is used to explicitly attach a character to the script first.&lt;br /&gt;
&lt;br /&gt;
Whenever is stated ''invoking character'' or ''currently attached character'', it actually means ''the character whose RID is currently attached to the running script''. The script function [[playerattached]] can be used to check which is the currently attached player to the script (it will return 0 if the there is no player attached or the attached player no longer is logged on to the map-server). The function [[detachrid]] will explicitly set the RID to 0, so care must be taken, that follow-up commands do not depend on a character being attached, especially access to [[Variables|temporary character variables]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Basics]]&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>Mysterious</name></author>	</entry>

	</feed>