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

Nuclear Strike

Spell Submission: Nuclear Strike

Calls down a Tactical Nuclear Missile to damage units within an area. The unit channels for 4s, and the Nuke lands 2s after.

Deals 240/360/480 or 22/44/66% of target's max hp, whichever is higher.

It's mod-able, it's also MUI.

Credits to:
WillAlmighty - Special Effects
Blizzard - Sound Effects
The6thMessenger - Programmer

  • Constants
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --------------- --------
      • -------- =============== --------
      • -------- Nuclear Missile --------
      • -------- =============== --------
      • -------- --------------- --------
      • Custom script: set udg_C_SG_NS_Loop_Interval = 0.04
      • -------- --------------- --------
      • Set C_SG_NS_Ability = Nuclear Strike
      • -------- --------------- --------
      • Set C_SG_NS_Channel_Add = 0
      • Set C_SG_NS_Channel_Base = 100
      • -------- --------------- --------
      • Set C_SG_NS_AOE_Add = 100.00
      • Set C_SG_NS_AOE_Base = 300.00
      • -------- --------------- --------
      • Set C_SG_NS_DMG_Min_Flat_Add = 120.00
      • Set C_SG_NS_DMG_Min_Flat_Base = 120.00
      • -------- --------------- --------
      • Set C_SG_NS_DMG_Max_Percent_Add = 0.22
      • Set C_SG_NS_DMG_Max_Percent_Base = 0.00
      • -------- --------------- --------
      • Set C_SG_NS_DMG_Structure_Add = 100.00
      • Set C_SG_NS_DMG_Structure_Base = 0.00
      • -------- --------------- --------
      • Set SG_NS_MUI_Index_A = 0
      • Set C_SG_NS_Delay = 50
      • Set C_SG_NS_Blink_Interval = 3
      • Set C_SG_NS_Calldown_Sound = Starcraft_1___Nuclear_Launch_Detected01 <gen>
      • -------- --------------- --------
      • -------- Below are SFX, these are the nuke calldown, and then the impact sfx. These are strings, you put the file location. --------
      • -------- --------------- --------
      • Set C_SG_NS_SFX_Nuke = Imports/Nuke.mdx
      • Set C_SG_NS_SFX_Hit = Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
      • -------- --------------- --------
      • Trigger - Add to Nuclear Strike Loop <gen> the event (Time - Every C_SG_NS_Loop_Interval seconds of game time)
  • Nuclear Strike Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to C_SG_NS_Ability
    • Actions
      • Set SG_NS_MUI_Index_A = (SG_NS_MUI_Index_A + 1)
      • Set SG_NS_Caster[SG_NS_MUI_Index_A] = (Triggering unit)
      • Set SG_NS_Counter[SG_NS_MUI_Index_A] = (C_SG_NS_Delay + (C_SG_NS_Channel_Base + (C_SG_NS_Channel_Add x (Level of C_SG_NS_Ability for SG_NS_Caster[SG_NS_MUI_Index_A]))))
      • Set SG_NS_Point[SG_NS_MUI_Index_A] = (Target point of ability being cast)
      • Set SG_NS_DMG_Percent[SG_NS_MUI_Index_A] = (C_SG_NS_DMG_Max_Percent_Base + (C_SG_NS_DMG_Max_Percent_Add x (Real((Level of C_SG_NS_Ability for SG_NS_Caster[SG_NS_MUI_Index_A])))))
      • Set SG_NS_DMG_Flat[SG_NS_MUI_Index_A] = (C_SG_NS_DMG_Min_Flat_Base + (C_SG_NS_DMG_Min_Flat_Add x (Real((Level of C_SG_NS_Ability for SG_NS_Caster[SG_NS_MUI_Index_A])))))
      • Set SG_NS_DMG_Structure[SG_NS_MUI_Index_A] = (C_SG_NS_DMG_Structure_Base + (C_SG_NS_DMG_Structure_Add x (Real((Level of C_SG_NS_Ability for SG_NS_Caster[SG_NS_MUI_Index_A])))))
      • Set SG_NS_AOE[SG_NS_MUI_Index_A] = (C_SG_NS_AOE_Base + (C_SG_NS_AOE_Add x (Real((Level of C_SG_NS_Ability for SG_NS_Caster[SG_NS_MUI_Index_A])))))
      • Set SG_NS_Order[SG_NS_MUI_Index_A] = (Current order of SG_NS_Caster[SG_NS_MUI_Index_A])
      • Floating Text - Create floating text that reads at SG_NS_Point[SG_NS_MUI_Index_A] with Z offset 128.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Set SG_NS_Floating_Text[SG_NS_MUI_Index_A] = (Last created floating text)
      • Floating Text - Hide SG_NS_Floating_Text[SG_NS_MUI_Index_A] for (All players)
      • Floating Text - Show SG_NS_Floating_Text[SG_NS_MUI_Index_A] for (All players matching (((Matching player) is an ally of (Owner of SG_NS_Caster[SG_NS_MUI_Index_A])) Equal to True))
      • Floating Text - Create floating text that reads . at SG_NS_Point[SG_NS_MUI_Index_A] with Z offset 128.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Set SG_NS_Floating_Text_Dot[SG_NS_MUI_Index_A] = (Last created floating text)
      • Set SG_NS_Completed[SG_NS_Temp_Integer_A] = True
      • Sound - Stop C_SG_NS_Calldown_Sound Immediately
      • Sound - Play C_SG_NS_Calldown_Sound
      • Visibility - Create an initially Enabled visibility modifier for (Owner of SG_NS_Caster[SG_NS_MUI_Index_A]) emitting Visibility from SG_NS_Point[SG_NS_MUI_Index_A] to a radius of SG_NS_AOE[SG_NS_MUI_Index_A]
      • Set SG_NS_Vision[SG_NS_MUI_Index_A] = (Last created visibility modifier)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SG_NS_MUI_Index_A Equal to 1
        • Then - Actions
          • Trigger - Turn on Nuclear Strike Loop <gen>
        • Else - Actions
  • Nuclear Strike Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer SG_NS_Temp_Integer_A) from 1 to SG_NS_MUI_Index_A, do (Actions)
        • Loop - Actions
          • -------- --------------- --------
          • -------- Stay away, this is the counter. This counts down which is used to time everything. --------
          • -------- --------------- --------
          • Set SG_NS_Counter[SG_NS_Temp_Integer_A] = (SG_NS_Counter[SG_NS_Temp_Integer_A] - 1)
          • -------- --------------- --------
          • -------- This here is the floating text, it shows both the dot and the timer. --------
          • -------- --------------- --------
          • -------- This part changes the floating text's texts. This shows the time before impact, up to 1 decimal. --------
          • Floating Text - Change text of SG_NS_Floating_Text[SG_NS_Temp_Integer_A] to (String(((Real(SG_NS_Counter[SG_NS_Temp_Integer_A])) x C_SG_NS_Loop_Interval), 1, 1)) using font size 12.00
          • -------- This here makes it blink. The calculation uses MOD. If there is a remainder when the Counter is divided with the interval, --------
          • -------- Then the dot hides, else if the remainder = 0, then the dot shows up. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • SG_NS_Counter[SG_NS_Temp_Integer_A] Less than or equal to C_SG_NS_Delay
                  • (SG_NS_Counter[SG_NS_Temp_Integer_A] mod C_SG_NS_Blink_Interval) Less than or equal to 0
            • Then - Actions
              • Floating Text - Change text of SG_NS_Floating_Text_Dot[SG_NS_Temp_Integer_A] to using font size 12.00
            • Else - Actions
              • Floating Text - Change text of SG_NS_Floating_Text_Dot[SG_NS_Temp_Integer_A] to . using font size 12.00
          • -------- This part ensures that the floating texts are moved where they are supposed to be. --------
          • Floating Text - Change the position of SG_NS_Floating_Text[SG_NS_Temp_Integer_A] to SG_NS_Point[SG_NS_Temp_Integer_A] with Z offset 128.00
          • Floating Text - Change the position of SG_NS_Floating_Text_Dot[SG_NS_Temp_Integer_A] to SG_NS_Point[SG_NS_Temp_Integer_A] with Z offset 0.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (SG_NS_Caster[SG_NS_Temp_Integer_A] is dead) Equal to True
                      • (Current order of SG_NS_Caster[SG_NS_Temp_Integer_A]) Not equal to SG_NS_Order[SG_NS_Temp_Integer_A]
                      • (SG_NS_Caster[SG_NS_Temp_Integer_A] is Polymorphed) Equal to True
                      • (SG_NS_Caster[SG_NS_Temp_Integer_A] is Stunned) Equal to True
                      • (SG_NS_Caster[SG_NS_Temp_Integer_A] is Snared) Equal to True
                  • SG_NS_Counter[SG_NS_Temp_Integer_A] Greater than C_SG_NS_Delay
            • Then - Actions
              • Set SG_NS_Completed[SG_NS_Temp_Integer_A] = False
            • Else - Actions
              • Set SG_NS_Completed[SG_NS_Temp_Integer_A] = True
          • -------- --------------- --------
          • -------- Should it reaches the delay, this launches the missile. --------
          • -------- --------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SG_NS_Counter[SG_NS_Temp_Integer_A] Equal to C_SG_NS_Delay
            • Then - Actions
              • Set SG_NS_Completed[SG_NS_Temp_Integer_A] = True
              • Special Effect - Create a special effect at SG_NS_Point[SG_NS_Temp_Integer_A] using C_SG_NS_SFX_Nuke
              • Set SG_NS_Nuke_SFX[SG_NS_Temp_Integer_A] = (Last created special effect)
            • Else - Actions
          • -------- --------------- --------
          • -------- DAMAGE CHANGING? --------
          • -------- --------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • SG_NS_Completed[SG_NS_Temp_Integer_A] Equal to False
                  • And - All (Conditions) are true
                    • Conditions
                      • SG_NS_Counter[SG_NS_Temp_Integer_A] Less than or equal to 0
                      • SG_NS_Completed[SG_NS_Temp_Integer_A] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SG_NS_Completed[SG_NS_Temp_Integer_A] Equal to True
                • Then - Actions
                  • Set Temp_Group = (Units within SG_NS_AOE[SG_NS_Temp_Integer_A] of SG_NS_Point[SG_NS_Temp_Integer_A] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of SG_NS_Caster[SG_NS_Temp_Integer_A])) Equal to True)))
                  • -------- --------------- --------
                  • -------- Change damage here. --------
                  • -------- --------------- --------
                  • Unit Group - Pick every unit in Temp_Group and do (Actions)
                    • Loop - Actions
                      • Set Temp_PickedUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Temp_PickedUnit is A structure) Equal to True
                        • Then - Actions
                          • Unit - Cause SG_NS_Caster[SG_NS_Temp_Integer_A] to damage Temp_PickedUnit, dealing SG_NS_DMG_Structure[SG_NS_Temp_Integer_A] damage of attack type Magic and damage type Magic
                        • Else - Actions
                          • Unit - Make Temp_PickedUnit Explode on death
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Max life of Temp_PickedUnit) x SG_NS_DMG_Percent[SG_NS_Temp_Integer_A]) Greater than SG_NS_DMG_Flat[SG_NS_Temp_Integer_A]
                            • Then - Actions
                              • Unit - Cause SG_NS_Caster[SG_NS_Temp_Integer_A] to damage Temp_PickedUnit, dealing ((Max life of (Picked unit)) x SG_NS_DMG_Percent[SG_NS_Temp_Integer_A]) damage of attack type Magic and damage type Magic
                            • Else - Actions
                              • Unit - Cause SG_NS_Caster[SG_NS_Temp_Integer_A] to damage Temp_PickedUnit, dealing SG_NS_DMG_Flat[SG_NS_Temp_Integer_A] damage of attack type Magic and damage type Magic
                          • Unit - Make Temp_PickedUnit Die normally on death
                      • Special Effect - Create a special effect attached to the chest of Temp_PickedUnit using C_SG_NS_SFX_Hit
                      • Special Effect - Destroy (Last created special effect)
                  • -------- --------------- --------
                  • Custom script: call DestroyGroup (udg_Temp_Group)
                • Else - Actions
              • Floating Text - Destroy SG_NS_Floating_Text[SG_NS_Temp_Integer_A]
              • Floating Text - Destroy SG_NS_Floating_Text_Dot[SG_NS_Temp_Integer_A]
              • Custom script: call RemoveLocation (udg_SG_NS_Point[udg_SG_NS_Temp_Integer_A])
              • Visibility - Disable SG_NS_Vision[SG_NS_Temp_Integer_A]
              • Visibility - Destroy SG_NS_Vision[SG_NS_Temp_Integer_A]
              • Special Effect - Destroy SG_NS_Nuke_SFX[SG_NS_Temp_Integer_A]
              • Set SG_NS_Order[SG_NS_Temp_Integer_A] = SG_NS_Order[SG_NS_MUI_Index_A]
              • Set SG_NS_Caster[SG_NS_Temp_Integer_A] = SG_NS_Caster[SG_NS_MUI_Index_A]
              • Set SG_NS_Counter[SG_NS_Temp_Integer_A] = SG_NS_Counter[SG_NS_MUI_Index_A]
              • Set SG_NS_Point[SG_NS_Temp_Integer_A] = SG_NS_Point[SG_NS_MUI_Index_A]
              • Set SG_NS_DMG_Flat[SG_NS_Temp_Integer_A] = SG_NS_DMG_Flat[SG_NS_MUI_Index_A]
              • Set SG_NS_DMG_Percent[SG_NS_Temp_Integer_A] = SG_NS_DMG_Percent[SG_NS_MUI_Index_A]
              • Set SG_NS_DMG_Structure[SG_NS_Temp_Integer_A] = SG_NS_DMG_Structure[SG_NS_MUI_Index_A]
              • Set SG_NS_AOE[SG_NS_Temp_Integer_A] = SG_NS_AOE[SG_NS_MUI_Index_A]
              • Set SG_NS_Nuke_SFX[SG_NS_Temp_Integer_A] = SG_NS_Nuke_SFX[SG_NS_MUI_Index_A]
              • Set SG_NS_Floating_Text[SG_NS_Temp_Integer_A] = SG_NS_Floating_Text[SG_NS_MUI_Index_A]
              • Set SG_NS_Floating_Text_Dot[SG_NS_Temp_Integer_A] = SG_NS_Floating_Text_Dot[SG_NS_MUI_Index_A]
              • Set SG_NS_Completed[SG_NS_Temp_Integer_A] = SG_NS_Completed[SG_NS_MUI_Index_A]
              • Set SG_NS_Vision[SG_NS_Temp_Integer_B] = SG_NS_Vision[SG_NS_MUI_Index_A]
              • Floating Text - Change the position of SG_NS_Floating_Text[SG_NS_Temp_Integer_A] to SG_NS_Point[SG_NS_Temp_Integer_A] with Z offset 128.00
              • Floating Text - Change the position of SG_NS_Floating_Text_Dot[SG_NS_Temp_Integer_A] to SG_NS_Point[SG_NS_Temp_Integer_A] with Z offset 0.00
              • Set SG_NS_MUI_Index_A = (SG_NS_MUI_Index_A - 1)
              • Set SG_NS_Temp_Integer_A = (SG_NS_Temp_Integer_A - 1)
            • Else - Actions
          • -------- --------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SG_NS_MUI_Index_A Less than or equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Keywords:
