[Spell] Submerge with abilities? (~SOLVED)

deepstrasz

Map Reviewer
Level 62
Joined
Jun 4, 2009
Messages
17,405
I can't seem to make it so that my submerged hero to have any other spells on but the emerge (reverse of submerge).

Is it possible to retain all spells on which are on the unit before using submerge?

Details: I just copied the Lady Vashj unit and set it as Special. Then copied the Myrmidon Submerge spell and edited it so that Vashj and the other Vashj are the units of interest then added the custom Submerge spell to both Vashj units as the other naga units with Submerge have. (as per @Cuore's suggestion)

Thanks and please.
 
Last edited:
Hmm, so you want to use some spells while submerging. Well, this is weird!

I think you can do it by running/templating the intended spell with the triggers (I mean like those spells on the Hive's spells section) using the unit's point not himself. For example, create the special effects like the intended spell and everything it does. Then, damage the area if intended spell has any damaging.

I don't think there are any other ways or I might be wrong.
 

deepstrasz

Map Reviewer
Level 62
Joined
Jun 4, 2009
Messages
17,405
Could you emulate the effect of submerge just by adding an animation tag to your unit (so it looks submerged) and an invisibility effect? This way you'd still be able to use abilities I guess.
How? I need the spell to work on water. From what I remember, Druids of the Talon still can use Faerie Fire when transformed. So can Druids of the Claw use Roar. But, those spells can be cast everywhere while submerge can only be cast while on deep water.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,328
Submerge seems to disable most abilities.
JASS:
UnitMakeAbilityPermanent
does not change that.

You can use a trigger to find out, if there is deep water by checking the pathing:
naval pathing = yes and ground pathing = no
 

deepstrasz

Map Reviewer
Level 62
Joined
Jun 4, 2009
Messages
17,405
You can use a trigger to find out, if there is deep water by checking the pathing:
naval pathing = yes and ground pathing = no
I don't think there's any condition like that in GUI.
There's only terrain type for regions but sadly it does not contain water... and there's pathing on/off for regions of many types of which amphibious type is the only one close to water but still not what I need.
Thanks for the input though.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,328
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set point = (Position of Lady Vashj 0108 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at point of type Walkability is off) Equal to True
          • (Terrain pathing at point of type Floatability is off) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: can submerge
        • Else - Actions
      • Custom script: call RemoveLocation(udg_point)
Boolean comparison -> environment
 
Level 12
Joined
Aug 29, 2012
Messages
508
How? I need the spell to work on water. From what I remember, Druids of the Talon still can use Faerie Fire when transformed. So can Druids of the Claw use Roar. But, those spells can be cast everywhere while submerge can only be cast while on deep water.

My idea was to use a replica of the submerge ability, something that basically makes the unit invisible and appear underwater without actually using the submerge spell per se. That would require a bit of triggering though.
 
Level 13
Joined
Mar 11, 2017
Messages
587
@#ò'!$% jampion's fast!

I used the method he suggested, only I used Amphibious pathability instead of floatability.

Hero submerge is based on metamorphosis.
I didn't disable the submerged form movement for the sake of testing. You won't be able to cast submerge (nor unsubmerge) outside of deep water.

Here's the trigs
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Submerge (Sea Witch)
    • Actions
      • Set PathCheckLoc = (Position of (Casting unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Terrain pathing at PathCheckLoc of type Walkability is off) Equal to True
              • (Terrain pathing at PathCheckLoc of type Amphibious Pathing is off) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: [Herosubmerge] abil...
        • Else - Actions
          • Unit - Order (Casting unit) to Stop
          • Game - Display to (All players) the text: [herosubmerge] abil...
      • Custom script: call RemoveLocation(udg_PathCheckLoc)
The other trigger stub in the map is a leftover, I wanted to check the native IsTerrainPathable(). It is not needed and can be deleted.Stub removed. Map updated

(the size of the map is due to the need to use an imported sea witch with submerge-like Alternate animations. Warseeker made it.)

I beg someone to check that the event I'm using, the "begins channeling", is actually appropriate here.
The idea is to stop the ability from being cast before cooldown and mana are spent, if the terrain pathability is wrong.
 

Attachments

  • submergeNagaHeroesTest.w3x
    145.1 KB · Views: 39
Last edited:

deepstrasz

Map Reviewer
Level 62
Joined
Jun 4, 2009
Messages
17,405
Boolean comparison -> environment
Hmm... didn't see floatability. I have to stop hurrying.

My idea was to use a replica of the submerge ability, something that basically makes the unit invisible and appear underwater without actually using the submerge spell per se. That would require a bit of triggering though.
I thought of that but couldn't get past around the pathing problem. Thanks though.

I used the method he suggested, only I used Amphibious pathability instead of floatability.

Hero submerge is based on metamorphosis.
I didn't disable the submerged form movement for the sake of testing. You won't be able to cast submerge (nor unsubmerge) outside of deep water.
Yeah, I did it on my own based on his idea too using Bear Form. I've checked your map too and you've disabled collision for Vashj :D Actually, I think it's because the alternate form still can walk on ground/terrain.

But, now there's a minor problem :D if the spell doesn't cast due to the stop command, the icon still changes to the turned off phase (emerge/surface) :D Well, I guess I'll have to use one icon for both phases to avoid this like you did with metamorphosis.

EDIT: fixed the icon issue by ordering the hero to cast again and then stop as @Cuore suggested.

Thanks guys!
 
Last edited:

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,328
It would be best, if the ability is not even cast, if you cannot cast it.
If you use any of the cast events, the ability needs to be cast first before we stop it, but we want to disable it from being cast, if you are not in deep water.

You could do:
1. hide the morph ability: button position 0,-11
2. create a new base ability (any normal no target ability will work, e.g. roar)
3. if the player orders this new ability, instead order the hidden morph ability or stop depending on pathing
now the player should no longer be able to morph by himself and you have complete control, if you want the unit to morph

Problems with this method:
the base ability is never used (only ordered), so it has no cooldown and does not reduce your mana
The mana problem can be solved by giving the moprh ability the same mana cost as the base ability
cooldown can probably be solved as well, but it would be more work
 
Level 11
Joined
Jan 2, 2016
Messages
472
The only idea is what i've got is for you to create a dummy unit with the same spells as your unit and give it an ability like thunder clap (no target ability ) which will determine wheter or not the main unit will unsubmerge.So when you submerge your unit a dummy should spawn on top of it, and make the first unit non selectable until the dummy unit cast the thunder clap ability which will trigger the main units unsubmerge ability and at the same time make the main unit selectable.

This is not the best solution cause the only thing i see here is missing is that the cooldown of both units spells wouldn't be in sync. For example if the dummy unit casts a spell and then unsubmerges the main units ability wouldn't be on cooldown.
 
Top