[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Spells


Reply
 
Thread Tools
The Hive Workshop Spells:
Cloud Spiral V2.4 [MUI][Unit Indexer]
Images
Highslide JS
Details
Uploaded:09:39, 5th Jul 2011
Last Updated:23:16, 20th Aug 2011
Keywords:cloud, spin, spell, damage, time, loop, spiral, unit, enemy, mui, gui, triggers,
Type:Target Ground
Category:GUI / Triggers, UMSWE GUI / Triggers

Cloud Spiral - A Spell Template for those new to GUI

Spins cloud around the caster, damaging all units within area of the clouds.

75 Damage,
Each Level adds +1.70 seconds to duration.

Triggers
Unit Indexer
Events
Map initialization
Conditions
Actions
Custom script: call ExecuteFunc("InitializeUnitIndexer")
Custom script: endfunction
-------- --------
-------- This is the most important function - it provides an index for units as they enter the map --------
-------- --------
Custom script: function IndexUnit takes nothing returns boolean
-------- --------
-------- You can use the boolean UnitIndexerEnabled to protect some of your undesirable units from being indexed --------
-------- Example: --------
-------- Set UnitIndexerEnabled = False --------
-------- Unit - Create 1 Dummy for (Triggering player) at TempLoc facing 0.00 degrees --------
-------- Set UnitIndexerEnabled = True --------
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UnitIndexerEnabled Equal to True
Then - Actions
-------- --------
-------- Generate a unique integer index for this unit --------
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UDexRecycle Equal to 0
Then - Actions
Set UDex = (UDexGen + 1)
Set UDexGen = UDex
Else - Actions
Set UDex = UDexRecycle
Set UDexRecycle = UDexNext[UDex]
-------- --------
-------- Link index to unit, unit to index --------
-------- --------
Set UDexUnits[UDex] = (Matching unit)
Unit - Set the custom value of UDexUnits[UDex] to UDex
-------- --------
-------- Use a doubly-linked list to store all active indexes --------
-------- --------
Set UDexPrev[UDexNext[0]] = UDex
Set UDexNext[UDex] = UDexNext[0]
Set UDexNext[0] = UDex
-------- --------
-------- Fire index event for UDex --------
-------- --------
Set UnitIndexEvent = 1.00
Set UnitIndexEvent = 0.00
Else - Actions
Custom script: return false
Custom script: endfunction
-------- --------
-------- The next function is called each time a unit enters the map --------
-------- --------
Custom script: function IndexNewUnit takes nothing returns boolean
Custom script: local integer pdex
Custom script: local integer ndex
-------- --------
-------- Process to give each unit a custom value for use as array indices --------
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UDexWasted Equal to 15
Then - Actions
-------- --------
-------- Deindex all potentially-removed units for every (15) units created --------
-------- --------
Custom script: set pdex = udg_UDex
Set UDex = UDexNext[0]
Custom script: loop
Custom script: exitwhen udg_UDex == 0
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of UDexUnits[UDex]) Equal to 0
Then - Actions
-------- --------
-------- Fire deindex event for UDex --------
-------- --------
Set UnitIndexEvent = 2.00
Set UnitIndexEvent = 0.00
-------- --------
-------- Remove index from linked list --------
-------- --------
Custom script: set ndex = udg_UDexNext[udg_UDex]
Custom script: set udg_UDexNext[udg_UDexPrev[udg_UDex]] = ndex
Custom script: set udg_UDexPrev[ndex] = udg_UDexPrev[udg_UDex]
Set UDexPrev[UDex] = 0
-------- --------
-------- Prepare index to be recycled --------
-------- --------
Set UDexUnits[UDex] = No unit
Set UDexNext[UDex] = UDexRecycle
Set UDexRecycle = UDex
Custom script: set udg_UDex = ndex
Else - Actions
Set UDex = UDexNext[UDex]
Custom script: endloop
Custom script: set udg_UDex = pdex
Set UDexWasted = 0
Else - Actions
Set UDexWasted = (UDexWasted + 1)
-------- --------
-------- Handle the entering unit (Matching unit) --------
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Matching unit)) Equal to 0
Then - Actions
Custom script: call IndexUnit()
Else - Actions
Custom script: return false
Custom script: endfunction
-------- --------
-------- The next function initializes the core of the system --------
-------- --------
Custom script: function InitializeUnitIndexer takes nothing returns nothing
Custom script: local integer i = 0
Custom script: local region re = CreateRegion()
Custom script: local rect r = GetWorldBounds()
Set UnitIndexerEnabled = True
Custom script: call RegionAddRect(re, r)
Custom script: call TriggerRegisterEnterRegion(CreateTrigger(), re, Filter(function IndexNewUnit))
Custom script: call RemoveRect(r)
Custom script: set re = null
Custom script: set r = null
Custom script: loop
Custom script: call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(i), Filter(function IndexUnit))
Custom script: set i = i + 1
Custom script: exitwhen i == 16
Custom script: endloop
-------- --------
-------- This is the "Unit Indexer Initialized" event --------
-------- --------
Set UnitIndexEvent = 3.00
Set UnitIndexEvent = 0.00
Cloud Spiral Int
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Cloudspiral
Actions
-------- --------
-------- VARIABLE START --------
Set Key = (Custom value of (Triggering unit))
Set SpellIndex = (SpellIndex + 1)
Set Caster[Key] = (Triggering unit)
Set SpellPower[Key] = (Level of Cloudspiral for Caster[Key])
Set Damage[Key] = 75.00
Set TimeInterval[Key] = 0.00
Set TimeCompletion[Key] = ((Real(SpellPower[Key])) x 1.20)
Set SpellRan[Key] = True
Set Distance[Key] = 0.00
Set Angle[Key] = 0.00
Unit Group - Add Caster[Key] to SpellGroup
Trigger - Turn on Cloud Spiral loop <gen>
-------- --------
-------- VARIABLE FINISH --------
Cloud Spiral loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in CS_SpellGroup and do (Actions)
Loop - Actions
Set TempKey = (Custom value of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(CS_Caster[TempKey] is dead) Equal to True
(CS_Caster[TempKey] has buff Stunned (Pause)) Equal to True
CS_TimeInterval[TempKey] Greater than or equal to CS_TimeCompletion[TempKey]
Then - Actions
Set CS_SpellRan[TempKey] = False
Unit Group - Remove CS_Caster[TempKey] from CS_SpellGroup
Set CS_SpellIndex = (CS_SpellIndex - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CS_SpellIndex Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
-------- --------
Set CS_TimeInterval[TempKey] = (CS_TimeInterval[TempKey] + 0.03)
Set CS_Distance[TempKey] = (CS_Distance[TempKey] + 2.50)
Set CS_Angle[TempKey] = (CS_Angle[TempKey] + 11.25)
Set TempPoint = (Position of CS_Caster[TempKey])
Set TempPoint2 = (TempPoint offset by CS_Distance[TempKey] towards CS_Angle[TempKey] degrees)
-------- --------
Set UnitIndexerEnabled = False
Unit - Create 1 CS_DummyCloud for (Owner of CS_Caster[TempKey]) at TempPoint2 facing Default building facing degrees
Set UnitIndexerEnabled = True
Unit - Add a CS_TimeCompletion[TempKey] second Generic expiration timer to (Last created unit)
Set TempGroup = (Units within 50.00 of TempPoint2 matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is dead) Not equal to True)) and (((Matching unit) belongs to an ally of (Owner of CS_Caster[TempKey])) Not equal to True)))
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Unit - Cause CS_Caster[TempKey] to damage (Picked unit), dealing CS_Damage[TempKey] damage of attack type Spells and damage type Normal
-------- --------
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)
Custom script: call DestroyGroup(udg_TempGroup)
Preload Spell
Events
Game - UnitIndexEvent becomes Equal to 3.00
Conditions
Actions
Set UnitIndexerEnabled = False
Set TempPoint = (Center of (Playable map area))
Unit - Create 1 CS_DummyCloud for (Owner of CS_Caster[TempKey]) at TempPoint2 facing Default building facing degrees
Set TempUnit = (Last created unit)
-------- --------
-------- To preload abilities and/or buffs, just add them to TempUnit --------
-------- --------
Unit - Add Cloudspiral to TempUnit
-------- --------
-------- The dummy unit's task is now done, it can be removed from the game --------
-------- --------
Unit - Remove TempUnit from the game
Custom script: call RemoveLocation(udg_TempPoint)
Set UnitIndexerEnabled = True


