• 🏆 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] Problem with toggling skill

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2007
Messages
161
Problem with toggling skill (FIXED)

ok, i need some help with a toggling skill. what i have so far is a skill bassed off of immolation (because it toggles) with all its stats set to 0. what i want this skill to do is increase your attack speed while decreasing your HP by a percent (using Triggers) this is what i have come up with so far:

(currently only working on the decreasing HP part)

  • Fist Fury
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • ((Triggering unit) has buff Fist Fury ) Equal to True
    • Actions
      • Set FistF = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fist Fury (hero) for FistF) Equal to 1
        • Then - Actions
          • Unit - Set life of FistF to ((Life of FistF) x 0.96)
          • Set FistF = No unit
        • Else - Actions
  • -------- and a few more if/thens for the few other levels... --------

the buff is visible on the player while the skill is active but he doesnt lose HP, ive changed the set life to different things like "set life = to 1" and still no luck. any ideas on how to get this to work? thanks for your time.

YO_MA_MA
 
Last edited:
Level 4
Joined
Dec 16, 2007
Messages
134
ok, i need some help with a toggling skill. what i have so far is a skill bassed off of immolation (because it toggles) with all its stats set to 0. what i want this skill to do is increase your attack speed while decreasing your HP by a percent (using Triggers) this is what i have come up with so far:

(currently only working on the decreasing HP part)

  • Fist Fury
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • ((Triggering unit) has buff Fist Fury ) Equal to True
    • Actions
      • Set FistF = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fist Fury (hero) for FistF) Equal to 1
        • Then - Actions
          • Unit - Set life of FistF to ((Life of FistF) [CODE]x[/CODE] 0.96)
          • Set FistF = No unit
        • Else - Actions
  • -------- and a few more if/thens for the few other levels... --------

the buff is visible on the player while the skill is active but he doesnt lose HP, ive changed the set life to different things like "set life = to 1" and still no luck. any ideas on how to get this to work? thanks for your time.

YO_MA_MA

change the x(times) into - (minus)
 
Level 5
Joined
Nov 14, 2007
Messages
161
change the x(times) into - (minus)

  • Unit - Set life of FistF to ((Life of FistF) - ((Life of FistF) x 0.04))
if this is what ur saying, i just tried it and it doesn't work either. in about 6th grade i learned that if you take 100 and multiply by .96 you get 96 (4% less) thats what im wanting to do with this skill. the math on both of these works out the same only less operations, it just isnt changing the health on the unit.
 
Level 4
Joined
Dec 16, 2007
Messages
134
  • Unit - Set life of FistF to ((Life of FistF) - ((Life of FistF) x 0.04))
if this is what ur saying, i just tried it and it doesn't work either. in about 6th grade i learned that if you take 100 and multiply by .96 you get 96 (4% less) thats what im wanting to do with this skill. the math on both of these works out the same only less operations, it just isnt changing the health on the unit.

No what i mean is this :

Code:
Unit - Set life of FistF to ((Life of FistF) - 5
 
Level 5
Joined
Nov 14, 2007
Messages
161
No what i mean is this :

Code:
Unit - Set life of FistF to ((Life of FistF) - 5

ok i re-did the trigger for testing purposes, im not sure whats not linking up here, im thinking its the conditions:

  • Fist Fury Copy
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • ((Triggering unit) has buff Fist Fury ) Equal to True
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 10.00)
      • Camera - Pan camera for (Triggering player) to (Position of (Triggering unit)) over 0.50 seconds
the other is disabled and this is the only one on. i dont get the decrease in hp nor camera move.

im starting to think that it has to do with the buff or something? for the fist fury ability, under buffs, i have Fist Fury as the only one there. in-game i do get the buff and it says "fist fury.. bla bla bla" like you would think
 
Level 5
Joined
Nov 14, 2007
Messages
161
i dont need another buff, and the buff itself wont do anything, i just need it to minus the hp, what is another skill other then immolation that toggles (can activate on/off) it might just have to be with immolation that is the problem
 
Level 4
Joined
Dec 16, 2007
Messages
134
what is another skill other then immolation that toggles (can activate on/off) it might just have to be with immolation that is the problem

Mana Shield = Does not Drains Mana and HP but drains mana when attacked.
 
Level 5
Joined
Nov 14, 2007
Messages
161
Mana Shield = Does not Drains Mana and HP but drains mana when attacked.

im not sure if your understanding what i want. i just want a simple dummy skill that does absolutely nothing except can be toggled like that of immolation. then i want to make a trigger that if the ability is active, lower hp by a percent and give an attack speed buff. if it is de-activated, stop lowering hp and remove the attack speed buff. its relatively simple but it just isnt working out for me. im going to be now, maybe tomorrow ill figure it out. G'night all
 
Level 4
Joined
Dec 16, 2007
Messages
134
im not sure if your understanding what i want. i just want a simple dummy skill that does absolutely nothing except can be toggled like that of immolation. then i want to make a trigger that if the ability is active, lower hp by a percent and give an attack speed buff. if it is de-activated, stop lowering hp and remove the attack speed buff. its relatively simple but it just isnt working out for me. im going to be now, maybe tomorrow ill figure it out. G'night all

I just answered your question on what are other skills that can be activated and deactivated.

Anyways i suggest that you make a trigger that when a unit casts that ability in the event add buff to triggering unit. The buff has an ability that deducts HP. THAT IS ONLY MY SUGGESTION.
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
You guys are all fishing for a fish that doesnt exist. I will now tell you what is wrong with the trigger
  • Fist Fury
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • ((Triggering unit) has buff Fist Fury ) Equal to True
    • Actions
      • Set FistF = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fist Fury (hero) for FistF) Equal to 1
        • Then - Actions
          • Unit - Set life of FistF to ((Life of FistF) x 0.96)
          • Set FistF = No unit
        • Else - Actions
  • -------- and a few more if/thens for the few other levels... --------
You see, (Triggering unit) is a Event Response function, meaning (Triggering unit) is used from whatever Event the trigger has. Now, this trigger has a "Time" event, which doesnt save a (Triggering unit). Let me explain.
  • Events
    • Unit - A unit Starts the effect of an ability
  • Condition
  • Actions
    • Unit - Kill (Triggering unit)
this trigger is started when Any unit casts a spell. This Event saves a (Triggering unit) function because a unit is directly responsable for starting the trigger.
  • Events
    • Time - Every 1.00 seconds of Game-time
  • Conditions
  • Actions
    • Unit - Kill UNITVAR
This trigger is started every 1 second. This Event DOESNT save a (Triggering unit) function because no unit is directly responsable for starting the trigger.


On-Topic, to fix your trigger, try using this one
  • Events
    • Time - Every 1.00 seconds of Game-time
  • Conditions
  • Actions
    • Set TempGroup = (Units in (Playable map area) matching (Unit has Your_Buff Equal to True)
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) x 0.96)
    • Custom script: call DestroyGroup(udg_TempGroup)
1. This trigger doesnt leak
2. TempGroup is a Variable
3. It works :D
 
Level 5
Joined
Nov 14, 2007
Messages
161
thanks guys, i figured it had to do with the condition/event cus it just wasnt starting but i couldnt figure out an event that would pick all players with the buff, ill give it a try when i get home. thx again

EDIT: tested it out, works perfectly now. thank you for spotting my error. +rep
 
Last edited:
Status
Not open for further replies.
Top