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

Disaster Area Spell Help

Status
Not open for further replies.
Level 2
Joined
Aug 9, 2007
Messages
12
Disaster Area Spell Help (Updated)

EDIT: Just to clarify things, The spell creates a chance for a random disaster to occur. I cannot seem to make a unit cast a spell available to them. Only the spells the triggers have available as a default. So my sad attempt to emulate their effects have caused me to ask if I can trigger one unit to cast a spell that is in their list of abilities.





I have recently been attempting to create a GUI based spell that would cause a target to be the center of a series of natural disasters. While I have been met with success with the use of the standard 'have unit cast spell', I have found that I cannot either change things such as the standard damage of the spell (for example, earthquake) or successfully duplicate those spells with trigger based effects. Even a little dabbling in JASS has wielded very little for me, so I came here to ask for any help you don't mind giving.

Also, I will post my trigger data a little later as I currently need to head to work. Thank you for reading this post and hello.

Edit: Here we go, I have a tendency to do things in the most ignorant manner, so I apologize if any of you accidentally injure yourselves with epic facepalmage.

  • Start
    • Events
      • Unit - Invincible Ronin 0002 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BadLuckKame HameHa
    • Actions
      • Set Unlucky1 = (Target unit of ability being cast)
      • Special Effect - Create a special effect attached to the overhead of Unlucky1 using Objects\RandomObject\RandomObject.mdl
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Countdown Timer - Start luckspurt as a One-shot timer that will expire in 10.00 seconds
          • Wait until ((Remaining time for luckspurt) Less than 0.01), checking every 0.10 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 3 and 3) Equal to 3
            • Then - Actions
              • Set RANDOM = (Random integer number between 1 and 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RANDOM Equal to 1
                • Then - Actions
                  • Trigger - Run Bad Luck EQ <gen> (ignoring conditions)
                  • Wait 10.00 seconds
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing

  • Bad Luck EQ
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Cursed Frog (dummy) for Player 3 (Teal) at (Position of Unlucky1) facing Default building facing degrees
      • Camera - Shake the camera for (Owner of Unlucky1) with magnitude 3.00
      • Environment - Create a 9.00 second Normal ripple deformation at (Position of Unlucky1) with starting radius 500.00, ending radius 500.00, and depth 64.00, using 3.00 second ripples spaced 150.00 apart
      • Unit Group - Add all units of (Units within 500.00 of (Position of (Last created unit)) matching (((Picked unit) is A structure) Equal to True)) to damagegroup
      • Unit Group - Pick every unit in damagegroup and do (Unit - Cause (Last created unit) to damage (Picked unit), dealing 999.00 damage of attack type Spells and damage type Force)
      • Unit Group - Remove all units of damagegroup from damagegroup
      • Unit Group - Add all units of (Units within 500.00 of (Position of (Last created unit)) matching (((Picked unit) is A ground unit) Equal to True)) to damagegroup
      • Unit Group - Pick every unit in damagegroup and do (Unit - Set (Picked unit) movement speed to ((Current movement speed of (Picked unit)) x 0.10))
      • Unit Group - Pick every unit in damagegroup and do (Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\FrostDamage\FrostDamage.mdl)
      • Wait 9.00 seconds
      • Unit Group - Pick every unit in damagegroup and do (Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) x 1.00))
      • Unit Group - Remove all units of damagegroup from damagegroup
      • Unit - Remove (Last created unit) from the game
      • Trigger - Turn off (This trigger)
Again, I am aware that many basic mistakes are being made by me and hope for your understanding.
 
Last edited:
Level 13
Joined
Nov 22, 2006
Messages
1,260
This is the nicest thread I've ever seen, you deserve help. Have you tried Unit - Order unit to <some spell> <some unit>? If you made a custom ability, in <some spell> you need to select the base spell of that ability. Did I understand your problem correctly?

In your trigger there are some leaks and some things that can be improved, but that comes later......

P.S. Welcome to THW!
 
Level 2
Joined
Aug 9, 2007
Messages
12
Thank you so much for your response! I will do what I can to make sure the information is clear.


The simplest thing that I can't seem to figure out:
http://s93.photobucket.com/albums/l61/loyalbabus/?action=view&current=Unknown.png

My original plan was to use
  • Unit - Order (Last created unit) to Orc Far Seer - Earthquake (Position of Unlucky1)
