Problems with point variable

Baltazhar

Active Member
Reaction score
55
I've made a spell based on Death and Decay, so it's an AoE template spell.

I'm not sure if this is even logical/possible, but when I make a
Code:
Set Temp_Point = (Target point of ability being cast)
Would it just, do nothing (since the target is an area and not a point), or should it (cuz it surely doesn't) set the point to center of area?

If this can't even work, cuz of the Area to Point thing, are there any other ways to determine the center of the area of cast ability?

Thx in advance
- Balt
 

Baltazhar

Active Member
Reaction score
55
Okay, that just strikes me odd...

I made a test where I set the point as shown in the code above, and had the camera pan to the point set, and it was somewhere else. In the ability I am making, it's kinda crusial :)

I've checked the trigger to see where it went wrong, and the point didn't get set as it should. I'll recheck and write again..
 

Baltazhar

Active Member
Reaction score
55
Okay, apparently it worked alrdy :nuts: - But +rep anyway Ace :)

I have a new problem with some sliding. I have checked a Sliding Tutorial on this site, without any luck on my current question.

Effect: All units within 300 of Temp_Point gets moved closer to Temp_Point.

I have turned off collision size the for units in question, but that only prevents them from hitting any obstacles, and they are themselves still considered as obstacles? - With this they should ignore eachother and just move closer eventho they're on top of 20 other units?

