nyuuzyou/wikis huggingface dataset:
Dota 2 Workshop Tools/Panorama/GameUI SetMouseCallback Example

// This is an example of how to use the GameUI.SetMouseCallback function
GameUI.SetMouseCallback( function( eventName, arg ) {
	var CONSUME_EVENT = true;
	var CONTINUE_PROCESSING_EVENT = false;
	if ( GameUI.GetClickBehaviors() !== CLICK_BEHAVIORS.DOTA_CLICK_BEHAVIOR_NONE )
		return CONTINUE_PROCESSING_EVENT;
	if ( eventName == "pressed" )
	{
		// Left-click is move to position
		if ( arg === 0 )
		{
			var order = {};
			order.OrderType = dotaunitorder_t.DOTA_UNIT_ORDER_MOVE_TO_POSITION;
			order.Position = GameUI.GetScreenWorldPosition( GameUI.GetCursorPosition() );
			order.Queue = false;
			order.ShowEffects = false;
			Game.PrepareUnitOrders( order );
			return CONSUME_EVENT;
		}
		// Disable right-click
		if ( arg === 1 )
		{
			return CONSUME_EVENT;
		}
	}
	else if ( eventName === "wheeled" )
	{
		if ( arg < 0 )
		{
			var order = {};
			order.OrderType = dotaunitorder_t.DOTA_UNIT_ORDER_MOVE_TO_POSITION;
			order.Position = GameUI.GetScreenWorldPosition( GameUI.GetCursorPosition() );
			order.Queue = false;
			order.ShowEffects = false;
			Game.PrepareUnitOrders( order );
			return CONSUME_EVENT;		
		}
		else if ( arg > 0 )
		{
			var order = {};
			order.OrderType = dotaunitorder_t.DOTA_UNIT_ORDER_ATTACK_MOVE;
			order.Position = GameUI.GetScreenWorldPosition( GameUI.GetCursorPosition() );
			order.Queue = false;
			order.ShowEffects = false;
			Game.PrepareUnitOrders( order );
			return CONSUME_EVENT;		
		}
	}
	return CONTINUE_PROCESSING_EVENT;
} );
Category: Dota 2 Workshop Tools Category: Panorama
Dota 2 Workshop Tools/Panorama/Localization

In order to support multiple languages, most Panorama UIs are built with references to "localization tokens" instead of literal user-facing strings. These tokens are then dynamically replaced with the correct localized string depending on the user's language selection.
In your XML localization tokens are prefixed with a '#' symbol and can be used as regular text:
 <Label text="#hello_message" />
When this UI is loaded, the token will be automatically replaced with a string from the corresponding localization file:
 "hello_message" "Hello, world!"
Note: Unlike most content for Panorama, the localization files live in the game/ tree instead of content.
For Dota addons, localization files live here:
 game/dota_addons/ADDON_NAME/panorama/localization/addon_LANGUAGE_NAME.txt
== Dynamic data ==
In many cases you may have dynamic data that you need to inject into a localization string. This is achieved using "dialog variables" set on the panel that can be referenced by the localization file: 
XML:
<Label id="msg" text="#MessageText" /> 
 
Javascript:
$("#msg").SetDialogVariable( "adjective", "favorite" );
$("#msg").SetDialogVariableInt( "number", 2 ); 
 
Localization file:
"MessageText" "My {s:adjective} number is {d:number}." 
 
 $( "#PanelID" ).text = $.Localize( "#LocalizationToken" );
Category:Dota 2 Workshop Tools
Category:Panorama
Dota 2 Workshop Tools/Particle Copy Tool

