• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spell Help!

Status
Not open for further replies.
Level 16
Joined
Oct 12, 2008
Messages
1,570
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:
 
Level 4
Joined
Aug 9, 2008
Messages
67
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 ^^)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
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!
 

Attachments

  • (1) Ghostly Confusion.w3x
    20.7 KB · Views: 57
Last edited:
Level 16
Joined
Oct 12, 2008
Messages
1,570
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:
Level 4
Joined
Aug 9, 2008
Messages
67
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:
Level 16
Joined
Oct 12, 2008
Messages
1,570
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?)

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:
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
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?
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
The problem is u Cannot index a group !!!! CG_GRoup[NOOOOO!] this could not happen so try a diffrent way..... and u also leak >>>

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)
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
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 ) ^^
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
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 ) ^^

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
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
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 !
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
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 !

How would you suggest doing it instead?
 
Status
Not open for further replies.
Top