1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Need help with a GUI spell

Discussion in 'Triggers & Scripts' started by daggoth, Jan 7, 2007.

  1. daggoth

    daggoth

    Joined:
    Dec 31, 2006
    Messages:
    16
    Resources:
    0
    Resources:
    0
    I have a prob about making one of my spells to work. Several errors occure and I have done almost anything to fix them but with no sucsess.

    • haunt
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Haunt
      • Actions
        • Countdown Timer - Start Whatever as a One-shot timer that will expire in 10.00 seconds
        • Wait 1.00 seconds
        • Unit - Hide HauntingUnit
        • Set Whatever = (Last started timer)
        • Set DyingHauntedUnit = (Dying unit)
        • Set HauntingUnit = (Casting unit)
        • Set HauntEDUnit = (Target unit of ability being cast)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (HauntEDUnit is alive) Equal to True
          • Then - Actions
            • Wait until (((HauntEDUnit is dead) Equal to True) or ((Elapsed time for Whatever) Greater than or equal to 9.50)), checking every 0.50 seconds
            • Unit - Move HauntingUnit instantly to (Position of HauntEDUnit)
            • Unit - Unhide HauntingUnit
          • Else - Actions
            • Unit - Move HauntingUnit instantly to (Position of DyingHauntedUnit)
            • Unit - Unhide HauntingUnit


    This is the trigger and it think you can figure it out all by yourselves. Anyway the trigger must do the following:
    1)-The casting unit dissapears and the targeted unit starts taking damage from the Shadow Strike (It is the base ability).
    2)-When the suffering creature dies or the duration of the Haunt expires the Casting unit pops out whichever comes first.

    I think it's all good but when I target a unit with this ability it dies instantly or my unit enters his body but it can't get out. I have tested this one several times and I have discovered that if I target a neutal passive unit it dies (Allways) and if I target a neutal hostile unit my unit can't pop out. It just stays there forever. However I doubt that this is the main problem...

    I have also tried to make the controller of casting unit to still have vision of his hidden unit but if I make that I can't even enter the opposing unit.

    Please tell me if there are errors or you have a better idea that works.
     
  2. Xarwin

    Xarwin

    Joined:
    Nov 16, 2006
    Messages:
    2,232
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Tutorials:
    1
    Resources:
    3
    Hmm , try :
    Code (Text):

    haunt
    Events
    Unit - A unit Starts the effect of an ability
    Conditions
    (Ability being cast) Equal to Haunt
    Actions
    Set HauntingUnit = (Casting unit)
    Set HauntEDUnit = (Target unit of ability being cast)
    Countdown Timer - Start Whatever as a One-shot timer that will expire in 10.00 seconds
    Set Whatever = (Last started timer)
    Wait 1.00 seconds
    Unit - Hide HauntingUnit
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    (HauntEDUnit is alive) Equal to True
    Then - Actions
    Wait until (((HauntEDUnit is dead) Equal to True) or ((Elapsed time for Whatever) Greater than or equal to 9.50)), checking every 0.50 seconds
    Unit - Move HauntingUnit instantly to (Position of HauntEDUnit)
    Unit - Unhide HauntingUnit
    Else - Actions
    Unit - Move HauntingUnit instantly to (Position of HauntEDUnit)
    Unit - Unhide HauntingUnit
     
    Never set variables after a wait. Lets say, the wait resets (the units that have an action) it in a way.

    Code (Text):
    Set DyingHauntedUnit = (Dying unit) // Why is this needed anyway?
    There is no dying unit.
     
  3. Orc_Tamer

    Orc_Tamer

    Joined:
    Jan 5, 2007
    Messages:
    41
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Here is a leak check for you.

    ------------------
    Total lines: 22

    Location Leak Detection ON
    Unit Group Leak Detection ON
    Special Effect Leak Detection ON
    Variable Removal Detection ON

    (Line: 18 ) (Word: 7 ) Position Leak
    Unit - Move HauntingUnit instantly to (Position of HauntEDUnit)
    Unit - Move HauntingUnit instantly to ^Leak
    (Suggested fix) Set L = (Position of HauntEDUnit)
    (Suggested fix) Unit - Move HauntingUnit instantly to L
    (Suggested fix) Custom Script: call RemoveLocation(udg_L)

    (Line: 21 ) (Word: 7 ) Position Leak
    Unit - Move HauntingUnit instantly to (Position of HauntEDUnit)
    Unit - Move HauntingUnit instantly to ^Leak
    (Suggested fix) Set L = (Position of HauntEDUnit)
    (Suggested fix) Unit - Move HauntingUnit instantly to L
    (Suggested fix) Custom Script: call RemoveLocation(udg_L)

    Group variable has not been removed: Whatever

    Completed
    Total amount of leaks: 2
    Leak Rating: Good
    ------------------

    -Orc_Tamer
     
    Last edited: Jan 7, 2007
  4. daggoth

    daggoth

    Joined:
    Dec 31, 2006
    Messages:
    16
    Resources:
    0
    Resources:
    0
    Fl4meS thanks for the trigger!!! You saved me from my nightmares...

    and OrcTamer i allready have a leakchecker but thanks.
     
  5. Orc_Tamer

    Orc_Tamer

    Joined:
    Jan 5, 2007
    Messages:
    41
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    >OrcTamer i allready have a leakchecker but thanks.

    Then make sure to fix those leaks. :thumbs_up:

    -Orc_Tamer
     
  6. DoOs_101

    DoOs_101

    Joined:
    Aug 7, 2004
    Messages:
    835
    Resources:
    6
    Maps:
    5
    Tutorials:
    1
    Resources:
    6
    Btw if you want to order a unit to target another unit with a custom ability, what is the custom script? The only thing i can do in GUI is to issue that unit to target another unit with the original warcraft III spells...
     
  7. Mini-Me

    Mini-Me

    Joined:
    Oct 30, 2004
    Messages:
    1,800
    Resources:
    10
    Maps:
    10
    Resources:
    10
    You could have done another thread for your question doos, but anyway the answer is simple. You order the unit to cast the spell which your custom spell is based on.
    For example lets say you created a custom spell based on storm bolt, changed all the effects and stuff and renamed it to "throw a rock". Now if you want to order your unit to cast "throw a rock", you issue order it to cast storm bolt.
     
  8. l33t5up4h4x0r

    l33t5up4h4x0r

    Joined:
    Oct 23, 2006
    Messages:
    228
    Resources:
    1
    Maps:
    1
    Resources:
    1
    dies instantly? maybe u set one of the field of shadow strike to zero, that makes the computer deal x amount of damage every infinity seconds.....