#Observer Ward Placement Particles

1 messages · Page 1 of 1 (latest)

meager barn
#

So, trying to create a custom obs ward for a game and have it work similarly to the normal dota obs ward, particularly with placement where it shows you the overlay with what kind of vision you'll get.

I've read through this a bunch of times: https://moddota.com/scripting/particle-attachment/#3-control-points

And then have been looking off of this since Bramble Maze has a similar style of targeting (placement under the mouse cursor): https://github.com/Elfansoer/dota-2-lua-abilities/blob/master/scripts/vscripts/lua_abilities/dark_willow_bramble_maze_lua/dark_willow_bramble_maze_lua.lua

I'm having a really hard time understanding what the Control Points are actually doing, or which ones I need to be working with though.

I'm using particles/ui_mouseactions/range_finder_generic_ward_aoe.vpcf (and made sure to precache it)

I can see things lighting up in the left pane the preview (see attached image)

But something seems like it's just not clicking for me, I feel like I'm just doing guess and check and not connecting the dots. I've got it to the point where the obs ward transparency shows up under the mouse, but it also doesn't go away if you cancel the cast (it just becomes an artifact on the battlefield). The vision display is just completely missing (i.e. there's normally a blue transparency that shows you what sort of vision you'll be getting/if it's blocked by trees). But also I'm not really understanding what the different control points are even doing or how to tell what I should be feeding them.

(message too long so I'll post the code snippet below)

GitHub

A repository for creating Dota 2 Lua abilities. Contribute to Elfansoer/dota-2-lua-abilities development by creating an account on GitHub.

#
function item_eye_of_argus:CastFilterResultLocation(vLoc)
    if IsClient() then
        if self.custom_indicator then
            -- register cursor position
            self.custom_indicator:Register( vLoc )
        end
    end

    return UF_SUCCESS
end

function item_eye_of_argus:CreateCustomIndicator()
    local particle = "particles/ui_mouseactions/range_finder_generic_ward_aoe.vpcf"
    local radius = self:GetSpecialValueFor("vision_range")
    self.effect_indicator = ParticleManager:CreateParticle( particle, PATTACH_CUSTOMORIGIN, self:GetCaster())
    ParticleManager:SetParticleControl( self.effect_indicator, 0, Vector( radius, radius, radius ) )
    ParticleManager:SetParticleControl( self.effect_indicator, 1, Vector( radius, radius, radius ) )
    ParticleManager:SetParticleControl( self.effect_indicator, 2, Vector( radius, radius, radius ) )
end

function item_eye_of_argus:UpdateCustomIndicator( loc )
    -- update particle position
    ParticleManager:SetParticleControl( self.effect_indicator, 0, loc )
    ParticleManager:SetParticleControl( self.effect_indicator, 1, loc )
    ParticleManager:SetParticleControl( self.effect_indicator, 2, loc )
end

function item_eye_of_argus:DestroyCustomIndicator()
    -- destroy particle
    ParticleManager:DestroyParticle( self.effect_indicator, false )
    ParticleManager:ReleaseParticleIndex( self.effect_indicator )
end

function item_eye_of_argus:GetIntrinsicModifierName()
    return "modifier_generic_custom_indicator"
end
prisma dagger
meager barn
#

ooh nice, I'll check that out now. I searched github for usage of the particle I was working with and found nothing, but this looks promising

proper halo
#

just a word of warning: the blue transparent effect is not a particle, but rather a custom shader that only Valve has access/proper use of, so you won't be able to use that in a custom way if you hoped to

meager barn
#

hm, so is it probably better to just override item_ward_observer and tweak the things I want to in it rather than trying to implement a custom version?

#

because I was concerned about that from the start, since I figured a particle wouldn't be able to calculate fog of war like that on its own without some heavy calculations somewhere server side