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

[Spell] Creep stop attacking my unit after a few time.

Status
Not open for further replies.

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
I make a Fire Shield spell that base on Inner Fire. It cause enemy unit to take damage every time it attack or move too close to my unit that has this spell's buff on it. I using 3 trigger (1 heal, one damage the enemy when they attack the unit, one damage the enemy when they are too close to the unit). Here are the trigger:
  • Events
    • Unit - A unit Is attacked
  • Conditions
    • ((Triggering unit) has buff Fire Shield ) Equal to True
  • Actions
    • Set FireShield = (Level of Fire Shield for CastingHero2)
    • Set Damage = (((Real(FireShield)) - 1.00) + 24.00)
    • Unit - Cause CastingHero2 to damage (Attacking unit), dealing Damage damage of attack type Spells and damage type Enhanced
  • Events
    • Time - Every 1.00 seconds of game time
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) has buff Fire Shield ) Equal to True
          • Then - Actions
            • Set Damage = (18.00 + ((Real(FireShield)) x 12.00))
            • Set AOE = (Position of (Picked unit))
            • Unit Group - Pick every unit in (Units within 250.00 of AOE) and do (If ((((Picked unit) is A structure) Equal to True) or ((Owner of (Picked unit)) Equal to (Owner of CastingHero2))) then do (Do nothing) else do (Unit - Cause CastingHero2 to damage (Picked unit), dealing Damage damage of attack type Spells and damage type En
          • Else - Actions
            • Do nothing
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Fire Shield
  • Actions
    • Set CastingHero2 = (Triggering unit)
    • Set Target = (Target unit of ability being cast)
    • Unit - Set life of Target to ((Life of Target) + ((Max life of CastingHero2) / 10.00))
After a few times using this skill and it work really perfect except for 1 thing: THE ENEMY AI CREEP DONT ATTACK MY UNIT ANYMORE. >.<:vw_death:
I cant figure it out. Some one help me plz.:vw_wtf:
 
Level 10
Joined
Jan 20, 2011
Messages
492
Ok so I'm not sure what the problem is, but it has to do with the every 1 second loop, the attack event is fine, it just can be abused, but since it's an enemy won't be abused. Now you have several leaks in your trigger I would suggest using these custom scripts to remove it;
  • Custom Script: call DestroyGroup (udg_UnitGroup)
  • Custom script: set bj_wantDestroyGroup = true
I would not suggest the second one, since it will destroy both groups instantly, so I would set them both to a Unit Group variable array, with UnitGroup as the name

Also read up about this
 
Last edited:

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
I'll try but about "things that leak", I still cant understand it. Can u explain plz? :D
Edit: what trigger do i need to put the custom script into?
Edit 2: This problem only happens with ranged unit (LOL), this is the only thing I discovered when testing ur cript.
 
Last edited:

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
I'm still waiting. Anybody has any ideas about my problem?
I'll repeat my problem again:
I make a Fire Shield spell that base on Inner Fire skill. This skill gives a targeted unit a shield which cause any enemy unit that is too close to the unit or attack it will be damaged. Also the spell heal the targeted unit for 10% of the caster max Hp.
When I testing it, it works fine but suddenly the Ranged Unit (Controlled by AI) which used to attack my unit never order to attack it again. U can see my trigger on the 1st post. If u think it's necessary to have my map to test it, I'll send u.
Waiting for any response. Hope u guys can help me.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
I'm still waiting. Anybody has any ideas about my problem?
I'll repeat my problem again:
I make a Fire Shield spell that base on Inner Fire skill. This skill gives a targeted unit a shield which cause any enemy unit that is too close to the unit or attack it will be damaged. Also the spell heal the targeted unit for 10% of the caster max Hp.
When I testing it, it works fine but suddenly the Ranged Unit (Controlled by AI) which used to attack my unit never order to attack it again. U can see my trigger on the 1st post. If u think it's necessary to have my map to test it, I'll send u.
Waiting for any response. Hope u guys can help me.

yeah, hayaku1412.
that would be better if you want to post your map so we could have a better understanding of what problem you are having since i'm so confused about these things you called "AI" :)

is it either

You are making an AI for your map with AI Editor
or
You called Neutral Hostile as Creep AI
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Here it is. I'm not making an AI for my map and AI is Computer 2 when testing. The Paladin has the skill (Fire Shield) and the enemy is Shadow Shaman.
 
Last edited:
Level 12
Joined
Sep 11, 2011
Messages
1,176
Here it is. I'm not making an AI for my map and AI is Computer 2 when testing. The Paladin has the skill (Fire Shield) and the enemy is Shadow Shaman.

hi, hayaku1412.
i'm back from testing your map and i know exactly what problem you are having right now. the problem doesn't lie on your new spell (i really love your spell).

have you ever played any melee map ? where each time a hero of AI is attacked by any units, they would run, run, run until they're safe and not attacked anymore. now, try to change shadow hunter with any neutral hostile both ranged and melee unit. they shouldn't run and would attack you :)

Note : Place the Neutral Hostiles AWAY from Player Start Location or else it would vanish :)
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Oh, thks so much. I'm just afraid that I have to delete that spell for that bug.
But now, after knowing the problem, how can I fix it?
Also thks for liking my spell. I will soon post a new spells pack on spells trigger. :)
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Oh, thks so much. I'm just afraid that I have to delete that spell for that bug.
But now, after knowing the problem, how can I fix it?
Also thks for liking my spell. I will soon post a new spells pack on spells trigger. :)

go to Object Editor > Search for your enemy (Shadow Hunter) > set the Stats - Can Flee from True to False.

another thing i spotted was
  • Set Damage = (Real(FireShield)) - 1.00) + 24.00
  • Set Damage = (18 + (Real(FireShield)) x 12.00))
you are setting the damage with the same variable which would resulting the variable to replace one after another..
so the damage would be either (Real(FireShield)) - 1.00) + 24.00 or (18 + (Real(FireShield)) x 12.00)).. use different..
variable for each different damage that would be deal at the same time (e.g Damage1, Damage2 or Damage[1], Damage[2])
 
Last edited:
Status
Not open for further replies.
Top