The Particle Copy Tool is intended to make it easy to branch or modify particle system definitions and their children. Combined with the example content we are shipping, it should be easier to create exciting new visual effects for your addon.
== Example Usage ==
# Open the system (eg. "particles/items3_fx/star_emblem.vpcf") you want to copy in the Particle Editor
# Pick File Menu -> Copy System Definition...
# Under "name remapping" change particles/items3_fx/star_emblem_2 to particles/my_cool_effect (Name remapping is a simple string replacement that applies to the filename of each system in the hierarchy. It's usually sufficient for most straightforward copy/move operations.)
# Observe that the destination file names follow the same pattern as the originals, with the name remapping applied. (This works because the particle effect was authored with a consistent naming scheme. See "Advanced Features" below for other tools to deal with less consistent filenames.)
# Hit the "Preview" button to see what operations the tool will perform - verify that the files are going where you expect
# Close the preview dialog and hit "Go!" to copy the particle system.
# Open your new system in the particle editor and start experimenting!
== Advanced Features ==
* "Hierarchical rename" will impose a strict naming scheme on the filenames (without modifying the folder) - suited for a large hierarchy of particle children. You may want to use this if you are trying to copy a system that doesn't follow a careful naming convention.
* You can manually enter target filenames by clicking the lock icon to the right of destination filenames.
* If you mark a file as 'skip' then any new files will simply refer back to the original.
* By default the copy tool will prevent you from overwriting files - check 'Overwrite Existing Files?' to disable this behavior (but be careful!)
* By default the copy tool will prevent you from accidentally running it twice in a row.
Category:Dota 2 Workshop Tools
Dota 2 Workshop Tools/Particles

Category:Dota 2 Workshop Tools
== Getting Started ==
* Particle System Overview
* Particle Editor
== Tutorials ==
* Particle Effect Tutorial 1
== Functions ==
* Particle System Renderers
* Particle System Operators and :Category:Particle operators
* Particle System Initializers and :Category:Particle initializers
* Particle System Emitters
* Particle System Renderers
* Particle System Constraints
* Particle System Forces
== Other Topics ==
* Particle System Properties
* Control Point (particles)
* Particle Performance
Dota 2 Workshop Tools/Particles/Particle Performance

== Max Particles ==
: By default each system is set to 1004 max particles. This much memory is allocated for the system regardless of whether it's used or not. So after setting up your system, you'll want to take a look at the counter to see how many particles you're using and set the max particles to this number. This will help to keep the memory usage to a sane amount.
== Threading ==
: Particles are multithreaded by system. So if you have multiple systems, they'll be distributed over as many threads as are available. So on its face, it's good to split complex systems up into multiple systems to take advantage of this feature. That said, there's overhead to each system, so there's a limited benefit to the usefulness of this approach, especially on simpler systems. Splitting up a system that only has a few dozen particles will almost certainly be a net loss. However, if you system has in the thousand+ range of particles, it's worth treating it as multiple lower count particle systems which can be multi-threaded. A system and it's children are always on the same thread because parents and children can pass data to each other and as such need to be be grouped together.
== SIMD ==
: Right now, most particle operators, Initializers, etc. work in SIMD. This means on current hardware they're generally doing all math on groups of four particles simultaneously. Theoretically in the future this will scale up to wider numbers on different kinds of hardware. The point here is that if you stick to multiples of four, you'll be making better use of the system. Scaling a system down to the closest multiple of four will make it slightly more optimal. This isn't a huge gain, but it's something to be aware of.
== Sharing data ==
: There are a variety of ways to share data between parent and children systems. Some of the more complex Initializers or operators can minimize their performance impact by writing out their results to a control point, which can then be read by children and use the same data without having to do any of the work.
== Collision ==
: In general, collision is an expensive operation. The default mode 0 does traces for each particle every frame. This is expensive and doesn't scale well. However, the Collision constraint allows for a few different collision modes which allow for much faster collisions that trade off accuracy for speed. Collision Mode 3 is the best accuracy/performance tradeoff for dynamic collisions with particles in unpredictable locations/movements.
Category:Dota 2 Workshop Tools
Dota 2 Workshop Tools/Script Filters

Script filters allow custom game authors the ability to intercept and modify pending actions. Each script filter passes in a table with the information that describes the event that is about to occur. Modifying values in the table will change the behavior of the action that is about to happen. Return true from the filter function so continue with the action and return false to abort. The best way to see what values are in each filter is to print the contents of the table when the filter is called.
* ExecuteOrders - All Player issued and forced actions get routed through here.
* RuneSpawn - A rune is about to spawn on the given spawner.
* Damage - Damage is about to be applied (after all reductions).
* ModifyGold - A player is having their gold value modified for the specified reason.
* ModifyExperience - A player is having their gold value modified for the specified reason.
Category:Dota 2 Workshop Tools
Dota 2 Workshop Tools/Scripting