nuke, nuclear, nuclear missile, missile, starcraft, ghost, spectre, rockets, specter
Contents

Nuclear Strike (Map)

Reviews
10:24, 26th Jul 2014 BPower: MUI and leakless. Well done. http://www.hiveworkshop.com/forums/spells-569/nuclear-strike-254203/index2.html#post2562490 review...

Moderator

M

Moderator

10:24, 26th Jul 2014
BPower:
MUI and leakless. Well done.

http://www.hiveworkshop.com/forums/spells-569/nuclear-strike-254203/index2.html#post2562490

review: http://www.hiveworkshop.com/forums/spells-569/nuclear-strike-254203/index2.html#post2554822

09:12, 8th Jul 2014
BPower:
http://www.hiveworkshop.com/forums/spells-569/nuclear-strike-254203/index2.html#post2552900
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
1. change the event in the constants trigger to map init
2. actions that aren't required for the spell should be in a "this map only" trigger. In your case player gold etc
3. the nuclear strike nuke trigger is really bad, maybe not coding wise but using for each loops like that is really bad. Unless I am missing something.
 
Level 5
Joined
Sep 11, 2010
Messages
56
1. change the event in the constants trigger to map init
2. actions that aren't required for the spell should be in a "this map only" trigger. In your case player gold etc
3. the nuclear strike nuke trigger is really bad, maybe not coding wise but using for each loops like that is really bad. Unless I am missing something.

