Help with a jump ability, replacing unit but not replacing second time!

KvickaN

TH.net Regular
Reaction score
24
Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Replace (Triggering unit) with a Flying Child using The new unit's default life and mana
        Wait 0.02 seconds
        Special Effect - Destroy (Last created special effect)
        Wait 5.00 seconds
        Unit - Replace (Triggering unit) with a Child using The new unit's default life and mana

I'ts not replcaing the flying child with
Code:
Unit - Replace (Triggering unit) with a Child using The new unit's default

please help! :D
 

Romek

Super Moderator
Reaction score
963
Code:
Jump ability

        Unit - Replace (Triggering unit) with a Flying Child using The new unit's default life and mana
        ...
        Unit - Replace (Triggering unit) with a Child using The new unit's default life and mana

I'ts not replcaing the flying child with
Code:
Unit - Replace (Triggering unit) with a Child using The new unit's default

please help! :D


You've already replaced triggering unit with the flying child. So its not there anymore. You cant replace it.
You could replace (last replaced unit). Or set the unit to a variable and replace that.

Edit:
same time Ace :p
 

KvickaN

TH.net Regular
Reaction score
24
That worked fine but now theres another problem...

As the child is replaced the second time the cooldown dissapairs and he can cast "jump" again and go on and on.

Any solutions? :)
 

Romek

Super Moderator
Reaction score
963
O, first time a question has been asked to make an ability have cooldown.
You could base an ability off the jump and make it do NOTHING. Then order the unit to cast it.
Then remove the ability.
It'll start the cooldown. although it might make the child cast jump :S
 

KvickaN

TH.net Regular
Reaction score
24
that will make the child jump ^^

but hm...

Maybe a "Run trigger" and do it in another trigger?

heck ill try that :D thanks

Edit: Thought I knew what you were talking about but I don't... lol!

Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Replace (Triggering unit) with a Flying Child using The new unit's default life and mana
        Wait 1.00 seconds
        Special Effect - Destroy (Last created special effect)
        Wait 5.00 seconds
        Unit - Replace (Last replaced unit) with a Child using The new unit's default life and mana

There is the current one!

Code:
Unit - Reset ability cooldowns for (Triggering unit)

Isn't there an opposite to that trigger? xD
 

vypur85

Hibernate
Reaction score
803
Instead of replacing the unit, you could hide the triggering unit and create the Flying Child dummy there. After 5 secs, remove the dummy and unhide the triggering unit and move the triggering unit instantly to position of dummy unit. The cooldown will be retained this way.

Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Replace (Triggering unit) with a Flying Child using The new unit's default life and mana
        Wait 1.00 seconds
        [B]Special Effect - Destroy (Last created special effect)[/B]
        Wait 5.00 seconds
        Unit - Replace (Last replaced unit) with a Child using The new unit's default life and mana

Destroy the special effect right after it is created. It might not work if it is destroyed after the 'wait'. If you really want to destroy after the wait then set the effect as an variable.
 

KvickaN

TH.net Regular
Reaction score
24
Instead of replacing the unit, you could hide the triggering unit and create the Flying Child dummy there. After 5 secs, remove the dummy and unhide the triggering unit and move the triggering unit instantly to position of dummy unit. The cooldown will be retained this way.

Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Replace (Triggering unit) with a Flying Child using The new unit's default life and mana
        Wait 1.00 seconds
        [B]Special Effect - Destroy (Last created special effect)[/B]
        Wait 5.00 seconds
        Unit - Replace (Last replaced unit) with a Child using The new unit's default life and mana

Destroy the special effect right after it is created. It might not work if it is destroyed after the 'wait'. If you really want to destroy after the wait then set the effect as an variable.

Genius :S +rep my friend!

Edit: Can't rep you need to spread first but I won't forget you ^^ good job!