to create the disaster (as I couldn't find a way to cast a custom ability using the gui), but I discovered that even changing the stats of the base spell (via the object editor) would not affect the spell properties of the ability I selected from the <some spell> menu. So, as powerful as I wanted the ability to be, a normal earthquake spell would wipe out an enemies home base and other planned abilities like monsoon, volcano, stampede, tornado and so on would have wildly different effects.

If you made a custom ability, in <some spell> you need to select the base spell of that ability.
:confused: I seem to be missing something incredibly basic. If I select the base spell of a custom ability (for example, my earthQuake (disaster) spell is based on the Far Seer's Earthquake ability) it casts the original Blizzard (I mean the company) spell as it was defined when they first created the game, Regardless of what I do in the object editor.

I'm incredibly confused...

Edit:
Also, thank you for the welcoming, if it is possible for someone such as me to contribute to this community, I'll do everything I can to be useful. + Rep by the way.
 
Last edited:
Level 13
Joined
Nov 22, 2006
Messages
1,260
If you make a custom ability from Far Seer - Earthquake, the way to make a unit cast it is to order him to 'Earthquake' something. But don't change the 'order string' in object editor. Those thing you see in <some spell> menu aren't spells, they are order strings. So, if you make a custom ability out of Earthquake, that ability will have the same order string as the original Earthquake, understand?

Just to make it more clear, if you convert that to jass, it will look something like this:

JASS:
function Trig_SomeTrigger_Actions takes nothing returns nothing
    call IssueTargetOrder(gg_unit_blabla, "earthquake", GetLastCreatedUnit())
endfunction

That 'earthquake' is the same like the Order String of that spell in object editor. So GUI made it just simpler than it is, but it's useful to know what exactly is it.

Everything clear now?
 
Level 2
Joined
Aug 9, 2007
Messages
12
Everything makes sense now...

I've actually written in JASS and I had no idea what an order string was. That's pretty sad on my part. Thank you for your patience and simply because some people have misinterpreted my confusion for denial, I wish to state that I'm not the smartest individual on the planet and I appreciate your clarification.

Umm... so I can't seem to plus rep right now, as I already gave it, but will do so when I have the chance. So thanks for now and more Rep for later?
 
Level 2
Joined
Aug 9, 2007
Messages
12
The now working beta version of my spell:smile:
  • Disaster Area
    • Events
      • Unit - Invincible Ronin 0036 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Disaster Area
    • Actions
      • Set Unlucky1 = (Target unit of ability being cast)
      • Special Effect - Create a special effect attached to the overhead of Unlucky1 using Objects\RandomObject\RandomObject.mdl
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Countdown Timer - Start luckspurt as a One-shot timer that will expire in 10.00 seconds
          • Wait until ((Remaining time for luckspurt) Less than 0.01), checking every 0.10 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 3) Equal to 3
            • Then - Actions
              • Set RANDOM = (Random integer number between 1 and 5)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RANDOM Equal to 1
                • Then - Actions
                  • Trigger - Run Bad Luck Earthquake <gen> (checking conditions)
                  • Wait 10.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RANDOM Equal to 2
                    • Then - Actions
                      • Trigger - Run Bad Luck Stampede <gen> (checking conditions)
                      • Wait 10.00 seconds
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RANDOM Equal to 3
                        • Then - Actions
                          • Trigger - Run Bad Luck Volcano <gen> (checking conditions)
                          • Wait 10.00 seconds
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RANDOM Equal to 4
                            • Then - Actions
                              • Trigger - Run Bad Luck Tornado <gen> (checking conditions)
                              • Wait 10.00 seconds
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • RANDOM Equal to 5
                                • Then - Actions
                                  • Trigger - Run Bad Luck Monsoon <gen> (checking conditions)
                                  • Wait 10.00 seconds
                                • Else - Actions
                                  • Do nothing
            • Else - Actions
              • Do nothing
      • Special Effect - Destroy (Last created special effect)
And there are five of the bad luck triggers, but I chose to post only one (they all essentially the same) for size reasons:
  • Bad Luck Stampede
    • Events
    • Conditions
      • (Unlucky1 is alive) Equal to True
    • Actions
      • Unit - Create 1 Cursed Frog (dummy) for Player 3 (Teal) at (Position of Unlucky1) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Beastmaster - Stampede (Position of Unlucky1)
      • Wait 9.00 seconds
      • Unit - Remove (Last created unit) from the game
      • Trigger - Turn off (This trigger)
Feel free to point and laugh, flame, troll or even offer constructive criticism. I am also for the record very aware of my inefficient if/then/else use, but cannot at this point find a case equivalent in the GUI.

Edit:
There are likely many leaks and I am now browsing the tutorial section to determine my course in identifying and fixing them.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Instead of waiting for the timer to expire, why don't you just put Wait? There are few location leaks in Bad Luck Stampede:

Unit - Create 1 Cursed Frog (dummy) for Player 3 (Teal) at (Position of Unlucky1) facing Default building facing degrees
Unit - Order (Last created unit) to Neutral Beastmaster - Stampede (Position of Unlucky1)

Instead do this:

  • Bad Luck Stampede
    • Events
    • Conditions
      • (Unlucky1 is alive) Equal to True
    • Actions
      • Set Loc = (Position of Unlucky1)
      • Unit - Create 1 Cursed Frog (dummy) for Player 3 (Teal) at Loc facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Beastmaster - Stampede Loc
      • Wait 9.00 seconds
      • Unit - Remove (Last created unit) from the game
      • Trigger - Turn off (This trigger)
      • Custom script: call RemoveLocation(udg_Loc)
Now you destroyed the location, and there is no leak. Note that every variable in JASS has prefix udg_

Why would I point and laugh? It's not bad. Maybe instead of those if/then/elses you can put those five triggers in a trigger array (in a map initialization trigger), example:

  • Set Trigger[1] = Bad Luck Earthquake <gen>
  • Set Trigger[2] = Bad Luck Stampede <gen>
  • ..........
  • .....
And so on. And then instead of all those if/then/elses, just put:

  • Trigger - Run Trigger[RANDOM] (checking conditions)
  • Wait 10.00 seconds
See how much easier that would be?

EDIT: Good tutorial on leaks: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27242
 
Level 2
Joined
Aug 9, 2007
Messages
12
*ahem*
So, some improvements of mine as well as doing what I can to implement PurplePoot and Silvenon's suggestions. Major thanks to Silvenon for mentioning trigger arrays and to PurplePoot for leading the spell onto it's next improvement.

Multi instancing has been my recent attempt, but so far I've just managed to break the code. What success I have had is thanks to wyrmlord's Multi-Instancible GUI Spell Making tutorial.
  • Untitled Trigger 001 Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Trigger[1] = Bad Luck Earthquake <gen>
      • Set Trigger[2] = Bad Luck Monsoon <gen>
      • Set Trigger[3] = Bad Luck Stampede <gen>
      • Set Trigger[4] = Bad Luck Tornado <gen>
      • Set Trigger[5] = Bad Luck Volcano <gen>
  • Disaster Area Copy 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Disaster Area
    • Actions
      • Custom script: local effect udg_unluckyMark
      • Set Unlucky1 = (Target unit of ability being cast)
      • Special Effect - Create a special effect attached to the overhead of Unlucky1 using Objects\RandomObject\RandomObject.mdl
      • Set unluckyMark = (Last created special effect)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 1) Equal to 1 (normally 1 to 3, changed for testing purposes)
            • Then - Actions
              • Set RANDOM = (Random integer number between 1 and 5)
              • Trigger - Run Trigger[RANDOM] (checking conditions)
              • Wait 10.00 seconds
            • Else - Actions
              • Wait 10.00 seconds
      • Special Effect - Destroy unluckyMark