1.) It's map init. Experience taught me that map init event does not always trigger some triggers.

2.) Then take it off when you use it. It's not part of the entirety of the trigger if you actually give it some thought.

3.) Called MUI, or multi-unit-instance-ability. It allows multiple units use the spell at the same time.
 
Level 5
Joined
Sep 11, 2010
Messages
56
You can't create timers, leaderboards, multiboards and stuff like this in map init, the rest you can do.

Okay sure. But then why would it matter? It works, there is no problem. The same thing happens.

If it were to be copied on another map, then of course they will change it to fit what they need. If the trigger is bugged, then that's a concern.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
1. While that's true, those actions are not in your trigger. And sure it works fine but it's not perfect and as a coder you want to have the "perfect" code to achieve your goal.

2. you can't relay on the user knowing stuff, then they could just create the spell themselves right? Your spell should be able to be imported by a person who bought wc3 today basically.
"Always assume people are idiots" - my dad

3.
I am not stupid I know what MUI is,
however instead of using for each integer you should use a loop timer as event. It prevents the loop from bugging. (I am sure you find info on the bug if you google it or search the forum)
 
Level 5
Joined
Sep 11, 2010
Messages
56
1. While that's true, those actions are not in your trigger. And sure it works fine but it's not perfect and as a coder you want to have the "perfect" code to achieve your goal.

