Difference between revisions of "Dota 2 Workshop Tools/Scripting/API/ProjectileManager.CreateTrackingProjectile"

From Valve Developer Community
Jump to: navigation, search
(Dota_Lebot push: Updated Page)
(The example was for linear projectile)
Line 28: Line 28:
 
Ability = caster:GetAbilityByIndex(0),
 
Ability = caster:GetAbilityByIndex(0),
 
EffectName = "some_particle_effect",
 
EffectName = "some_particle_effect",
vSpawnOrigin = caster:GetAbsOrigin(),
+
vSourceLoc= caster:GetAbsOrigin(),
fDistance = 2000,
+
bDrawsOnMinimap = false,  
fStartRadius = 64,
+
        bDodgeable = true,
fEndRadius = 64,
+
        bIsAttack = false,  
bHasFrontalCone = false,
+
        bVisibleToEnemies = true,
bReplaceExisting = false,
+
        bReplaceExisting = false,
iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
+
        flExpireTime = GameRules:GetGameTime() + 10,
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,
 
bProvidesVision = true,
iVisionRadius = 1000,
+
iVisionRadius = 400,
 
iVisionTeamNumber = caster:GetTeamNumber()
 
iVisionTeamNumber = caster:GetTeamNumber()
 
}
 
}
projectile = ProjectileManager:CreateLinearProjectile(info)
+
projectile = ProjectileManager:CreateTrackingProjectile(info)
  
 
</source>
 
</source>

Revision as of 07:28, 17 July 2015

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