Dota 2 Workshop Tools/Scripting/API/ProjectileManager.CreateTrackingProjectile

From Valve Developer Community
< Dota 2 Workshop Tools‎ | Scripting‎ | API
Revision as of 07:28, 17 July 2015 by Igo95862 (talk | contribs) (The example was for linear projectile)
Jump to: navigation, search
Note.png Note:  This page is automatically generated. Any changes may be overwritten

Function Description

void CreateTrackingProjectile(handle handle_1)

Creates a tracking projectile

Table Inputs: Ability, Source, Target, EffectName, iMoveSpeed, vSourceLoc, iSourceAttachment, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bDodgeable, bIsAttack, bVisibleToEnemies, bReplaceExisting, flExpireTime


Example
--Create a tracking projectile from player 1 that follows player 2

local caster = PlayerResource:GetPlayer(0):GetAssignedHero()
local target = PlayerResource:GetPlayer(1):GetAssignedHero()


local info = 
{
	Target = target,
	Source = caster,
	Ability = caster:GetAbilityByIndex(0),	
	EffectName = "some_particle_effect",
	vSourceLoc= caster:GetAbsOrigin(),
	bDrawsOnMinimap = false, 
        bDodgeable = true,
        bIsAttack = false, 
        bVisibleToEnemies = true,
        bReplaceExisting = false,
        flExpireTime = GameRules:GetGameTime() + 10,
	bProvidesVision = true,
	iVisionRadius = 400,
	iVisionTeamNumber = caster:GetTeamNumber()
}
projectile = ProjectileManager:CreateTrackingProjectile(info)

Parameters

Type Name Description
handle handle_1 No Description Set