[Building Helper Upgrade] Adding a particle for channeling

This "upgrade" is specifically for the Building Helper Library. And this is if you want to add a particle effect during the channeling phase of your buildings - i.e. when you upgrade/research/train an ability/unit.

1) Locate the item_apply_modifiers.txt file. Under the "Modifiers" block, you're going to create a new modifier by adding in this code:

        "modifier_research"
        {
            "IsHidden"              "1"
            "OnCreated"
            {
                "AttachEffect"
                {
                    "EffectName"        "particles/bm_custom_particles/bm_particle_research_ring.vpcf"
                    "EffectAttachType"  "follow_origin"
                    "Target"            "TARGET"
                }
            }
        }

You can replace the file path on "EffectName" with any particle you desire. The file path there is to my own custom particle which I created. The thread with how I made that particle can be found here.

2) Locate the file queue.lua. Now you're going to add in the following code to create the particle.

-- Add Research Particle Effect
ApplyModifier(caster, "modifier_research")

You're going to add it at two places: a) after the code "ability_to_channel:SetChanneling(true)" somewhere around line 186. b) again after the code "ability_to_channel:SetChanneling(true)" but this time around line 231. The line location is approximate as I've tweaked my queue.lua codes a little.

3) Now you're going to add the following code to remove the particle (when the channel finishes, or is interrupted).

-- Remove Research Particle Effect
caster:RemoveModifierByName("modifier_research")

You're going to add this at 3 places: a) Below "train_ability:EndChannel(true)" around line 92. b) Below "ability_to_channel:EndChannel(false)" around line 211. c) Below "ability_to_channel:EndChannel(false)" around line 256.

And that's it you're done! Enjoy!

Comments

  • Posts: 1,670

    Lines aren't very relevant anymore, but I will be putting this the next time I reupload the library under a new version

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||