• 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.

[GUI] Array problem...

Status
Not open for further replies.
Level 17
Joined
Jul 1, 2010
Messages
720
I have a problem. I created a spell based of the Flame Strike ability and basically what I want is when I cast it all the enemy units in the area will be added to a unit group and have a special effect added to them. I'm good so far but how would I do if I wanted after 6 seconds for example to remove the special effects ? Can anyone explain how to do that with arrays ? or what ?
And also I set my spell radius to 200 but when I use "Units within 200 of Target point of ability being cast" it doesn't pick exactly all units...Am I doing something wrong ?
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
I have a problem. I created a spell based of the Flame Strike ability and basically what I want is when I cast it all the enemy units in the area will be added to a unit group and have a special effect added to them. I'm good so far but how would I do if I wanted after 6 seconds for example to remove the special effects ? Can anyone explain how to do that with arrays ? or what ?

What special effect are you using?

And also I set my spell radius to 200 but when I use "Units within 200 of Target point of ability being cast" it doesn't pick exactly all units...Am I doing something wrong ?

The AoE of a spell is the radius of the circle. For example, if you set the AoE of Flamstrike to 200 then the radius of the targeting circle will be 200 units (i.e. you aren't doing anything wrong). However, your trigger will leak. You must have it like this:

  • Flamestrike
    • Events
      • Unit starts the effect of an ability
    • Conditions
      • Ability being cast equal to [your ability]
    • Actions
      • Set Temp_Point = Target point of ability being cast
      • Set Temp_Unit_Group = Unit within 200 range of Temp_Point...
      • Unit Group - Pick all units in Temp_Unit_Group and do actions
        • [your actions]
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_Unit_Group)
Need more help? Feel free to ask!

- Mr_Bean
 
Level 17
Joined
Jul 1, 2010
Messages
720
What special effect are you using?

I'm just using the Freezing Breath effect. I don't think it matters which...

Well I've modified the spell but the problem is that when I cast the spell it lags and my computer stops responding. I think it leaks but I don't know where...

This is when I cast the spell:

View attachment 105046

This is the effect of casting the spell:

View attachment 105047

my dummy caster unit is based off the wisp...no model, no collision..0.10 size, I don't know what's wrong...everytime I make a spell like this it leaks...please correct it if you know how :)
 
Last edited:
Level 17
Joined
Feb 11, 2011
Messages
1,860
I don't know why you are doing it in two separate triggers. Do you want the 1.33 second wait? Try this:

  • Freezing Field
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Freezing Field
    • Actions
      • Set FreezingField_Caster = (Triggering unit)
      • Wait 1.33 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (FreezingField_Caster is alive) Equal to True
        • Then - Actions
          • Set Temp_Point = (Target point of ability being cast)
          • Set FreezingField_TargetGroup = (Units within 250.00 of Temp_Point matching .....
          • Custom script: call RemoveLocation(udg_Temp_Point)
          • Unit Group - Pick every unit in FreezingField_TargetGroup and do (Actions)
            • Loop - Actions
              • Set Temp_Point = (Position of (Picked unit))
              • Unit - Create 1 Dummy Caster for (Owner of (FreezingField_Caster)) at Temp_Point facing Default building facing degrees
              • Unit - Add Frost Nova to (Last created unit)
              • Unit - Order (Last created unit) to Undead Lich - Frost Nova (Picked unit)
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation(udg_Temp_Point)
          • Custom script: call DestroyGroup(udg_FreezingField_TargetGroup)
        • Else - Actions
          • Set FreezingField_Caster = No unit


Also:
Make sure the mana cost of Frost Nova is set to 0.

- Mr_Bean
 
Level 17
Joined
Jul 1, 2010
Messages
720
Sorry to say it still lags...don't know why...I did EXACTLY as you told me...could it be because of my dummy caster unit ?
as I said it's off the wisp unit, model is (.mdl), no collision size, size is 0.10, abilities (invulnerable, locust), starting mana 5000, max mana 5000, mana reg. 5
 
@Chucky You have to preload dummy units.
  • init
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set p = (Center of (Playable map area))
      • Unit - Create 1 Dummy Caster for (Player 1 (Red)) at p facing Default building facing degrees
      • Unit - Add Frost Nova to (Last created unit)
      • Unit - Remove (Last created unit)
      • Custom script: call RemoveLocation(udg_p)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
@Mr_Bean987 I know that wait is needed for smooth effect - but it makes spell not MUI. Locals can help you here (so you don't have to create additional trigger):
  • Freezing Field
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Freezing Field
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local real x = GetSpellTargetX()
      • Custom script: local real y = GetSpellTargetY()
      • Wait 1.33 seconds
      • Custom script: if not GetWidgetLife(u) < 0.405 then
      • Custom script: set udg_Temp_Point = Location(x, y)
      • Custom script: set udg_FreezingField_Caster = u
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 250.00 of Temp_Point matching ..... and do (Actions)
        • Loop - Actions
          • Set p = (Position of (Picked unit))
          • Unit - Create 1 Dummy Caster for (Owner of (FreezingField_Caster)) at p facing Default building facing degrees
          • Unit - Add Frost Nova to (Last created unit)
          • Unit - Order (Last created unit) to Undead Lich - Frost Nova (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_p)
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: endif
      • Custom script: set u = null
 
Last edited:
Level 17
Joined
Feb 11, 2011
Messages
1,860
Sorry to say it still lags...don't know why...I did EXACTLY as you told me...could it be because of my dummy caster unit ?
as I said it's off the wisp unit, model is (.mdl), no collision size, size is 0.10, abilities (invulnerable, locust), starting mana 5000, max mana 5000, mana reg. 5

Only reasons I can think of:

  • There are lots of units in FreezingField_TargetGroup.
  • You have a slow computer :wink:
I would also set the mana cost of your dummy Frost Nova spell to 0, just because you can. I don't think it has anything to do with the dummy (I base mine off the Peasant :grin:).

Let me know how it goes!

- Mr_Bean

EDIT: @Spinnaker: Should you really load dummy at map initialization? I don't and my maps are lag free...I only do this for custom heroes.
 
Level 17
Joined
Jul 1, 2010
Messages
720
hmm I don't think my computer is slow for Warcraft 3...2 CPUS at 2.4, Nvidia GForce 9500 GT at 512 mb, 1 GB RAM...
and no...I just tried the spell with 3 units...It usually starts to lag after at the 3-rd cast...say I cast now , again and after this it lags for 3 seconds or more and then it's ok but I don't need that :))

Damn spells...I'm making a campaign and I really need some custom spells :(
 
Level 17
Joined
Jul 1, 2010
Messages
720
yes I've read thank you...I'll try it now...I just don't understand why is happening to my spells. I looked over some other people's spells and they work fine and are made just like mine without preloading :|

btw...Chunky ? =))
 
Last edited by a moderator:
Level 17
Joined
Jul 1, 2010
Messages
720
well I found out the problem...it was because of the flame strike ability...I just replaced it with another one and it doesn't lag anymore...the problem is that my spell required the flame strike...:( I wanted to be damage detectable (for example when you cast a spell on a unit he attacks you back but with this they just run in random directions cause they don't know who cast the spell since the dummy unit is invulnerable) bummer
 
Status
Not open for further replies.
Top