Category:Dota 2 Workshop Tools Category:Scripting
Scripting in Dota 2 is handled by the VScript virtual machine using the Lua programming language. Lua will be launched at run time when Dota 2 loads your add-on and can manipulate most facets of the game. Scripts can control the events that happen in game modes, game rules, abilities, hero interactions, neutrals , AI, and many more.
== Getting Started ==
The documentation presented here assumes basic knowledge of Lua. If you're new to programming and Lua it's worth spending some time at the official Lua website learning some of the basic concepts. Additional resources are available at the bottom of the page for new users.
* Getting Started
* Debugging Lua scripts
== Scripting Abilities ==
* Data Driven Abilities
* Data Driven Ability Examples
* Lua Abilities and Modifiers
== Common Techniques ==
* Entity Scripts
* Thinker Functions
* Console Commands
* Dedicated VConsole Log Viewer
* Listening to Game Events
* Script Filters
* Custom Game Events
* Custom Nettables
== Reference ==
* Scripting API
* Animation System API (deprecated)
* Built-In Engine Events (warning: many broken)
* Built-In Ability Names
* Built-In Modifier Names
* Built-In Item Names
* Heroes Internal Names
* Built-In Unit Names
* BoundsHullName Size Reference
== Examples ==
* Simple trigger that calls Lua
* Data driven item that drops upon death
* Motion Controller Example
* Creating a Tower Example
* Detecting If Player Clicked Inside A Given Area When Using Items or Spells
* Using Bitfields To Adjust Stat Value Bonuses
* Using CreateHTTPRequest
== Lua Resources ==
* Official Lua Website
* Programming in Lua - Good resource for learning Lua. If you're new to Lua or programming this is a good reference point to start from.
* Programming In Lua - Online - First edition of the above book is available online for free.
* Sublime Text 2/3 Snippets for all functions
== See also ==
VScript
Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetAttachmentAngles

== Function Description ==
 Vector GetAttachmentAngles(int iAttachment) 
Get the attachement id's angles as a p,y,r vector''''
== Parameters ==
Type	Name 	Description
int 	iAttachment	No Description Set
== Returns ==
Vector - No Description Set
Category:Dota2Function
Category:CBaseAnimating
Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetAttachmentOrigin

== Function Description ==
 Vector GetAttachmentOrigin(int iAttachment) 
Get the attachement id's origin vector''''
== Parameters ==
Type	Name 	Description
int 	iAttachment	No Description Set
== Returns ==
Vector - No Description Set
Category:Dota2Function
Category:CBaseAnimating
Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.ScriptLookupAttachment

== Function Description ==
 int ScriptLookupAttachment(string pAttachmentName) 
Get the named attachment id
== Parameters ==
Type 	Name 	Description
string	pAttachmentName	No Description Set
== Returns ==
int - No Description Set
Category:Dota2Function
Category:CBaseAnimating
Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.SetModelScale

== Function Description ==
 void SetModelScale(float scale) 
Sets the model's scale to scale, so if a unit had its model scale at 1, and you use SetModelScale(10.0), it would set the scale to 10.0.
== Parameters ==
Type 	Name 	Description
float	scale	No Description Set
Category:Dota2Function
Category:CBaseAnimating
Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.SetPoseParameter

== Function Description ==
 float SetPoseParameter(string szName, float fValue) 
Set the specified pose parameter to the specified value
== Parameters ==
Type 	Name 	Description
string	szName	No Description Set
float 	fValue	No Description Set
== Returns ==
float - No Description Set
Category:Dota2Function
Category:CBaseAnimating
Dota 2 Workshop Tools/Scripting/API/CBaseCombatCharacter.ShootPosition

== Function Description ==
 Vector ShootPosition(int nHand) 
Returns the shoot position eyes (or hand in VR).
;Example
function CBaseCombatCharacter:ShootPosition( nHand ) end
== Parameters ==
Type	Name 	Description
int 	nHand	No Description Set
== Returns ==
Vector - No Description Set
Category:Dota2Function
Category:CBaseCombatCharacter
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.AddEffects

== Function Description ==
 void AddEffects(int nFlags) 
AddEffects( int ): Adds the render effect flag.
;Example
function CBaseEntity:AddEffects( nFlags ) end
== Parameters ==
Type	Name 	Description
int 	nFlags	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.ApplyAbsVelocityImpulse

== Function Description ==
 void ApplyAbsVelocityImpulse(Vector vecImpulse) 
Apply a Velocity Impulse
== Parameters ==
Type 	Name 	Description
Vector	vecImpulse	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.ApplyLocalAngularVelocityImpulse

== Function Description ==
 void ApplyLocalAngularVelocityImpulse(Vector angImpulse) 
Apply an Ang Velocity Impulse
== Parameters ==
Type 	Name 	Description
Vector	angImpulse	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute GetFloatValue

== Function Description ==
 float Attribute_GetFloatValue(string pName, float flDefault) 
Get float value for an entity attribute.
;Example
function CBaseEntity:Attribute_GetFloatValue( pName, flDefault ) end
== Parameters ==
Type 	Name 	Description
string	pName 	No Description Set
float 	flDefault	No Description Set
== Returns ==
float - No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute GetIntValue

== Function Description ==
 float Attribute_GetIntValue(string pName, int nDefault) 
Get int value for an entity attribute.
;Example
function CBaseEntity:Attribute_GetIntValue( pName, nDefault ) end
== Parameters ==
Type 	Name 	Description
string	pName 	No Description Set
int 	nDefault	No Description Set
== Returns ==
float - No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute SetFloatValue

== Function Description ==
 void Attribute_SetFloatValue(string pName, float flValue) 
Set float value for an entity attribute.
;Example
function CBaseEntity:Attribute_SetFloatValue( pName, flValue ) end
== Parameters ==
Type 	Name 	Description
string	pName 	No Description Set
float 	flValue	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute SetIntValue

== Function Description ==
 void Attribute_SetIntValue(string pName, int nValue) 
Set int value for an entity attribute.
;Example
function CBaseEntity:Attribute_SetIntValue( pName, nValue ) end
== Parameters ==
Type 	Name 	Description
string	pName 	No Description Set
int 	nValue	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EmitSoundParams

== Function Description ==
 void EmitSoundParams(string soundName, int pitch, float volume, float soundTime) 
Plays/modifies a sound from this entity. changes sound if Pitch and/or Volume or SoundTime is > 0.
== Parameters ==
Type 	Name 	Description
string	soundName	No Description Set
int 	pitch 	No Description Set
float 	volume 	No Description Set
float 	soundTime	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GatherCriteria

== Function Description ==
 void GatherCriteria(handle hResult) 
Returns a table containing the criteria that would be used for response queries on this entity. This is the same as the table that is passed to response rule script function callbacks.
== Parameters ==
Type 	Name 	Description
handle	hResult	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetContext

== Function Description ==
 table GetContext(string name) 
