• 🏆 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!

How to make a spell that change you between 2 forms? Like bearform but with different spells

Status
Not open for further replies.
Level 6
Joined
Aug 31, 2018
Messages
157
I used bearform, but when i changed to the other unit, i had all the abilities from both forms. How to fix that?


P. S i am Using same unit but with different weapons and abilities, but when i use bearform i still have the abilities from the first form.
 
Level 39
Joined
Feb 27, 2007
Messages
4,992
If your alternate unit type doesn’t share any abilities with your main unit type, that is expected behavior. Any abilities added through triggers need to have UnitMakeAbilityPermanent called on them to persist through morphing.
 
Level 6
Joined
Aug 31, 2018
Messages
157
If your alternate unit type doesn’t share any abilities with your main unit type, that is expected behavior. Any abilities added through triggers need to have UnitMakeAbilityPermanent called on them to persist through morphing.
How to do that trigger? Can't find it, also i don't even know if its event,condition or action
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
  • Custom script: call UnitMakeAbilityPermanent(udg_MyUnit, true, 'A000')
'A000' is the raw code of a custom ability, to see ability or any object's (units, items, etc.) raw code toggle between ctrl + d on/off on object editor.
 
Level 6
Joined
Aug 31, 2018
Messages
157
  • Custom script: call UnitMakeAbilityPermanent(udg_MyUnit, true, 'A000')
'A000' is the raw code of a custom ability, to see ability or any object's (units, items, etc.) raw code toggle between ctrl + d on/off on object editor.
upload_2020-1-14_11-58-48.png
 
Level 6
Joined
Aug 31, 2018
Messages
157
Raw code of an object isn't a variable, you need to create a unit variable in the variable dialog something like "MyUnit", which in JASS is udg_MyUnit, and you need to put that in the custom script.
upload_2020-1-14_16-52-3.png


Sorry for wasting your time, its just my first time doing custom scripts and triggers like this one.
 
Level 6
Joined
Aug 31, 2018
Messages
157
It needs to be a unit, not unit-type.
Not working
  • Morphin abilities 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Snipe/Knife [W]
    • Actions
      • Custom script: call UnitMakeAbilityPermanent(udg_MyUnit, true, 'A083')
upload_2020-1-14_18-19-54.png

Made it just Unit
 
Level 9
Joined
Jul 30, 2018
Messages
445
Have you set the MyUnit to your unit? Like...

Events
- Map Initilization
Conditions
Actions
- Set MyUnit = Footman 0001 <gen>
- Custom Script: call UnitMakeAbilityPermanent(udg_MyUnit, true, 'A083')

Without that the variable is just an empty variable and it doesn't refer to anything.
 
Level 6
Joined
Aug 31, 2018
Messages
157
Have you set the MyUnit to your unit? Like...

Events
- Map Initilization
Conditions
Actions
- Set MyUnit = Footman 0001 <gen>
- Custom Script: call UnitMakeAbilityPermanent(udg_MyUnit, true, 'A083')

Without that the variable is just an empty variable and it doesn't refer to anything.
Still not working

upload_2020-1-14_18-37-53.png


Even if i put this there
  • (Ability being cast) Equal to Snipe/Knife [W]
 
Level 6
Joined
Aug 31, 2018
Messages
157
Does the unit already have that ability or not?
The original character is with sniper, he got that (snipe/knife) ability which changes him to another coppy of the hero but with knife and different abilities. When it changes to the other character (with the knife) it has only the snipe/knife ability (which is ok) but dont have any of the other abilities
 
Status
Not open for further replies.
Top