Permanently removing an ability

claige

New Member
Reaction score
1
How can I make it so when a unit gains an ability through a trigger, they permanently lose that ability after a certain amount of time. The ability I'm using is reincarnation.

I have tried:

-unit learns a skill (maybe i need to change something here?)

-ability being cast equal to [reincarnation]

-wait 9 seconds
-remove [ability - reincarnation] from [triggering unit]

The trigger for the unit to learn the ability works just fine. However, this one is not removing the ability... any help?
 

dashival

New Member
Reaction score
11
Events -
Unit learns a skill

Conditions -
(Ability Learned) Equal To Reincarnation

Actions -
Wait 9 Seconds
Remove (Reincarnation) from (Learning Unit)

I don't know if the ability remove will work after the wait, but you can try it.
 

claige

New Member
Reaction score
1
Uh, where do I find the [ability learned] condition? Srry for my noobness but I can only find [ability being cast].

Thx....
 

claige

New Member
Reaction score
1
Ok I found where it was, but it still does'nt work. :banghead: I dont think I want my event to be the unit "learns" the ability, but rather the ability is "added" to my hero. Is there a such thing?
 
M

Maximus

Guest
have tried this?
Code:
Events -
Unit learns a skill

Conditions -
(Ability Learned) Equal To Reincarnation

Actions -
custom script:    local ability TempAbility
Wait 9.00 game-time seconds
custom script:    set udg_TempAbility = TempAbility
Remove (TempAbility) from (Triggering Unit)
custom script:    set TempAbility = null
Ability Learned is a conditioin from Hero Skill. (Hero Skill Comparison)
If you use the way mentioned above, you need a variable named TempAbility.
Dunno why people often saids a variable go aways. I used wait on some triggers and it still works. But if you use that way, the ability won't go away.
Remember to use game-time seconds.
 

claige

New Member
Reaction score
1
Thanks Maximus, but my only problem now is I keep errors for the action:

-custom script: set udg_TempAbility = TempAbility

When I enter it exactly as u said, it says "Type Mismatch in Assignment."
Heh, any more help??

Thx a lot
 

Chocobo

White-Flower
Reaction score
409
Code:
Events -
Unit learns a skill

Conditions -
(Ability Learned) Equal To Reincarnation

Actions -
custom script:    local ability [B]udg_[/B]TempAbility
Wait 9.00 game-time seconds
custom script:    set udg_TempAbility = TempAbility
Remove (TempAbility) from (Triggering Unit)
custom script:    set [B]udg_[/B]TempAbility = null

Geeeeee!
 

SFilip

Gone but not forgotten
Reaction score
634
umm
you can't define a local ability that way. abilities, unit types, item types etc. are actually integers. and afaik you can't make them local this way. its worth a try though:
local integer udg_TempAbility
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top