• 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.

Trigger fails to work.

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,986
Hello guys! There I am, making a Lifesteal trigger for my map. Lifesteal should heal the hero for a % of any damage dealt. I make my triggers, but neither the hero gets healed, nor a text message appears.

I'm about to post the triggers, but before that I will explain the variables:

•Lifesteal_Amount - The amount of lifesteal provided by items as a stat.
•Lifesteal_Heal - The amount of health restored by Lifesteal_Amount.

Triggers

Help will be appreciated and rewarded with rep.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
In this calculation:
  • Set Lifesteal_Heal[Lifesteal_Player] = ((Integer(Lifesteal_Amount[Lifesteal_Player])) x (Integer((Damage taken))))
You are losing accuracy.
Instead, you should first multiply Lifesteal_Amount by Damage taken, and then convert to integer.

Currently, anything below 1 (100%) lifesteal is converted to an integer - which becomes 0.
 

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,986
In this calculation:
  • Set Lifesteal_Heal[Lifesteal_Player] = ((Integer(Lifesteal_Amount[Lifesteal_Player])) x (Integer((Damage taken))))
You are losing accuracy.
Instead, you should first multiply Lifesteal_Amount by Damage taken, and then convert to integer.

Currently, anything below 1 (100%) lifesteal is converted to an integer - which becomes 0.

Thanks, it works now, but another problem appeared. I am (Player 1) the only player that gets healed. :/

I think that the system as it is should cause players 2,3,5,6 and 7 to also benefit from it.

Note: Triggers have been updated with the fix.
 

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,986
I don't see any further errors.

In your Lifesteal trigger, use Game - Display message to display Lifesteal_Player, Lifesteal_Heal etc.

You mean that this is MUI? I am not really sure, but MUI means that a trigger works for more than 1 player, right. What I currently want to achieve..

But it doesn't work for others aside from me, sadly :/
 

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,986
MUI = works for multiple units
MPI = works for multiple players

Judging by your triggers, it should work for more than one player.

The reason I suggested that you display game messages is to see if the values are being set properly, so that we can narrow down where exactly the error is.

This helped indeed. The problem was that I modified the other heroes inventories in the world editor, but as you can see in the trigger Reapers Sword Acc, the unit must accquire the item in order to get its Lifesteal_Amount modification. That was it. Thanks for your help, +rep!
 
Status
Not open for further replies.
Top