• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Shielding system help

Status
Not open for further replies.
Level 1
Joined
Apr 8, 2005
Messages
3
I've searched the forms and could not find of a way to create a type of shielding system. As of right now I am using a system based off of mana.
EVENTS
EVENT- a unit is attacked

CONDITIONS
CONDITION- owner of attacked unit equal to Player 1 Red

ACTIONS
CONDITION- attacked unit’s mana greater than 1
Then-
ACTION1- set life of attacked unit to max

ACTION2- set current mana of attacked unit to -1 mana.
Else-
Do Nothing

It does work however it presents some problems. The main problem is the shielded unit only takes 1 damage to mana (i.e. shields). I want the unit to take the attacking units damage to mana (i.e. shields). I can‘t find a way to reference the attacking units damage in the trigger system.
Another problem is spells and abilities use mana, though I can probable work around this I do want the shield amount displayed on each unit. So maybe there is a way of using another resource to cast spells?
Also I know your all probably pretty dang tired of hearing this but I am working on a Starcraft map and this Shielding System is (as you probably guessed by now) for the Protoss. :lol:

I thank you in advance
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Who is max? And "set current mana of attacked unit to -1 mana" actually sets the mana of the unit attacked unit to -1. Atleast how you've written it.

Anyway, isn't this spell already made (turn damage into mana)? Sea Witch's "Mana Shield"? And yes.. Vexorian already made a passive Mana Shield (somehow like protoss but uses mana since there is no energy in Warcraft). Look on his profile and search for this spell.

~Daelin
 
Level 1
Joined
Apr 8, 2005
Messages
3
"set current mana of attacked unit to -1 mana" actually sets the mana of the unit attacked unit to -1. Atleast how you've written it.

Yes I typed it wrong it should read

Set mana of attacked unit to current mana of attacked unit -1

or something but it reduces the value of the mana by 1 it’s under arithmetic. That did work but...

I feel kind of dumb for not thinking about using the mana shield but I got it to work works pretty good too.
I've triggered it so when a Protoss unit is attacked it activates mana shield but only when the unit's mana is greater than 1.
Thanks for the mana shield tip
Also
Who is max?
What do you mean?
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
By max I meant the stuff you mentioned into your own code as max. But whatever... I'm glad you solved the problem.

But your problem is not extremely efficient. I really suggest you try Vexorian's system. The trick to detect the damage is to use the Event - Specific Unit is Damaged (since unfortunately this doesn't work for any unit). So the idea would be to have the event - an unit is attacked and to it you create a local trigger which activates when Attacked Unit is damaged. But this requires JASS so...your solution is much simpler and seems to be working.

~Daelin
 
Status
Not open for further replies.
Top