Here's what I got atm, going to test it out now.

Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Make (Triggering unit) Invulnerable
        Unit - Hide (Triggering unit)
        Unit - Create 1 Flying Child for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
        Wait 0.30 seconds
        Special Effect - Destroy JumpEffect
        Wait 5.00 seconds
        Unit - Remove (Last created unit) from the game
        Unit - Make (Triggering unit) Vulnerable
        Unit - Unhide (Triggering unit)
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Make (Triggering unit) Invulnerable
        Unit - Hide (Triggering unit)
        Unit - Create 1 Flying Child for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
        Wait 0.30 seconds
        Special Effect - Destroy JumpEffect
        Wait 5.00 seconds
        [B]Unit - Remove (Last created unit) from the game[/B]
        Unit - Make (Triggering unit) Vulnerable
        Unit - Unhide (Triggering unit)

if another unit is created at the same time it would use that unit, so use a variable
and then
Code:
Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Hide (Triggering unit)
        Unit - Create 1 Flying Child for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
        Make (LastCreatedUnit) invulnerable
        Set UnitVariable = Last Created Unit
        Wait 0.30 seconds
        Special Effect - Destroy JumpEffect
        Wait 5.00 seconds
        Move (triggering Unit) instantly to (position of (UnitVariable))
        Unit - Remove (Unitvariable) from the game
        Unit - Unhide (Triggering unit)
 

NapaHero

Back from the dead...
Reaction score
43
Genius :S +rep my friend!

Edit: Can't rep you need to spread first but I won't forget you ^^ good job!

Here's what I got atm, going to test it out now.

Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Unit - Make (Triggering unit) Invulnerable
        Unit - Hide (Triggering unit)
        Unit - Create 1 Flying Child for (Triggering Player) at (Position of (Triggering unit)) facing Default building facing degrees
        Wait 0.30 seconds
        Special Effect - Destroy JumpEffect
        Wait 5.00 seconds
        Unit - Remove (Last created unit) from the game
        Unit - Make (Triggering unit) Vulnerable
        Unit - Unhide (Triggering unit)

Just a few fixes in there:

Code:
Jump ability
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Set JumpEffect = (Last created special effect)
        Unit - Make (Triggering unit) Invulnerable
        Unit - Hide (Triggering unit)
        Unit - Create 1 Flying Child for (Owner of (Triggering Unit)) at [B](Position of (Triggering unit))[/B] facing Default building facing degrees
        Unit - Add a 5.00 seconds Generic expiration timer for (Last Created Unit)
        Wait 0.30 seconds
        Special Effect - Destroy JumpEffect
        Unit - Make (Triggering unit) Vulnerable
        Unit - Unhide (Triggering unit)

Good luck with your spell!

Edit: I forgot to tell you. Your trigger leaks.
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
but in your trigger the casting unit would just stand where he casted^^
 

NapaHero

Back from the dead...
Reaction score
43
There (I didn't looked at your trigger :p):

Code:
Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Wait 0.02 seconds
        Sound - Play ChildJump <gen>
        Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
        Set JumpEffect = (Last created special effect)
        Unit - Hide (Triggering unit)
        Unit - Create 1 Flying Child for (Owner of (Triggering Unit)) at [B](Position of (Triggering unit))[/B] facing Default building facing degrees
        Unit - Make (Last Created Unit) invulnerable
        Set UnitVariable = (Last Created Unit)
        Unit - Add a 0.50 seconds Generic expiration timer for (UnitVariable)
        Wait 0.30 seconds
        Special Effect - Destroy JumpEffect
        Move (Triggering Unit) instantly to [B](Position of (UnitVariable))[/B]
        Unit - Unhide (Triggering unit)

Just one thing: This doesn't look like a jump spell.
 

KvickaN

TH.net Regular
Reaction score
24
Just one thing: This doesn't look like a jump spell.

Thanks alot guys...

Oh and if I knew how to make it look like the child jumped I would :D

It's not working... I must do something wrong... :(

Can someone please look at it? It's under "Game Play"
 
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