• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Building's Mana Shield

Status
Not open for further replies.
Level 6
Joined
Oct 1, 2012
Messages
166
Heloes Hive Workshop

I have a slight problem. As in the topic's name, there's a building in my map which has Mana Shield. The idea is, it gets mana with every kill of his group, so that it, in a manner, gets more hp, as it has Mana Shield. But there's the problem - I can't find the way to activate it. Scripts won't work, setting it active in unit's options on the map wouldn't either and it is a CPU-Controlled building, so a player can't activate it.
The mana shield skill has targets set to 'Building', prevously it had also 'Mechanical' (as this is how it is classified, the building I mean), but it didn't do a thing.
Any ideas, please?
 
Level 6
Joined
Oct 1, 2012
Messages
166
JASS:
function Trig_Co_5_sekund_Actions takes nothing returns nothing
    if UnitHasBuffBJ(udg_Krysztal[0], 'BEar') then
    else
     call IssueImmediateOrderBJ(udg_Krysztal[0], "manashield")
    endif
    if UnitHasBuffBJ(udg_Krysztal[1], 'BEar') then
    else
     call IssueImmediateOrderBJ(udg_Krysztal[1], "manashield")
    endif 
endfunction

//===========================================================================
function InitTrig_Co_5_sekund takes nothing returns nothing
    set gg_trg_Co_5_sekund = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Co_5_sekund, 5.00 )
    call TriggerAddAction( gg_trg_Co_5_sekund, function Trig_Co_5_sekund_Actions )
endfunction


'Co 5 sekund' means 'Every 5 seconds' and 'Krysztal' is 'Crystal', the building meant to use Mana Shield.

What the trigger does is turn on mana shield when the unit doesn not have it. In the beginning it doesn't and further in the game, after losing mana, it can turn it on again when it gets it.

But every time I turn on the map the units have no buff I mean.

'BEar' buff was Trueshot Aura, I don't remember why I changed this one, but it doesn't matter.


@EDIT: @Up: it does, the spell costs no mana anyhow.
 
Level 6
Joined
Oct 1, 2012
Messages
166
In the skill's description it's just "manashield". Anyhow, it doesn't work. I guess the problem is somewhere in unit's stats, but I don't know where.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Have you tried controlling* the building in question? If ever the ability or some unit stats is causing the malfunction, an error message from the game could help you.

I mean setting the owner to your player.
 
Level 6
Joined
Oct 1, 2012
Messages
166
Well, controlling the unit might cast some new light, thanks. I'll see to it as soon as I can.

With the 'manashieldon', thanks for the info, it will be helpful.

100 posts, yay.
 
Level 6
Joined
Oct 1, 2012
Messages
166
Okay, sorry it took so long

I changed the ownership. Whenever I use the mana shield, it works and does it's sound, but the unit gets no buff. The cooldown starts normally, but, as simple as that, the building gets nothing.

Any ideas?
 
Level 6
Joined
Oct 1, 2012
Messages
166
I set 'Is building' in my unit's stats to FALSE and the buff works. I guess it won't matter that much, since it's still targetted as 'Building', am I right?

Anyhow, the buff works as it should but for the animation. The effect of the shield looks like Big Bad Vodoo, but the building, albeit having a buff, has no visual effect.

When I gave it to the unit, everything was great. But it is not for the building.
Help?

@EDIT: No animation is due to the model being Power Generator. When I changed the model, everything worked... I'll find something else.

Still, as it seems, Mana Shield doesn't work on buildings. That's all, I believe, the topic's solverd.

Thanks all for help :)
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Oh sorry then, Wrathion.
EDIT:
what does this @_@ mean?
EDIT: removed map, not helpful lol.
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
Y-yes it can, Big Bad Voodoo affects it. (I heard((it has a different range other than AoE for buildings)))

@_@ means something like o_O or like that.

EDIT: Or something weird(?)

I mean SELF BUFFS dude it will not work in their own buffed bulding, the building has a buff because of the source Units not in their own :3.
 
Level 23
Joined
Oct 12, 2008
Messages
1,783
Actually, now that I think about it. The answer was very simple all along.
- You are checking if the building has buffs.
- Buildings don't show buffs by default
- Go to Gameplay Constants set buildings show buffs to on.
 
Level 6
Joined
Oct 1, 2012
Messages
166
Actually, now that I think about it. The answer was very simple all along.
- You are checking if the building has buffs.
- Buildings don't show buffs by default
- Go to Gameplay Constants set buildings show buffs to on.

O.O
Heck, it works.

I dun't know what 'Is a building' in unit's stats does, but I changed it back and, with your help, pretty much everything is great.
Thanks very much, the whole topic was very helpful!
 
Level 23
Joined
Oct 12, 2008
Messages
1,783
Is a building

- Its enables a unit to be upgraded
- Its disables buff displays, doesn't mean the effect of the buff is negated. It juts doesn't show.
- Enables a unit to train other units
- Enables Ground Texture and pathing texture
- Enables the unit to have a minimap icon (Neutral only)

Theres definitely more, these are all I can remember off the top of my head.
 
Status
Not open for further replies.
Top