Spell Bubble Shield [ MUI ]

DrEvil

FCRI Associate!
Reaction score
111
Ok so this is my fist ever spell submitted here ,

Ive looked at many MUI spells , took info in and studied.

This spell was inspired by " Anti-Krazy" Who didnt make a good job of it .


This spell keeps out melee attackers , while the shield is activated .
7 x Level of Bubble Shield - Mana each second.

MUI - Yes
MPI - Yes
vJass - No
Jass - No
GUI - Yes

I realy hope you all like it :D

My Code's :
Code:
CV of all units
    Events
        Map initialization
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Custom value of (Picked unit)) Equal to 0
                    Then - Actions
                        Custom script:   set udg_i = udg_i + 1 
                        Unit - Set the custom value of (Picked unit) to i
                    Else - Actions
Code:
Bubble Shield Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Bubble Shield 
    Actions
        Set UnitCV = (Custom value of (Triggering unit))
        Set caster[UnitCV] = (Triggering unit)
        Custom script:   set udg_x =GetUnitX(udg_caster[udg_UnitCV])
        Custom script:   set udg_y =GetUnitY(udg_caster[udg_UnitCV])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Casting unit) is in BubbleShieldGroup) Equal to True
            Then - Actions
                Unit Group - Remove (Casting unit) from BubbleShieldGroup
                Special Effect - Create a special effect at (Point(x, y)) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCaster.mdl
                Special Effect - Destroy (Last created special effect)
            Else - Actions
                Unit Group - Add (Casting unit) to BubbleShieldGroup
                Special Effect - Create a special effect at (Point(x, y)) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                Special Effect - Destroy (Last created special effect)
Code:
Bubble Shield Bubble
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in BubbleShieldGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Integer((Mana of (Picked unit)))) Greater than 0
                    Then - Actions
                        Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - (0.18 x (Real((Level of Bubble Shield  for (Picked unit))))))
                        Set UnitCV = (Custom value of (Picked unit))
                        Set BubblePosition[UnitCV] = (BubblePosition[UnitCV] + 5)
                        Set P = (Position of (Picked unit))
                        For each (Integer A) from 1 to 4, do (Actions)
                            Loop - Actions
                                Set PP = (P offset by 150.00 towards (Real(((90 x (Integer A)) + BubblePosition[UnitCV]))) degrees)
                                Special Effect - Create a special effect at PP using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
                                Special Effect - Destroy (Last created special effect)
                                Custom script:   call RemoveLocation ( udg_PP )
                        Custom script:   call RemoveLocation ( udg_P )
                    Else - Actions
                        Unit Group - Remove (Picked unit) from BubbleShieldGroup
