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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. 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.

Spell Help!

Discussion in 'Triggers & Scripts' started by Yixx, Jan 4, 2009.

  1. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Hi People,,

    working on a spell again, and i found one problem,
    one BIIG problem: I cant cast it a second time!
    (not even when the first cast is done already!)

    The spell is supposed to cast (in these triggers) 7 ghosts, which run towards the targeted unit,,

    Here are the triggers:
    • GC Cast
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Ghostly Confusion (Neutral Hostile)
      • Actions
        • -------- --------
        • -------- CONSTANTS --------
        • -------- --------
        • Set GC_Spirits = 7
        • Set GC_Range = 500.00
        • Set GC_Color = 30.00
        • Set GC_Transparancy = 50.00
        • -------- --------
        • -------- --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • GC_Integer[1] Equal to 0
          • Then - Actions
            • Trigger - Turn on GC Move <gen>
          • Else - Actions
        • Set GC_Integer[1] = (GC_Integer[1] + 1)
        • Set GC_Integer[2] = (GC_Integer[2] + 1)
        • Set GC_Unit1[GC_Integer[2]] = (Target unit of ability being cast)
        • Set GC_DMG[GC_Integer[2]] = (((Real((Level of (Ability being cast) for (Triggering unit)))) x 2.00) + 19.00)
        • For each (Integer A) from 1 to GC_Spirits, do (Actions)
          • Loop - Actions
            • Set GC_Loc1 = ((Position of (Target unit of ability being cast)) offset by GC_Range towards ((360.00 / (Real(GC_Spirits))) x (Real((Integer A)))) degrees)
            • Unit - Create 1 Ghost Rider for (Owner of (Triggering unit)) at GC_Loc1 facing (Position of (Target unit of ability being cast))
            • Unit Group - Add (Last created unit) to GC_Group1[GC_Integer[2]]
            • Animation - Change (Last created unit)'s vertex coloring to (GC_Color%, GC_Color%, GC_Color%) with 100.00% transparency
            • Custom script: call RemoveLocation(udg_GC_Loc1)
        • Set GC_CurTrans[GC_Integer[2]] = 100.00
        • Set GC_Unit2[GC_Integer[2]] = (Random unit from GC_Group1[GC_Integer[2]])

    • GC Move
      • Events
        • Time - Every 0.05 seconds of game time
      • Conditions
      • Actions
        • For each (Integer GC_Integer[3]) from 1 to GC_Integer[2], do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • GC_Unit1[GC_Integer[3]] Not equal to No unit
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in GC_Group1[GC_Integer[3]]) Greater than 0
                  • Then - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • GC_CurTrans[GC_Integer[3]] Greater than GC_Transparancy
                      • Then - Actions
                        • Set GC_CurTrans[GC_Integer[3]] = (GC_CurTrans[GC_Integer[3]] - 5.00)
                        • Animation - Change GC_Unit2[GC_Integer[3]]'s vertex coloring to (GC_Color%, GC_Color%, GC_Color%) with GC_CurTrans[GC_Integer[3]]% transparency
                      • Else - Actions
                        • Set GC_Loc2[GC_Integer[3]] = ((Position of GC_Unit1[GC_Integer[3]]) offset by GC_Range towards (Facing of GC_Unit2[GC_Integer[3]]) degrees)
                        • Unit Group - Add GC_Unit2[GC_Integer[3]] to GC_Group2[GC_Integer[3]]
                        • Unit Group - Remove GC_Unit2[GC_Integer[3]] from GC_Group1[GC_Integer[3]]
                        • Unit - Order GC_Unit2[GC_Integer[3]] to Move To GC_Loc2[GC_Integer[3]]
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Number of units in GC_Group1[GC_Integer[3]]) Equal to 0
                          • Then - Actions
                            • Set GC_CurTrans[GC_Integer[3]] = GC_Transparancy
                          • Else - Actions
                            • Set GC_CurTrans[GC_Integer[3]] = 100.00
                            • Set GC_Unit2[GC_Integer[3]] = (Random unit from GC_Group1[GC_Integer[3]])
                            • Custom script: call RemoveLocation(udg_GC_Loc2[udg_GC_Integer[3]])
                  • Else - Actions
                • Custom script: set bj_wantDestroyGroup=true
                • Unit Group - Pick every unit in (Units within 100.00 of (Position of GC_Unit2[GC_Integer[3]]) matching (((Owner of (Matching unit)) Equal to (Owner of GC_Unit2[GC_Integer[3]])) and (((Matching unit) belongs to an ally of (Owner of GC_Unit2[GC_Integer[3]])) Equal to True))) and do (Actions)
                  • Loop - Actions
                    • Unit - Cause GC_Unit2[GC_Integer[3]] to damage circular area after 0.00 seconds of radius 100.00 at (Position of GC_Unit2[GC_Integer[3]]), dealing GC_DMG[GC_Integer[3]] damage of attack type Magic and damage type Shadow Strike
                    • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + GC_DMG[GC_Integer[3]])
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in GC_Group1[GC_Integer[3]]) Equal to 0
                    • (Distance between (Position of GC_Unit2[GC_Integer[3]]) and GC_Loc2[GC_Integer[3]]) Less than or equal to 40.00
                  • Then - Actions
                    • Set GC_CurTrans[GC_Integer[3]] = (GC_CurTrans[GC_Integer[3]] + 2.50)
                    • Unit Group - Pick every unit in GC_Group2[GC_Integer[3]] and do (Animation - Change (Picked unit)'s vertex coloring to (GC_Color%, GC_Color%, GC_Color%) with GC_CurTrans[GC_Integer[3]]% transparency)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • GC_CurTrans[GC_Integer[3]] Greater than or equal to 99.00
                      • Then - Actions
                        • Unit Group - Pick every unit in GC_Group2[GC_Integer[3]] and do (Actions)
                          • Loop - Actions
                            • Unit - Remove (Picked unit) from the game
                            • Unit Group - Remove (Picked unit) from GC_Group2[GC_Integer[3]]
                        • Set GC_DMG[GC_Integer[3]] = 0.00
                        • Set GC_CurTrans[GC_Integer[3]] = 100.00
                        • Set GC_Unit1[GC_Integer[3]] = No unit
                        • Set GC_Unit2[GC_Integer[3]] = No unit
                        • Custom script: call RemoveLocation(udg_GC_Loc2[udg_GC_Integer[3]])
                        • Custom script: call DestroyGroup(udg_GC_Group1[udg_GC_Integer[3]])
                        • Custom script: call DestroyGroup(udg_GC_Group2[udg_GC_Integer[3]])
                        • Set GC_Integer[1] = (GC_Integer[1] - 1)
                        • Set GC_Integer[2] = (GC_Integer[2] - 1)
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • GC_Integer[1] Equal to 0
                          • Then - Actions
                            • Set GC_Integer[2] = 0
                            • Trigger - Turn off (This trigger)
                          • Else - Actions
                      • Else - Actions
                  • Else - Actions
              • Else - Actions


    Help is appreciated!

    Yixx,,

    P.S. Click Grollo:razz: please!:cute:
     
  2. D3zmodos

    D3zmodos

    Joined:
    Aug 9, 2008
    Messages:
    66
    Resources:
    0
    Resources:
    0
    Hey, I will take a look at it tomorrow for you, however because it isnt exactly a shor trigger, would it be possible to attach an example map that contains the spell so it is not required for us to create that entire trigger again please.

    (At a glance I say check what GC_integer[1] is with a game action or something, just incase ^^)
     
  3. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    I just read a new post about the difference between DestroyGroup(udg_Var) and ClearGroup(udg_Var),,
    Could it be that?
    But when i try to put a custom script line in it:
    • Custom script: call ClearGroup(udg_GC_Group1[udg_GC_Integer[3]])

    it doesnt work

    EDIT: Now did the same effect with GUI,,
    Other problem: It now is castable more times, but when i cast it, while another one is still active, it wont do anything!
     

    Attached Files:

    Last edited: Jan 4, 2009
  4. Slaydon

    Slaydon

    Joined:
    Jan 6, 2008
    Messages:
    2,432
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Then just add this in the end:
    • Trigger - Turn [U]Off[/U] [U]This Trigger[/U]
    First 1 in the Trigger menu
    If not!

    • Unit - Unlearn Spell: Spell1
    • - - - - - - - - - - - - -
    • Hero - Unlearn spell: Spell1
     
  5. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Hmm? Why adding 'turn off this trigger' in the end? It takes more then 1 time 0.05 seconds to do,, and i already did that (Paladons system with Integers[1], [2] and [3])
     
  6. Slaydon

    Slaydon

    Joined:
    Jan 6, 2008
    Messages:
    2,432
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    then do this in the end:
    • Wait "CASTING TIME"
    • Trigger - Turn off (This Trigger)
     
  7. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Why wait casting time in secs?
     
  8. Slaydon

    Slaydon

    Joined:
    Jan 6, 2008
    Messages:
    2,432
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    i mean, so it can cast it done, and then delete the spell! Get the picture?
     
  9. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Ever heard of MUI?
    More casters need it, so turning off is only usable when there are no casts!
    (that is what Paladons system does perfectly!)
     
  10. Slaydon

    Slaydon

    Joined:
    Jan 6, 2008
    Messages:
    2,432
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Then make it in another If thingy
     
  11. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    it is not the thing that it has to be turned off!!

    The problem is: If one unit casts it, and one else after it immediately, the second cast wont have any effect, it will create the units, but wont make them visible, or order them to move!
    But if you wait until the first cast is over, it WILL work!
     
    Last edited: Jan 5, 2009
  12. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    BUMP,, D3zmodos; Can you help me?
    I attached the map in one of my above posts,,
    Whenever you even try to fix it, please say it!
     
  13. D3zmodos

    D3zmodos

    Joined:
    Aug 9, 2008
    Messages:
    66
    Resources:
    0
    Resources:
    0
    Ye I will try now and update this post (just woke up earlier...Timezones...Im in South Africa :p)

    EDIT #1: Ok well I added a whole lot of messages to show values of variables and it is creating the units but not making them visible (or moving them for that matter) because of the Curtrans variable
    (no I wont be surprised if you know that but still). So from what I have gathered so far it is simply caused by a clash of variables (meaning that the only fix would be either: 1 - use more arrays
    ( like you could have: Integer3[Castnumber x 3] instead of: Integer3[3]) or 2: use JASS for its local variables.

    I will look around more and see if there could be an easier solution (also the knights dont damage the peasant, are they supposed to?)
     
    Last edited: Jan 6, 2009
  14. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Ok,, Thanks for helping me anywayz!

    Using more arrays? (BTW The GC_Integer[1] , [2] and [3] is a system made by Paladon for MUI GUI triggering,,)
    But you mean like adding arrays to more variables?

    P.S. The knights are supposed to do damage yeah, but i already found a solution to that:wink:
     
  15. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    BUMP! Do you know any other way to fix it? Can you please take a good look at it Dezmodos?
    Because i am actually quite proud of the result of this spell :grin:
    And i want to post it here on THW, but not when its not working well, y know?
     
  16. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    The problem is u Cannot index a group !!!! CG_GRoup[NOOOOO!] this could not happen so try a diffrent way..... and u also leak >>>
     
  17. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    What?:cry: NOOO!!
    shitty warcraft WE!! :thumbs_down:

    So that is the whole problem??
    BTW, the spell is still not done,, so not all leaks are done yes,,

    (Can you tell me what leaks anywayz? maybe i didnt see it, or maybe i learn a new leak-thing from you)
     
  18. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    There r many leaks but ur spell is too big to point them out for u I'll tell u what u leak

    Like many many POINT LEAKS ( U use position of hero[|?|] this leaks also position of target point of abililtie being cast leaks too!!! and many other find them urself ) ^^
     
  19. Yixx

    Yixx

    Joined:
    Oct 12, 2008
    Messages:
    1,492
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Ok, but that is not really the point,,
    The point is, why cant i array unitgroups if i have done it already before? :confused:

    I mean, i made some other spell,, which did work with arrayed unit groups
     
  20. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    U can only Array Varibels and also yes the other did work but only for one Unitgroup[1] exampel if u array a unit group to not get hit by other blade wave and a second hero throws his blade they will not get hit by any abilitie when u array them u array them with unit group C_Group[1] is C_Group for the WE so there is no array really for this group !