• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Spell] Spells added by trigger disappear if unit use robo goblin spell

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2015
Messages
171
Hi, i was making a trigger that will add disabled extra spell as alternate spell when unit learns certain spell and set level of extra spell to level of learned spell. But i want this extra spell to be active when unit use alternate form (Robo Goblin Based Spell) and disabled the learned spell But after i changed my unit form to alternate form, this extra spell just disappear and wont come back when i back to original form. Is there any way to retain this spell? This extra spell is not on unit Ability List on object editor and only given to unit by trigger. So basicly, i wants to have an unit with 2 active spell while in original form then disable active spells from alternate from (extra spell) and 2 active spell while on alternate form but disabling spells from original but changing form with robo goblin will remove my alternate spell
 
Last edited:
You need to make any abilities added by triggers permanent using the appropriate action otherwise they will be lost during morphs such as avatar, metamorphosis, robogoblin, bear form etc.

There is an action along the lines of "make ability permanent for unit", what it is exactly called in GUI I do not know. After adding the abilities to the unit you need to use that on the unit for the abilities you added. The result should be that the abilites are now retained through morphs.
 
I dont recall there being a GUI action for this.

It should be
Call UnitMakeAbilityPermanent(udg_yourUnit, ability id)


Edit: Here is the native, you'd set the boolean permanent to true

JASS:
native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean
 
Last edited:
so, no solution for gui user like me or do u have alternate way to make it permanent?
Unless it's been added in the JNGP then no there's no way to do it in GUI. A custom script line like the following should be pretty easy though:
  • Set YOUR_UNIT_VARIABLE = (Triggering Unit)
  • Set YOUR_ABILITY_VARIABLE = <The spell you want the unit to retain>
  • Custom script: call UnitMakeAbilityPermanent(udg_YOUR_UNIT_VARIABLE, true, udg_YOUR_ABILITY_VARIABLE)
  • -------- Make sure you change the 2 above variable references to "udg_"+<the name of your variable with _ instead of spaces> --------
 
Unless it's been added in the JNGP then no there's no way to do it in GUI. A custom script line like the following should be pretty easy though:
  • Set YOUR_UNIT_VARIABLE = (Triggering Unit)
  • Set YOUR_ABILITY_VARIABLE = <The spell you want the unit to retain>
  • Custom script: call UnitMakeAbilityPermanent(udg_YOUR_UNIT_VARIABLE, true, udg_YOUR_ABILITY_VARIABLE)
  • -------- Make sure you change the 2 above variable references to "udg_"+<the name of your variable with _ instead of spaces> --------

what is jpng?
 
Alternatively, you can add the ability after the transformation is complete. This avoids having to make the added ability permanent with the above Jass native but you might need to add some more conditions and other checks depending on what you're after.

  • Test
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Robo-Goblin
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Tinker
        • Then - Actions
          • Unit - Add Shockwave to (Triggering unit)
        • Else - Actions
          • Unit - Remove Shockwave from (Triggering unit)
 
Alternatively, you can add the ability after the transformation is complete. This avoids having to make the added ability permanent with the above Jass native but you might need to add some more conditions and other checks depending on what you're after.

  • Test
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Robo-Goblin
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Tinker
        • Then - Actions
          • Unit - Add Shockwave to (Triggering unit)
        • Else - Actions
          • Unit - Remove Shockwave from (Triggering unit)

Hi, i just want it to stay permanent and not removing it becuz if i remove it, it will simply reset the alternate form spell which will make the user use the morph spell and spam the alternate spell. but ill try anyone suggestion here and see if its working
 
Status
Not open for further replies.
Back
Top