• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] UnitMakeAbilityPermanent

Status
Not open for further replies.
Level 5
Joined
Feb 5, 2021
Messages
89
Hello again

I have a map where spells are not learned normally and thus picked up by spell books along the way, also i have morphing possibilities
and many of you probably know that the two of those does not go well together.

I have seen alot of people mention the sentence i used as a headline, and even though i have read about 20 pages worth i still have no
clue whatsoever about how i could make it work, i get the whole "Custom Script - call unitmakeabilitypermanent" thing

though even after 4 hours of meticulously typing and testing i cannot seem to make it work, it feels like my brain cannot fathom the concept <3

Please, some big brain buddy help me

what information do you need to make this work?
 
JASS:
native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilCode returns boolean

Curiously, the order of parameters for this native are switched. Try to check if the parameters in your custom script
go like this:

EDIT: Switched the parameters in custom script (was previously (<unit>, <abilCode>, <flag>)).

  • Custom Script - call UnitMakeAbilityPermanent(<unit>, <flag>, <abilCode>)
 
Last edited:
Level 5
Joined
Feb 5, 2021
Messages
89
JASS:
native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilCode returns boolean

Curiously, the order of parameters for this native are switched. Try to check if the parameters in your custom script
go like this:

  • Custom Script - call UnitMakeAbilityPermanent(<unit>, <abilCode>, <flag>)
Thank you for replying to my request :)

And to be fair, i've read that much this far on other sites, but "(<unit>, <abilCode>, <flag>)" this part of the script is something i really cant figure out.

Like, i want it to be something like (Hero Manipulating Item, Codeofability, permanent) but i really have no clue on how to put that in :/
 
Thank you for replying to my request :)

And to be fair, i've read that much this far on other sites, but "(<unit>, <abilCode>, <flag>)" this part of the script is something i really cant figure out.

Like, i want it to be something like (Hero Manipulating Item, Codeofability, permanent) but i really have no clue on how to put that in :/
Those are just placeholders for the values that you'll fill in. For example:

  • Comment - ---- This script makes the ability with the rawcode 'A000' permanent on udg_Unit ----
  • Custom Script - call UnitMakeAbilityPermanent(udg_Unit, true, 'A000')
 
Level 5
Joined
Feb 5, 2021
Messages
89
Those are just placeholders for the values that you'll fill in. For example:

  • Comment - ---- This script makes the ability with the rawcode 'A000' permanent on udg_Unit ----
  • Custom Script - call UnitMakeAbilityPermanent(udg_Unit, true, 'A000')
Yes thank you, luckily i was aware of them being placeholders and i get the last 2 parts now thank you, though i am still quite confused about the unit part.

As far as i can see from the one you placed here does that mean i have to predetermine which unit it should be permanent on or will i be able to make it like previously mentioned something like "Hero Manipulating Item" ?

Again, thank you very much for replying and taking your time to explain this to me, i am very grateful :D
 
Level 5
Joined
Feb 5, 2021
Messages
89
Yes, you can add it for "hero manipulating item" as well, though you need proper events for the call to work.

Would something like

  • Tame Beast
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Learn - Tame Beast
    • Actions
      • Unit - Add Tame Beast to (Triggering unit)

This is my current "learning" trigger, and i would like the "make permanent" thing something that triggers after learning the ability if that could be done somehow? (i dont know how to post those fancy trigger blocks that has previously been sent here :/)


EDIT: Accidentally sent instead of finishing my post.
EDIT2: Thanks Tasyen!
 
Last edited:
i dont know how to post those fancy trigger blocks that has previously been sent here :/
 
Level 5
Joined
Feb 5, 2021
Messages
89
Alright! based on what you have told me i finally managed to make it work! i thank you so very much for helping me get my head around this !

  • Custom Script - call UnitMakeAbilityPermanent(GetTriggerUnit(), true, 'A009')
This does exactly what i need it to do !! :D <3
 
Status
Not open for further replies.
Top