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: 271

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 The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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