Credits

Credits to Bribe for his Unit Indexer Which allows the use of Indexing for units in GUI; for those just getting use to GUI.


Instructions on how to move into your map :

This spell uses a Unit indexing system, (not created by me)
1. Copy Custom Map script, Top part of triggers
2. Copy Unit Indexer (gen)
3. Copy Abilitiy (Cloudspin) and Unit (Cloudspin Dummy)
4. Copy Cloud Spin int and Cloud Spin loop (gen) and Preload Spell <gen>

Changelog

Minor change to layout of triggers, so that spell shall stop if caster is dead or stunned.
Added Integer, to detect when no spells are running to turn off the trigger.
Changed back to TempPoint and TempPoint2,
Removed CS_CasterPoint. Fixed minor bugs.
Changed the hotkey,
Fixed the same trigger (changed loop order)
Increased Duration of spell to 1.7 with a increase of 1.7.
Changed the hotkey... again
Added new Unit Indexer.
Fixed the Cant Raise Does Not Decay for Dummy
- Made it so the CloudSpin Dummy units do not get a customvalue, this will cut down on the increase of customvalue.
Added new Trigger "Preload Spell"
Rating - 5.00 (1 vote)
(Hover and click)
Moderator Comments
Useful
Maker, 3rd Aug 2011, Cloud Spiral V2.2