Code:
Bubble Shield KnockBack
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in BubbleShieldGroup and do (Actions)
            Loop - Actions
                Set BubbleUnit = (Picked unit)
                Set BubbleShieldKB = (Units within 165.00 of (Position of (Picked unit)) matching (((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to False))
                Unit Group - Pick every unit in BubbleShieldKB and do (Actions)
                    Loop - Actions
                        Set FacingOfUnit = (Angle from (Position of BubbleUnit) to (Position of (Picked unit)))
                        Set P = (Position of (Picked unit))
                        Set PP = (P offset by 10.00 towards FacingOfUnit degrees)
                        Unit - Move (Picked unit) instantly to PP, facing (FacingOfUnit + 180.00) degrees
                        Unit - Cause BubbleUnit to damage (Picked unit), dealing ((Random real number between 1.50 and 3.50) x (Real((Level of Bubble Shield  for BubbleUnit)))) damage of attack type Spells and damage type Normal
                        Custom script:   call RemoveLocation ( udg_P )
                        Custom script:   call RemoveLocation ( udg_PP )
                Custom script:   call DestroyGroup ( udg_BubbleShieldKB )

Sorry for the terrain , my teraining skills are not good yet.

Il edit and add a few screenshot's in a minute .

And for now i must submit the map :p

All comments , good or bad .

Screenies :
BSPic1-1.jpg

BSPic2.jpg
 

Attachments

  • Bubble Shield.w3x
    33.1 KB · Views: 267

Jagan

New Member
Reaction score
30
Post the code. And for terrain, simply use one of the spell templates made available here.

EDIT: It doesn't look much like a bubble. Looks more like a wave/water shield to me. Apart from that, nice spell. Good job, dude.
 

DrEvil

FCRI Associate!
Reaction score
111
Well its still a shield of [ water .... bubbles ]

If you put the periodic Higher it looks more like a bubble.
 

vypur85

Hibernate
Reaction score
803
Code:
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)...

Code:
..special effect at [B](Point(x, y))[/B] using...

Code:
Set BubbleShieldKB = (Units within 165.00 of [B](Position of (Picked unit)[/B]) matching (((Matching unit) belongs to an ally

I believe those are leaks. Adding an in-game screen shot is also appreciated. :) Also, unit custom value seems wasted...
 

DrEvil

FCRI Associate!
Reaction score
111
Code:
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)...

Code:
..special effect at [B](Point(x, y))[/B] using...

Code:
Set BubbleShieldKB = (Units within 165.00 of [B](Position of (Picked unit)[/B]) matching (((Matching unit) belongs to an ally

I believe those are leaks. Adding an in-game screen shot is also appreciated. :)

Point x,y isnt but the position of picked unit is.
 

Flare

Stops copies me!
Reaction score
662
Point x,y isnt
It generates a location from an XY pair, so it does leak
And the fact that you're using it in "Create Special Effect At Point" should indicate that it's creating a point

And there's a number of Position of Unit leaks in the code that's posted (I don't know if they are fixed in the demo map since college comps don't have WE :p)

EDIT
In Bubble Shield Bubble:
(1) Event would be better with 0.03 (the reduction in trigger executions won't be very noticeable, and you reduce the risk of lag from multiple instances)
(2) When the If returns false, the caster should be forcibly stopped (since they are going to maintain the cast without any effect occuring otherwise)

In Bubble Shield Knockback:
(1) 0.10 is a fairly large interval for knockbacks, and it would probably look very choppy
 

DrEvil

FCRI Associate!
Reaction score
111
It generates a location from an XY pair, so it does leak
And the fact that you're using it in "Create Special Effect At Point" should indicate that it's creating a point

And there's a number of Position of Unit leaks in the code that's posted (I don't know if they are fixed in the demo map since college comps don't have WE :p)

EDIT
In Bubble Shield Bubble:
(1) Event would be better with 0.03 (the reduction in trigger executions won't be very noticeable, and you reduce the risk of lag from multiple instances)
(2) When the If returns false, the caster should be forcibly stopped (since they are going to maintain the cast without any effect occuring otherwise)

In Bubble Shield Knockback:
(1) 0.10 is a fairly large interval for knockbacks, and it would probably look very choppy

So basically i should have just used a location instead of [ x , y ]... how do i remove the leak then , if it is at ( point , x , y )?

Il look through the code and correct all leaks .
And try to make it less choppy :D If thats ok Flare.:thup:

Thanks for all comments :cool:
 

vypur85

Hibernate
Reaction score
803
> how do i remove the leak

Just like normal point removal?

Code:
[B]Set Temp_Point = (Point(x, y))[/B]
Special Effect - Create a special effect at [B]Temp_Point[/B] using...
Custom script:   call RemoveLocation....

o_O Tinki, you're back.
 

DrEvil

FCRI Associate!
Reaction score
111
Ok so in spells why do they create special effects at [ point ( x , y ) ]
 

Flare

Stops copies me!
Reaction score
662
Because Point (x, y) returns a location from the given coordinates (and that returned location acts in the very same way as any other location, only difference being where on the map it is)

If you add an action that uses Point (x, y) to a blank trigger, then convert it to custom script, you should get
JASS:
... Location (x, y) ...
//There may be something before/after it, such as 'set var' or whatever

And if you have NewGen, you can look up the TESH function list to see that the Location function returns a location

Alternatively, since you have the coordinates, you could just add
JASS:
call DestroyEffect (AddSpecialEffect ("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl", udg_x, udg_y))

and get rid of the need for a location altogether
 

DrEvil

FCRI Associate!
Reaction score
111
Thanks for the tips Flare :thup:

So is my spell good for my first ever MUI spell or is it not that good ?
 

Flare

Stops copies me!
Reaction score
662
Looks good (apart from the leaks in the posted code, but they have been fixed in the demo map, right?), even though, as vypur mentioned, monopolizing custom value for the sake of a single spell can be a bit much, especially if people already have systems in their map that need custom value for some other reason (even though, with correct indexing, there shouldn't be a problem and everything can work together hand-in-hand)
 

DrEvil

FCRI Associate!
Reaction score
111
All MUI spell's should have that correct unit indexing if
they want the spell's to be MUI if the maker made the
spell's MUI with Correct Unit Indexing.

Well i think i fixed most of the code maybe a few tiny leak's left but

I fixed the main 0.03 leak's with the groups and what not.

Shall i update the main code aswell ?
 

Flare

Stops copies me!
Reaction score
662
You don't have to monopolize every unit's custom value to make a spell MUI (you can increase/decrease a counter as instances start/end, assign your variables to the [CounterValue] array slot and then loop from 0 to CounterValue, or index dummy units instead, who won't really need a custom value for any other purpose), which can be more favourable depending on how the end-user has custom value set up in their map
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top