And of course:
  • Bad Luck Stampede
    • Events
    • Conditions
      • (Unlucky1 is alive) Equal to True
    • Actions
      • Custom script: local unit udg_fated1
      • Custom script: local unit udg_casterFrog
      • Set fated1 = Unlucky1
      • Set tempPoint = (Position of fated1)
      • Unit - Create 1 Cursed Frog (dummy) for Player 3 (Teal) at tempPoint facing 0.00 degrees
      • Set casterFrog = (Last created unit)
      • Unit - Order casterFrog to Neutral Beastmaster - Stampede (Position of fated1)
      • Custom script: call RemoveLocation( udg_tempPoint )
      • Wait 9.00 seconds
      • Unit - Remove casterFrog from the game
      • Trigger - Turn off (This trigger)
I'm suspecting it's something to do with the Unlucky1 variable and at this point I'm out of ideas as to how I might prevent the assignment issues.

After establishing unlucky1 as a local in the Disaster Area Copy 2 trigger, I suppose I could have the triggers call that local using a little JASS scripting, but I know that there has got to be an easier way. Also, I apologize for the wait time in between my posts, I have a job that prevents me from being on the computer very much these days.
 
Last edited:
Level 13
Joined
Nov 22, 2006
Messages
1,260
  • Custom script: local effect udg_unluckyMark
Hehe interesting.....I wanted to say that that's a mistake, but then I searched if the tutorial has anything to do with it, and it does......interesting.

So what's the problem? What's not working?
 
Level 2
Joined
Aug 9, 2007
Messages
12
Well, to test Multi-Instancing, I got rid of the cooldown and started casting like crazy. Essentially, multiple frogs began to appear around the same unit, meaning multiple disaster, despite the fact that it was only cast once on that particular unit. Again, I feel like I'm messing up the Unlucky1 variable as it needs to be referenced after each wait time.
 
Level 2
Joined
Aug 9, 2007
Messages
12
Yes, but the problem is that I don't know how...
Unless I completely remove the loop (I could still have the triggers be separate), assigning a local variable is pointless. Any suggestions in terms of not having a loop?

For instance, you should not refer to local variables in if/then/else blocks and "pick every ..." blocks. The reason behind this is that if/then/else sometimes creates additional functions (even if they really are unnecessary) for the condition amongst other things. The "pick ever ..." blocks will always create an additional function that is called for each picked object. All of this information I just told you is hidden from you in GUI, which is why I'm warning you.

Quoted so no one needs to read through the tutorial.
 
Last edited:
Status
Not open for further replies.
Top