2. you can't relay on the user knowing stuff, then they could just create the spell themselves right? Your spell should be able to be imported by a person who bought wc3 today basically.
"Always assume people are idiots" - my dad

3.
I am not stupid I know what MUI is,
however instead of using for each integer you should use a loop timer as event. It prevents the loop from bugging. (I am sure you find info on the bug if you google it or search the forum)

1.) It's perfect to me, and it works without bugs. That is already good for me.

2.) Sure, but then again don't you think you are making a big deal on how people make their constants? That's just being angry why other people don't like orange juice while you love it.

3.) Don't tell me what to do, we have different styles of coding. Just as penmanship, others have different styles of writing. The real issue here is whether YOU think it's perfect, and you are imposing YOUR ideas onto others.

And such bugs only occur when you have altered the used variable of For-loop integer on another trigger, as well as using the preset Integer A or B. http://www.hiveworkshop.com/forums/...u-should-know-when-using-triggers-gui-233242/ (Chapter 4)

Such as using the Temp_Integer_A on two different and currently running triggers. That is why dedicated temporary integers are used as suggested by the link above. otherwise they are fine.

This really falls down into opinion than actual issues.

http://www.hiveworkshop.com/forums/...279/multi-instancible-gui-spell-making-34393/
 
Level 5
Joined
Sep 11, 2010
Messages
56
@The6thMessenger
I recommend you use 0.03125 instead using 0.04
How?
  • Actions
    • Custom script: set udg_Loop = 0.03125
    • Trigger - Add to (This trigger) the event (Time - Every Loop seconds of game time)

