• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] 2 Trigger problems

Status
Not open for further replies.
Level 2
Joined
May 1, 2007
Messages
25
Very simple triggers so why the heck they don't work ? :eekani:

1) Event: Unit - A unit is attacked

Actions: If((Owner of (attacked unit)) Equal to play 1 (Red)) then do (Floating Text - Create floating text that reads (String((Integar((Damage taken))))) above (Attacked unit) with Z offset 0.00, using font size 10.00, color (100.00%,0.00%,0.00%), and 40% transparency

This for some reason just shows "0" when a unit gets hit.

2) I tried to make a system that will make a unit take damage from spells according to attackers intelegence.
this is how I made it:

FIRST TRIGGER

Event: Every 0.01 sec
Actions: Set HeroIntelligence[1] = (Intelligence of Hero[1] (Include Bonuses))

SECOND TRIGGER

Event: A unit finishes casting an ability
Actions: Set CastingTarget = (Target unit of ability being cast)
If ((Ability being cast) Equal to Fire Ball)) then do (Unit - Set life of CastingTarget to ((Life of Casting Target)-(Real(HeroIntelligence[1]x2))))) else (Do nothing)

For some reason this does no damage to the spell target

Can someone help me please ? :witch_doc_sad:


PS: im very sorry I just forgot how to put triggers in the good way
 
Level 2
Joined
May 1, 2007
Messages
25
1) thats only for a specific unit and I want it to be for every unit in my map.

2) Tried and it didn't work :sad:
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
i can help you with the Any Unit takes damage event, ill post it in a short while

Edit : Here it is
  • Events
    • Unit - a unit enters (Playable map area)
  • Conditions
  • Actions
    • If - All Conditions are true then do Then Actions else do Else Actions
      • Conditions
        • ((Entering unit) is in TakesDamageGroup) Equal to False
      • Then
        • Trigger - Add event (Unit - (Entering unit) takes damage)) to YourTriggerThatShowsDamage
        • Unit Group - Add (Entering unit) to TakesDamageGroup
      • Else
i think that should cover it

on the other trigger, try using Unit - Cause CASTER to damage TARGET dealing (Real(HeroIntelligence[1])) with attack type WhateverYouLike and damage type WhateverYouLike

it might not fix your problem though, but it will make the Caster get the Bounty of the Target
 
Status
Not open for further replies.
Top