#Lane creep only casting instant spells
1 messages · Page 1 of 1 (latest)
maybe you could give them a modifier with command restricted after issuing the cast order and remove it when they finish
Oh, interesting. I'll try that
No success. I tried adding the comman-restriction modifer immediately after, one frame after, and even tried this:
function modifier_apprentice_command_restricted:CheckState()
return {
[MODIFIER_STATE_COMMAND_RESTRICTED] = self:GetParent():GetCurrentActiveAbility()~=nil,
}
-- if not IsServer() then return end
end
This is the console printout:
npc_dota_creep_lane DOTA_UNIT_ORDER_CAST_NO_TARGET lycan_summon_wolves npc_dota_creep_lane
triggering smartcast ability
Filter result is true
[
OrderType = (8)
AbilityIndex = (1070)
TargetIndex = (570)
UnitIndex = (1066)
]
do they keep walking while command restricted?
Yes
so i guess their movement/attacks dont count as orders then.
do they even have animations for casting ?
you could just root them and use OnSpellStart after a delay
I'll give that a shot
Hm. I disarmed and rooted them immediately after the order was given, but that didn't work either
Someone mentioned that a mode did this successfully recently. Any idea what it was called?
dont know
i said OnSpellStart though, not an order.
instead of trying to do it through orders you could simulate the cast delay, set the target, and directly call OnSpellStart
Oh, I thought that would only work for non-target abilities. Interesting. I'll definitely try that.
Found 1 function for setcursortarget
🇸 CDOTA_BaseNPC:SetCursorTargetingNothing(targetingNothing: bool): nil
Found 3 functions for setcursor
🇸 CDOTA_BaseNPC:SetCursorCastTarget(entity: CDOTA_BaseNPC|nil): nil
🇸 CDOTA_BaseNPC:SetCursorPosition(location: Vector): nil
🇸 CDOTA_BaseNPC:SetCursorTargetingNothing(targetingNothing: bool): nil
1 for each target type
That's working beautifully. Thanks again!
The base class of lane creeps are specially for C++ underlying, they cant receive normal order, try replace their baseclass with 'npc_dota_creature' (but may cause other questions, like they move really slow...
they can receive orders, it just very quickly gets overridden by a new order that doesnt run through the order filter.
I think using the API calls instead of ExecuteOrder circumvents your issue, I remember wrestling with this at some point and fixing it by using the CastSpell calls