[Divination] Need checked for leaks.

Haxxors

New Member
Reaction score
1
I'm a fairly big noob at map making, and I just created my first GUI custom spell.

I'd post the map its on but I dont want to waste your time with a spell that may have leaks. I'm going to post the Trigger so you can tell me if there are leaks and I will quickly fix them so that I may post the spell for others to use :D

The spell works like this -

The unit that is casted on become invulnerable for 10 seconds, and then once the 10 seconds runs out, allies within 900 of the unit heal for 400.

It works fine in game, i'm just worried that there may be some leaks since im so new at this :O

Thank you!

Here is the trigger

Code:
Divination
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Divination 
    Actions
        Set DivinationTarget[12] = (Target unit of ability being cast)
        Set DivinationLoc = (Position of DivinationTarget[12])
        Set DivinationGroup = (Units within 900.00 of (Position of (Target unit of ability being cast)))
        Set Sfx2[12] = (Last created special effect)
        Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
        Unit - Make (Target unit of ability being cast) Invulnerable
        Wait 10.00 game-time seconds
        Special Effect - Destroy Sfx2[12]
        Unit - Make DivinationTarget[12] Vulnerable
        Unit Group - Pick every unit in DivinationGroup and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 400.00)
                Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
                Special Effect - Destroy (Last created special effect)
        Custom script:   call RemoveLocation (udg_DivinationLoc)
        Custom script:   call DestroyGroup (udg_DivinationGroup)

Thanks!
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Use the event Unit - A unit Starts the effect of an ability instead, unless it's a channel spell or something ;)
And also, why this line ?
Code:
Set Sfx2[12] = (Last created special effect)
There is no (Last created special effect) yet, it's supposed to move down 1 line;)

Code:
Set DivinationGroup = (Units within 900.00 of (Position of (Target unit of ability being cast)))
Leaks a position ;)

Code:
Unit - Make (Target unit of ability being cast) Invulnerable
[/code
Use the DivinationTarget[12] variable maybe ;)
 

Flare

Stops copies me!
Reaction score
662
Code:
        Set Sfx2[12] = (Last created special effect)
        Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
Swap those lines around to fix the special effect leak (setting the variable before creating the effect doesn't work :p)

Code:
Position of (Target unit of ability being cast)
Replace that with DivinationLoc

Also, this will leak if more than 1 instance of the spell occur within 10 seconds of one another (due to variables being overwritten).

Also, for future reference, Tutorials & Resources is for submission of completed resources. Requests for help should stick to the main World Editor Help Zone section (unless you are starting a project and are looking for team members, that goes in Member's Projects)

EDIT: Slow Flare is slow... :(
 

Haxxors

New Member
Reaction score
1
Thank you both for the help!

And sorry for posting here. On the main forum it said that this forum was for spells and so I thought I had to put it here even though it wasn't completed!

Thank you again!
 
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