Approved. Could be useful ability in custom maps.

This spell is approved and works properly.


Download Cloudspin.w3x
(32.63 KB, 571 Downloads)

Old 07-05-2011, 11:05 AM   #2 (permalink)
Registered User Sverkerman
Twitch.tv/RecSverkerman
 
Sverkerman's Avatar
 
Join Date: Feb 2010
Posts: 1,014
Sverkerman is just really nice (340)Sverkerman is just really nice (340)Sverkerman is just really nice (340)
Nice 1 mate.
Sverkerman is offline   Reply With Quote
Old 07-05-2011, 11:38 AM   #3 (permalink)
Registered User EvilCrizpy
~ Spells Developer ~
 
EvilCrizpy's Avatar
 
Join Date: Jul 2007
Posts: 734
EvilCrizpy is on a distinguished road (71)EvilCrizpy is on a distinguished road (71)
Quote:
Originally Posted by Sverkerman View Post
Nice 1 mate.
Cheers
__________________
EvilCrizpy is offline   Reply With Quote
Old 07-05-2011, 12:22 PM   #4 (permalink)
Forum Moderator Maker
I...make things
 
Maker's Avatar
Resource Moderator
 
Join Date: Mar 2006
Posts: 8,960
Maker has been here far too long (2905)Maker has been here far too long (2905)Maker has been here far too long (2905)Maker has been here far too long (2905)Maker has been here far too long (2905)Maker has been here far too long (2905)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
Comments'

*The first level AoE is really small, I was standing right next to a spider and the spell didn't damage it.
*Remove invulnerability from the dummy, it has Locus which makes it invulnerable.
*Set dummy to Can't raise, does not decay. That way it gets removed from the game sooner.
*Reduce the sight range of dummies.
*Do SpellIndex Equal to 0 check only after you subtract from SpellIndex, not during every loop
*Filter out dead units in the unit group pick.
*Uinits with locust do not have collision, you don't need to turn it off.
*Change the variable names, they are too generic. Give them CS prefix for example.
Maker is offline   Reply With Quote
Old 07-05-2011, 12:23 PM   #5 (permalink)
Registered User 88WaRCraFT3
Go Bother Someone Else :P
 
88WaRCraFT3's Avatar
 