Okay, why? The system is modable, it's easy to configure because i added a constants pane, you can just do it yourself when you implement this.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
  • Floating Text - Create floating text that reads at SG_NS_Point[SG_NS_MUI_Index_A] with Z offset 128.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
  • Floating Text - Hide (Last created floating text) for (All players)
  • Floating Text - Show (Last created floating text) for (All players matching (((Matching player) is an ally of (Owner of SG_NS_Caster[SG_NS_MUI_Index_A])) Equal to True))
  • Floating Text - Change (Last created floating text): Enable permanence
  • Set SG_NS_Floating_Text[SG_NS_MUI_Index_A] = (Last created floating text)
  • Floating Text - Create floating text that reads . at SG_NS_Point[SG_NS_MUI_Index_A] with Z offset 128.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
  • Floating Text - Change (Last created floating text): Enable permanence
  • Set SG_NS_Floating_Text_Dot[SG_NS_MUI_Index_A] = (Last created floating text)
You can only have 100 floating texts max in a map, so if you try to make more, nothing really happens to them. Also, why you enable permanence?
 
Level 5
Joined
Sep 11, 2010
Messages
56
  • Floating Text - Create floating text that reads at SG_NS_Point[SG_NS_MUI_Index_A] with Z offset 128.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
  • Floating Text - Hide (Last created floating text) for (All players)
  • Floating Text - Show (Last created floating text) for (All players matching (((Matching player) is an ally of (Owner of SG_NS_Caster[SG_NS_MUI_Index_A])) Equal to True))
  • Floating Text - Change (Last created floating text): Enable permanence
  • Set SG_NS_Floating_Text[SG_NS_MUI_Index_A] = (Last created floating text)
  • Floating Text - Create floating text that reads . at SG_NS_Point[SG_NS_MUI_Index_A] with Z offset 128.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
  • Floating Text - Change (Last created floating text): Enable permanence
  • Set SG_NS_Floating_Text_Dot[SG_NS_MUI_Index_A] = (Last created floating text)
You can only have 100 floating texts max in a map, so if you try to make more, nothing really happens to them. Also, why you enable permanence?

I'm like that, i like being sure that somethings work. That is why there can be "extra" lines of codes. But i'm just making sure.

I have not read the code yet, but I definitly agree with Chaosy in his second point.
I also think not system related stuff should not be in system code. Just hold the system as clean as possible and seperate it from map-settings or testing stuff. :csmile:
Will give some feedback for code some later.