Posting the code in case anyone wants to inspect the 3 page damn thing :)
Code:
Frozen Core
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Frozen Core 
    Actions
        Set FrozenCoreLumber[(Player number of (Owner of (Casting unit)))] = ((Owner of (Casting unit)) Current lumber)
        Player - Set (Owner of (Casting unit)) Current lumber to 0
        Set FrozenCoreSize1[(Player number of (Owner of (Casting unit)))] = 150.00
        Set FrozenCoreSize2[(Player number of (Owner of (Casting unit)))] = 150.00
        Set FrozenCoreSize3[(Player number of (Owner of (Casting unit)))] = 150.00
        Floating Text - Create floating text that reads (Frozen Core deals  + ((String((FrozenCoreLumber[(Player number of (Owner of (Casting unit)))] x 30))) +  damage!)) above (Casting unit) with Z offset 0.00, using font size 10.00, color (10.00%, 100.00%, 10.00%), and 0.00% transparency
        Floating Text - Show (Last created floating text) for (All players)
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
        Set Temp_Point = (Target point of ability being cast)
        Unit - Create 1 Frozen Core for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
        Set Temp_Group = (Units within 300.00 of Temp_Point matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
        Game - Display to (All players) the text: (Temp_Group:  + (String((Number of units in Temp_Group))))
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Unit - Turn collision for (Picked unit) Off
                Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
                Unit - Set (Picked unit) movement speed to 0.00
        Custom script:   call DestroyGroup (udg_Temp_Group)
        For each (Integer A) from 1 to 60, do (Actions)
            Loop - Actions
                Set FrozenCoreSize1[(Player number of (Owner of (Casting unit)))] = (FrozenCoreSize1[(Player number of (Owner of (Casting unit)))] - 2.00)
                Set FrozenCoreSize2[(Player number of (Owner of (Casting unit)))] = (FrozenCoreSize2[(Player number of (Owner of (Casting unit)))] - 2.00)
                Set FrozenCoreSize3[(Player number of (Owner of (Casting unit)))] = (FrozenCoreSize3[(Player number of (Owner of (Casting unit)))] - 2.00)
                Set Temp_Group = (Units owned by (Owner of (Casting unit)) of type Frozen Core)
                Animation - Change (Random unit from Temp_Group)'s size to (FrozenCoreSize1[(Player number of (Owner of (Casting unit)))]%, FrozenCoreSize2[(Player number of (Owner of (Casting unit)))]%, FrozenCoreSize3[(Player number of (Owner of (Casting unit)))]%) of its original size
                Custom script:   call DestroyGroup (udg_Temp_Group)
                Set Temp_Group = (Units within 300.00 of Temp_Point matching (((Owner of (Matching unit)) is an enemy of (Owner of (Casting unit))) Equal to True))
                Set Temp_Point = (Target point of ability being cast)
                Unit - Move (Picked unit) instantly to ((Center of (Playable map area)) offset by ((Distance between (Position of (Picked unit)) and Temp_Point) - 5.00) towards (Angle from (Position of (Picked unit)) to Temp_Point) degrees), facing Temp_Point
                Custom script:   call RemoveLocation (udg_Temp_Point)
                Custom script:   call DestroyGroup (udg_Temp_Group)
                Wait 0.05 seconds
        Set Temp_Group = (Units within 300.00 of Temp_Point matching (((Owner of (Matching unit)) is an enemy of (Owner of (Casting unit))) Equal to True))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Unit - Cause (Casting unit) to damage (Picked unit), dealing ((Real(((Owner of (Casting unit)) Current lumber))) x 30.00) damage of attack type Spells and damage type Normal
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is dead) Equal to True
                    Then - Actions
                        Set FrozenCoreKill[(Player number of (Owner of (Casting unit)))] = (FrozenCoreKill[(Player number of (Owner of (Casting unit)))] + 1)
                    Else - Actions
                        Unit - Turn collision for (Picked unit) On
                        Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
                        Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
        Custom script:   call DestroyGroup (udg_Temp_Group)
        Set Temp_Group = (Units owned by (Owner of (Casting unit)) of type Frozen Core)
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Unit - Remove (Picked unit) from the game
        Custom script:   call DestroyGroup (udg_Temp_Group)
        Set Temp_Point = (Position of (Casting unit))
        Set Temp_Group = (Units within 500.00 of Temp_Point matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
        For each (Integer A) from 1 to (FrozenCoreKill[(Player number of (Owner of (Casting unit)))] / 3), do (Actions)
            Loop - Actions
                Unit - Create 1 Frozen Core Aftershock for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Undead Lich - Frost Nova (Random unit from Temp_Group)
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Custom script:   call DestroyGroup (udg_Temp_Group)

Hope someone can give a minor pointer...
 

vypur85

Hibernate
Reaction score
803
Code:
        For each (Integer A) from 1 to 60, do (Actions)
            Loop - Actions
                Set FrozenCoreSize1[(Player number of (Owner of (Casting unit)))] = (FrozenCoreSize1[(Player number of (Owner of (Casting unit)))] - 2.00)
                Set FrozenCoreSize2[(Player number of (Owner of (Casting unit)))] = (FrozenCoreSize2[(Player number of (Owner of (Casting unit)))] - 2.00)
                Set FrozenCoreSize3[(Player number of (Owner of (Casting unit)))] = (FrozenCoreSize3[(Player number of (Owner of (Casting unit)))] - 2.00)
                Set Temp_Group = (Units owned by (Owner of (Casting unit)) of type Frozen Core)
                Animation - Change (Random unit from Temp_Group)'s size to (FrozenCoreSize1[(Player number of (Owner of (Casting unit)))]%, FrozenCoreSize2[(Player number of (Owner of (Casting unit)))]%, FrozenCoreSize3[(Player number of (Owner of (Casting unit)))]%) of its original size
                Custom script:   call DestroyGroup (udg_Temp_Group)
                Set Temp_Group = (Units within 300.00 of Temp_Point matching (((Owner of (Matching unit)) is an enemy of (Owner of (Casting unit))) Equal to True))
                Set Temp_Point = (Target point of ability being cast)
                Unit - Move (Picked unit) instantly to ((Center of (Playable map area)) offset by ((Distance between (Position of (Picked unit)) and Temp_Point) - 5.00) towards (Angle from (Position of (Picked unit)) to Temp_Point) degrees), facing Temp_Point
                Custom script:   call RemoveLocation (udg_Temp_Point)
                Custom script:   call DestroyGroup (udg_Temp_Group)
                Wait 0.05 seconds

Sliding is best done via periodic trigger. Using waits may not provide the best result I think. Anyway, is you problem only the collision? Did the units get pulled? The above trigger has some mistakes. You did not pick any units (there is no Unit Group actions). And it's best to use custom Integer variable instead of the standard Integer A. And you have to use variables for your casting units because of the waits.

Maybe you should explain more on what the ability is supposed to do and what it does not do?
 

Baltazhar

Active Member
Reaction score
55
lol ffs! vypur u're a genius! I forgot the "Pick all units in Group" xD

The idea of the spell is: U set the template over the desired area, and a giant iceblock covers it. All units within freezes solid, and the iceblock shrinks. While it shrinks, the units inside gets pulled more and more towards the center of the casting point (so they still appear to be inside the iceblock). And when the iceblock is a given size, it explodes and give damage.
This is the main effect I wanted to create. An additional effect is, that for each 3 units dying in the iceblock, it creates an aftershock (frostnova) on X nearby enemy units.

<3 and +rep :)
 

Baltazhar

Active Member
Reaction score
55
Hmm.. Didn't even see that spell. Well there is quite a few things they have in common. I did think of Enigma's Dark Hole (DotA), just wanted to spice it up a bit with some frost effects, and make some aftershock explosions depending on units killed.
Other than that, same idea :)

Thx for linking the spell, I can compare the triggers between them, and see if I could have done something smarter here and there :eek:
 
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