Join Date: Jun 2009
Posts: 1,208
88WaRCraFT3 is a jewel in the rough (215)88WaRCraFT3 is a jewel in the rough (215)88WaRCraFT3 is a jewel in the rough (215)
Nice, but for what you use that jass trigger ? Cause i don't understand it :P
But how much i've seen this reminds me on water shield on youtube, "reminds" which doesn't means it is :P
Gj :)
__________________
88WaRCraFT3 is offline   Reply With Quote
Old 07-05-2011, 02:14 PM   #6 (permalink)
Registered User EvilCrizpy
~ Spells Developer ~
 
EvilCrizpy's Avatar
 
Join Date: Jul 2007
Posts: 734
EvilCrizpy is on a distinguished road (71)EvilCrizpy is on a distinguished road (71)
Quote:
Originally Posted by Maker View Post
Comments'

*The first level AoE is really small, I was standing right next to a spider and the spell didn't damage it.
*Remove invulnerability from the dummy, it has Locus which makes it invulnerable.
*Set dummy to Can't raise, does not decay. That way it gets removed from the game sooner.
*Reduce the sight range of dummies.
*Do SpellIndex Equal to 0 check only after you subtract from SpellIndex, not during every loop
*Filter out dead units in the unit group pick.
*Uinits with locust do not have collision, you don't need to turn it off.
*Change the variable names, they are too generic. Give them CS prefix for example.
Thankyou for your feedback,
i have jsut updated all that you have suggested, tell me if any other "Simple errors" remain that i did not spot.
__________________
EvilCrizpy is offline   Reply With Quote
Old 07-05-2011, 08:29 PM   #7 (permalink)
Registered User Jazztastic
Buddy
 
Jazztastic's Avatar
 
Join Date: Apr 2011
Posts: 956
Jazztastic is just really nice (308)Jazztastic is just really nice (308)
Use the update button instead of deleting the spell everytime and uploading a new one. Yes the update button does work, click refresh after you update to see the changes, THW is weird like that, were it won't update a page with new information until it gets refreshed.
Jazztastic is offline   Reply With Quote
Old 07-05-2011, 09:34 PM   #8 (permalink)
Registered User EvilCrizpy
~ Spells Developer ~
 
EvilCrizpy's Avatar
 
Join Date: Jul 2007
Posts: 734
EvilCrizpy is on a distinguished road (71)EvilCrizpy is on a distinguished road (71)
Quote:
Originally Posted by Beef_Is_Back View Post
Use the update button instead of deleting the spell everytime and uploading a new one. Yes the update button does work, click refresh after you update to see the changes, THW is weird like that, were it won't update a page with new information until it gets refreshed.
I know just sometimes i upload, and refresh and the changes are still not made. Only done it too me once so far...
Anyways, any feedback on the spell?
__________________
EvilCrizpy is offline   Reply With Quote
Old 07-08-2011, 10:13 AM   #9 (permalink)
Registered User Oziris
Everwood ORPG
 
Oziris's Avatar
 
Join Date: Oct 2006
Posts: 4,136
Oziris is a glorious beacon of light (565)Oziris is a glorious beacon of light (565)Oziris is a glorious beacon of light (565)Oziris is a glorious beacon of light (565)Oziris is a glorious beacon of light (565)Oziris is a glorious beacon of light (565)
Looks good and works fine. :)
__________________
Oziris is offline   Reply With Quote
Old 07-12-2011, 04:02 AM   #10 (permalink)
Registered User Death-Blade
Need sound effects...
 
Death-Blade's Avatar
 
Join Date: Feb 2011
Posts: 101
Death-Blade has little to show at this moment (8)
Why I think CS_CasterPoint[Key] is referring to Center of (Playable map area) ???
When I use this spell, the spiral is made at Center of (Playable map area)!!! Can u fix this plz???
I have replaced the function:
Set TempPoint = (CS_CasterPoint[TempKey] offset by CS_Distance[TempKey] towards CS_Angle[TempKey] degrees)
with:
Set TempPoint = ((Position of CS_Caster[Key]) offset by CS_Distance[TempKey] towards CS_Angle[TempKey] degrees)
and it succeeded. That's maybe because you have set 'CS_CasterPoint[Key]' then used 'CS_CasterPoint[TempKey]'
1st Leak
You didn't remove 'CS_CasterPoint[Key]'