GetContext( name ): looks up a context and returns it if available. May return string, float, or nil (if the context isn't found)
== Parameters ==
Type 	Name	Description
string	name	No Description Set
== Returns ==
table - No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetSoundDuration

== Function Description ==
 float GetSoundDuration(string soundName, string actormodelname) 
Returns float duration of the sound. Takes soundname and optional actormodelname.
== Parameters ==
Type 	Name 	Description
string	soundName 	No Description Set
string	actormodelname	No Description Set
== Returns ==
float - No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetTeam

== Function Description ==
 int GetTeam() 
Returns the entity's team.
;Example
--Get player's team
playerHero = PlayerResource:GetPlayer(1):GetAssignedHero()
local team = PlayerHero:GetTeam()
== Returns ==
int - entity's team.
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.HasAttribute

== Function Description ==
 bool HasAttribute(string pName) 
See if an entity has a particular attribute.
;Example
function CBaseEntity:HasAttribute( pName ) end
== Parameters ==
Type 	Name 	Description
string	pName	No Description Set
== Returns ==
bool - No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.RemoveEffects

== Function Description ==
 void RemoveEffects(int nFlags) 
RemoveEffects( int ): Removes the render effect flag.
;Example
function CBaseEntity:RemoveEffects( nFlags ) end
== Parameters ==
Type	Name 	Description
int 	nFlags	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAngles

== Function Description ==
 void SetAngles(float pitch, float yaw, float roll) 
Set entity pitch, yaw, roll
Does not work on units where baseclass is npc_dota_tower
== Parameters ==
Type 	Name 	Description
float	pitch	No Description Set
float	yaw 	No Description Set
float	roll 	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAngularVelocity

== Function Description ==
 void SetAngularVelocity(float pitch, float yaw, float roll) 
Set the local angular velocity - takes float pitch,yaw,roll velocities
== Parameters ==
Type 	Name 	Description
float	pitch	No Description Set
float	yaw 	No Description Set
float	roll 	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContext

== Function Description ==
 void SetContext(string pName, string pValue, float duration) 
SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a string. Will last for duration (set 0 to mean 'forever').
== Parameters ==
Type 	Name 	Description
string	pName 	No Description Set
string	pValue 	No Description Set
float 	duration	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContextNum

== Function Description ==
 void SetContextNum(string pName, float fValue, float duration) 
SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a number (int or float). Will last for duration (set 0 to mean 'forever').
== Parameters ==
Type 	Name 	Description
string	pName 	No Description Set
float 	fValue 	No Description Set
float 	duration	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContextThink

== Function Description ==
 void SetContextThink(string pszContextName, handle hThinkFunc, float flInterval) 
Set a think function on this entity.
== Parameters ==
Type 	Name 	Description
string	pszContextName	No Description Set
handle	hThinkFunc 	No Description Set
float 	flInterval 	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetParent

== Function Description ==
 void SetParent(handle hParent, string pAttachmentname) 
Set the parent for this entity.
== Parameters ==
Type 	Name 	Description
handle	hParent 	No Description Set
string	pAttachmentname	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetRenderColor

== Function Description ==
 void SetRenderColor(int a, int b, int c) 
SetRenderColor( r, g, b ): Sets the render color of the entity.
== Parameters ==
Type	Name	Description
int 	a 	No Description Set
int 	b 	No Description Set
int 	c 	No Description Set
Category:Dota2Function
Category:CBaseEntity
Dota 2 Workshop Tools/Scripting/API/CBaseFlex.GetSceneByIndex

== Function Description ==
 handle GetSceneByIndex(int index) 
Returns the instance of the scene entity at the specified index.
== Parameters ==
Type	Name 	Description
int 	index	No Description Set
== Returns ==
handle - No Description Set
Category:Dota2Function
Category:CBaseFlex
Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetLightGroup

== Function Description ==
 void SetLightGroup(string pLightGroup) 
SetLightGroup( string ): Sets the light group of the entity.
;Example
function CBaseModelEntity:SetLightGroup( pLightGroup ) end
== Parameters ==
Type 	Name 	Description
string	pLightGroup	No Description Set
Category:Dota2Function
Category:CBaseModelEntity
Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetRenderColor

== Function Description ==
 void SetRenderColor(int r, int g, int b) 
SetRenderColor( r, g, b ): Sets the render color of the entity.
;Example
function CBaseModelEntity:SetRenderColor( r, g, b ) end
== Parameters ==
Type	Name	Description
int 	r 	No Description Set
int 	g 	No Description Set
int 	b 	No Description Set
Category:Dota2Function
Category:CBaseModelEntity
Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetRenderMode

== Function Description ==
 void SetRenderMode(int nMode) 
SetRenderMode( int ): Sets the render mode of the entity.
;Example
function CBaseModelEntity:SetRenderMode( nMode ) end
== Parameters ==
Type	Name 	Description
int 	nMode	No Description Set
Category:Dota2Function
Category:CBaseModelEntity
Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetSize

== Function Description ==
 void SetSize(Vector mins, Vector maxs) 
''''
;Example
function CBaseModelEntity:SetSize( mins, maxs ) end
== Parameters ==
Type 	Name	Description
Vector	mins	No Description Set
Vector	maxs	No Description Set
Category:Dota2Function
Category:CBaseModelEntity
Dota 2 Workshop Tools/Scripting/API/CBasePlayer.IsSteamControllerButtonPressed

== Function Description ==
 bool IsSteamControllerButtonPressed(int nControllerNumber, int nButton) 
Returns true if the controller button is pressed.
;Example
function CBasePlayer:IsSteamControllerButtonPressed( nControllerNumber, nButton ) end
== Parameters ==
Type	Name 	Description
int 	nControllerNumber	No Description Set
int 	nButton 	No Description Set
== Returns ==
bool - No Description Set
Category:Dota2Function
Category:CBasePlayer