Dota 2 Workshop Tools/Scripting/API/ProjectileManager.CreateLinearProjectile: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
		
		
		
		Jump to navigation
		Jump to search
		RoyAwesome (talk | contribs)  (Dota_Lebot push: Updated Page)  | 
				Thunder4ik (talk | contribs)  m (clean up, added deadend tag)  | 
				||
| Line 1: | Line 1: | ||
{{Dead end|date=January 2024}}  | |||
{{Note | This page is automatically generated.  Any changes may be overwritten}}  | {{Note | This page is automatically generated.  Any changes may be overwritten}}  | ||
== Function Description ==  | == Function Description ==  | ||
''' int CreateLinearProjectile(table ''infoTable'') '''  | ''' int CreateLinearProjectile(table ''infoTable'') '''  | ||
| Line 11: | Line 10: | ||
Table Inputs: Ability, Source, vSpawnOrigin, vVelocity, vAcceleration, fDistance, fStartRadius, fEndRadius, bHasFrontalCone, iUnitTargetTeam, iUnitTargetType, iUnitTargetFlags, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bVisibleToEnemies, bIgnoreSource,fExpireTime, fMaxSpeed''  | Table Inputs: Ability, Source, vSpawnOrigin, vVelocity, vAcceleration, fDistance, fStartRadius, fEndRadius, bHasFrontalCone, iUnitTargetTeam, iUnitTargetType, iUnitTargetFlags, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bVisibleToEnemies, bIgnoreSource,fExpireTime, fMaxSpeed''  | ||
;Example  | ;Example  | ||
| Line 58: | Line 55: | ||
''int'' - projectile id  | ''int'' - projectile id  | ||
[[Category:Dota2Function]]  | |||
[[Category:ProjectileManager]]  | |||
Latest revision as of 09:00, 21 January 2024
This article has no 
 links to other VDC articles. Please help improve this article by adding links 
 that are relevant to the context within the existing text. 
January 2024
January 2024
Function Description
int CreateLinearProjectile(table infoTable)
Creates a linear projectile and returns the projectile ID
Table Inputs: Ability, Source, vSpawnOrigin, vVelocity, vAcceleration, fDistance, fStartRadius, fEndRadius, bHasFrontalCone, iUnitTargetTeam, iUnitTargetType, iUnitTargetFlags, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bVisibleToEnemies, bIgnoreSource,fExpireTime, fMaxSpeed
- Example
 
--Creates a projectile that will travel 2000 units
function fire_arrow(args)
	local caster = args.caster
	--A Liner Projectile must have a table with projectile info
	local info = 
	{
		Ability = args.ability,
        	EffectName = args.EffectName,
        	vSpawnOrigin = caster:GetAbsOrigin(),
        	fDistance = 2000,
        	fStartRadius = 64,
        	fEndRadius = 64,
        	Source = caster,
        	bHasFrontalCone = false,
        	bReplaceExisting = false,
        	iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
        	iUnitTargetFlags = DOTA_UNIT_TARGET_FLAG_NONE,
        	iUnitTargetType = DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC,
        	fExpireTime = GameRules:GetGameTime() + 10.0,
		bDeleteOnHit = true,
		vVelocity = caster:GetForwardVector() * 1800,
		bProvidesVision = true,
		iVisionRadius = 1000,
		iVisionTeamNumber = caster:GetTeamNumber()
	}
	projectile = ProjectileManager:CreateLinearProjectile(info)
end
Parameters
| Type | Name | Description | 
|---|---|---|
| table | infoTable | No Description Set | 
Returns
int - projectile id