Sure, but then seriously if you are an "idiot" (rather uninformed), then you have no business in triggering at all. But then if you can import spells, then you can certainly remove that unnecessary lines of code by a simple delete button.
 
aka.gywgod133 has a point, either use that or use 0.03, the accuracy is far better and those are mostly used.

Wrda also post important thing, if the floating text doesn't appear it can be ridiculously strange when it appears on another casts.

Chaosy 2nd point is a MUST done for all spells for approval, it makes importing simple for people who wants to use this spell, don't let them get unnecessary pains.

A good note by DIMF is to save Picked Unit and such to variables, recommended to reduce operation lag (as it uses cache instead of recreating data).
 
The naming of the variables make it a pain to read the code. Using one underscope ('_') should be enough. (to seperate system/spell prefix with actual variable name)

Also names like "SG_NS_Temp_Integer_A" are unnecessary long. Something like "NS_Int" would do the job.

So I think the names should be changed, and it will gain a lot of readability. :csmile:
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
Delete
  • Player - Set Player 1 (Red) Current gold to 4000
  • Game - Set the time of day to 11.99
  • Game - Set time of day speed to 0.00% of the default speed
The "Constants" trigger should run on map init.

Any (Conditions) is not required, also store the ability into a variable.
  • Or - Any (Conditions) are true
    • Conditions
      • (Ability being cast) Equal to Nuclear Strike
As a logical consequence "Ability beeing cast" is Nuclear Strike.

Put this line directly below the one where you create the floating text.
Use the variable instead of "Last Created Floating text".

  • Trigger - Turn on Nuclear Strike Loop <gen>
You may check first if the trigger is already enabled. In my signature you will find a tutorial about proper dynamic indexing.

  • Special Effect - Create a special effect at SG_NS_Point[SG_NS_Temp_Integer_A] using war3mapImported\NuclearStrike3.mdx
  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
Please support these effects within the config trigger. We do not appreciate hard-coded spells.

"Picked Unit" could be stored into a variable to avoid needless function calls.


  • Set SG_NS_Floating_Text[SG_NS_MUI_Index_A] = (Last created floating text)
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
First of all change all variable names. C_SG_NS_.... is too much. Label them NS_...

1. Remove this line, it has no use.
  • Trigger - Turn off (This trigger)
2. Change this
  • Set C_SG_NS_Loop_Interval = 0.04
to
  • Custom script: set udg_C_SG_NS_Loop_Interval = 0.04
3. Add an ability variable to the configuration trigger and set it to Nuclear Strike.
--> on spell cast compare the casted ability with this variable
--> Replace "ability beeing casted" with this variable.

4. This line exists two times in the cast trigger
  • Set SG_NS_Floating_Text_Dot[SG_NS_MUI_Index_A] = (Last created floating text)
5. This is so-so, an integer comparison of your MUI_Index == 1 would be much better.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Nuclear Strike Loop <gen> is on) Equal to False
    • Then - Actions
      • Trigger - Turn on Nuclear Strike Loop <gen>
    • Else - Actions
6. Put the IsUnitDeadBJ condition on the top
  • Or - Any (Conditions) are true
    • Conditions
      • (Current order of SG_NS_Caster[SG_NS_Temp_Integer_A]) Not equal to SG_NS_Order[SG_NS_Temp_Integer_A]
      • (SG_NS_Caster[SG_NS_Temp_Integer_A] is Polymorphed) Equal to True
      • (SG_NS_Caster[SG_NS_Temp_Integer_A] is Stunned) Equal to True
7. Replace "picked unit" with Temp_PickedUnit. (Multiple times below aswell)
  • Unit - Cause SG_NS_Caster[SG_NS_Temp_Integer_A] to damage (Picked unit), dealing SG_NS_DMG_Structure[SG_NS_Temp_Integer_A] damage of attack type Magic and damage type Magic
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
There are a lot of variables in the variable editor which are not related to the spell (udex, c_moon_base_damage, ...). They won't get imported, so a fix is not required here.
Don't initialize your array variables with a size of 999. Leave it with the default setting of 1.
Your variable naming kills a little bit of read-ability. (We already talked about this)
Damagetype and Attacktype could be configurable.

  • SG_NS_MUI_Index_A Less than or equal to 0
should be
  • SG_NS_MUI_Index_A Equal to 0
Effects and tooltips are nice. The spell itself is fun to cast and works flawless. Good Job.
 
Top