2nd Leak
You didn't set 'CS_CasterPoint[TempKey]' to use

Maybe if you put this function in Cloud Spiral Loop:
Set CS_CasterPoint[TempKey] = (Position of CS_Caster[Key])
That will fix the problem.
Don't forget removing locations...

Anyway, it's nice spell!
__________________
The...
Death-Blade is offline   Reply With Quote
Old 07-12-2011, 03:38 PM   #11 (permalink)
Registered User EvilCrizpy
~ Spells Developer ~
 
EvilCrizpy's Avatar
 
Join Date: Jul 2007
Posts: 734
EvilCrizpy is on a distinguished road (71)EvilCrizpy is on a distinguished road (71)
Quote:
Originally Posted by Death-Blade View Post
Why I think CS_CasterPoint[Key] is referring to Center of (Playable map area) ???
When I use this spell, the spiral is made at Center of (Playable map area)!!! Can u fix this plz???
I have replaced the function:
Set TempPoint = (CS_CasterPoint[TempKey] offset by CS_Distance[TempKey] towards CS_Angle[TempKey] degrees)
with:
Set TempPoint = ((Position of CS_Caster[Key]) offset by CS_Distance[TempKey] towards CS_Angle[TempKey] degrees)
and it succeeded. That's maybe because you have set 'CS_CasterPoint[Key]' then used 'CS_CasterPoint[TempKey]'
1st Leak
You didn't remove 'CS_CasterPoint[Key]'

2nd Leak
You didn't set 'CS_CasterPoint[TempKey]' to use

Maybe if you put this function in Cloud Spiral Loop:
Set CS_CasterPoint[TempKey] = (Position of CS_Caster[Key])
That will fix the problem.
Don't forget removing locations...

Anyway, it's nice spell!
Thanks for the feedback,
i have completely removed, CasterPoint. And just added TempPoints.
So that it will be easy to remove the locations without any leaks.
__________________
EvilCrizpy is offline   Reply With Quote
Old 08-02-2011, 01:44 PM   #12 (permalink)
Forum Moderator Bribe
Keep it simple
 
Bribe's Avatar
Spells, Help Zones & JASS Moderator
 
Join Date: Sep 2009
Posts: 5,769
Bribe has a brilliant future (1283)Bribe has a brilliant future (1283)Bribe has a brilliant future (1283)Bribe has a brilliant future (1283)
PayPal Donor: This user has donated to The Hive. 
The updated Unit Indexer is much easier to install if you'd prefer the easiest setup possible. It doesn't require the map header script any more and would encourage more downloads for the spells that use it.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.

Bribe is offline   Reply With Quote
Old 08-02-2011, 10:56 PM   #13 (permalink)
Registered User EvilCrizpy
~ Spells Developer ~
 
EvilCrizpy's Avatar
 
Join Date: Jul 2007
Posts: 734
EvilCrizpy is on a distinguished road (71)EvilCrizpy is on a distinguished road (71)
Quote:
Originally Posted by Bribe View Post
The updated Unit Indexer is much easier to install if you'd prefer the easiest setup possible. It doesn't require the map header script any more and would encourage more downloads for the spells that use it.
Thanks for that,
Updated the spell to use the newly updated Indexer.
Will possibly make different systems/spells using your system to advertise it.
__________________
EvilCrizpy is offline   Reply With Quote
Old 08-21-2011, 03:09 PM   #14 (permalink)
D074M4N
User
 
Join Date: Jun 2011
Posts: 64
D074M4N has little to show at this moment (11)D074M4N has little to show at this moment (11)
Awesome
D074M4N is offline   Reply With Quote
Old 08-21-2011, 06:14 PM   #15 (permalink)
Registered User EvilCrizpy
~ Spells Developer ~
 
EvilCrizpy's Avatar
 
Join Date: Jul 2007
Posts: 734
EvilCrizpy is on a distinguished road (71)EvilCrizpy is on a distinguished road (71)
Thanks;
Going to make some more improvements once i get chance.
__________________
EvilCrizpy is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 12:09 AM.




Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle