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

Sphere question

Status
Not open for further replies.
Hi Hivers! :grin:
How do I do this; when Kael/Bloodmage casts a spell 1 of his sphere will disappear and will return after awhile... Thanks! :grin:

2 ways:
1) Special Effect - based on trigger.
2) 3 Sphare abilities - based on trigger.
Both ways require a timer ability which can be inside of spell book (disabled) and give it to random unit upon initiation.
Both ways can be done with unlimited ammount of sphare effect but requires as much in abilities or in special effect varries.

Trigger: unit cast an ability
Condition: unit type was bloodmage
actions:
1) remove special effect named SE from voker
2) remove ability sphare_1 from voker
Add bloodmage into unitgroup1
add timer(ability) to casting unit
turn on Trigger per second

Trigger per second: Trigger period of 1 second
Actions: pick all units in unitgroup1 and do{
if (timer level is 1){
1) special effect: add special effect
1) special effect: set last created special = SE
}
else
reduce level of timer for picked unit
}
ALTERNATIVE
Action: pick all units in unitgroup1 and do{
if (timer level is 1){
2) Ability - add ability sphare to picked unit
}
else
reduce level of timer for picked unit
}
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
There's actually no need to Print Screen, as the hive has a trigger-code built-in :)
You can copy a trigger (right-click on the trigger title above "Events" and select "Copy as text"), write [trigger], paste the text and then write [/trigger].
It will show up beautifully.


The Blood Mage has an ability called "Sphere", this ability has 3 attachments by default.
Now, if you copy/paste that ability 3 times, you can change them so they have 3, 2 and 1 spheres respectively (or you can use the standard ability for 3 Spheres, but I personally dislike that).

If the blood mage casts an ability and he currently has the Sphere (3)-ability, then remove that and give him the Sphere (2)-ability.
Do this for all the spheres.
  • Remove Spheres
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Blood Mage
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Sphere (3) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Remove Sphere (3) from (Triggering unit)
          • Unit - Add Sphere (2) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Sphere (2) for (Triggering unit)) Equal to 1
            • Then - Actions
              • Unit - Remove Sphere (2) from (Triggering unit)
              • Unit - Add Sphere (1) to (Triggering unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Sphere (1) for (Triggering unit)) Equal to 1
                • Then - Actions
                  • Unit - Remove Sphere (1) from (Triggering unit)
                • Else - Actions
Now the timer-part can be a lot more difficult and I am going to need more information for that.
Specifically:
- Can a player ever have more than 1 Blood mage-type unit (or any other unit for whom you wish to remove spheres)?
- Can more than 1 player have such a unit?

Depending on your answers, this could go from quite easy to quite difficult :)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Well, if there can only ever be 1 Blood Mage, then it becomes quite easy :)

So after you copy/pasted all those Sphere-abilities (and edited them: simply set Art - Target Attachments to the number of spheres you want to see), add these triggers:
  • Remove Spheres
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Blood Mage
    • Actions
      • Set heroBloodMage = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Spheres (3) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Spheres (2) to heroBloodMage
          • Unit - Remove Spheres (3) from heroBloodMage
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Spheres (2) for (Triggering unit)) Equal to 1
            • Then - Actions
              • Unit - Add Spheres (1) to heroBloodMage
              • Unit - Remove Spheres (2) from heroBloodMage
            • Else - Actions
              • Unit - Remove Spheres (1) from heroBloodMage
      • Set sphereTimer = 5.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Regain Spheres <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Regain Spheres <gen>
        • Else - Actions
Note: this will reset the timer every time he casts a spell. If you want the timer to continue, then drag the action "Set sphereTimer = 5.00" to "Then - Actions" (right above the action which turns on the other trigger).

Initially off:
  • Regain Spheres
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set sphereTimer = (sphereTimer - 0.50)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • sphereTimer Equal to 0.00
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Spheres (2) for heroBloodMage) Equal to 1
            • Then - Actions
              • Unit - Remove Spheres (2) from heroBloodMage
              • Unit - Add Spheres (3) to heroBloodMage
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Spheres (1) for heroBloodMage) Equal to 1
                • Then - Actions
                  • Unit - Remove Spheres (1) from heroBloodMage
                  • Unit - Add Spheres (2) to heroBloodMage
                • Else - Actions
                  • Unit - Add Spheres (1) to heroBloodMage
              • Set sphereTimer = 5.00
        • Else - Actions
As said above, this trigger must be initially off (right-click it and deselect "Initially On").

To set the timer to something different, change "Set sphereTimer = 5.00" to anything you want in both triggers (there is 1 such action in both of them).
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I think an interval of 1.00 second would not hurt, Apo.
Logically, we would count as 1... 2... 3...
Never 0.5... 1.0... 1.5...

Although if you really want to keep realistic count, you should make it 0.01 second per check, but that would lag the game if it prolongs wouldn't it ?

So an interval of 1.00 second is okay in this case.
 
Level 12
Joined
May 12, 2012
Messages
631
I'm harding a hard time finding what the Variable Type of the variables are for I'm new to this.. if there is a map it would be excellent for it has this system "Automatically create unknown variables while pasting triggers" (Sorry for being such a noob >_<)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I think an interval of 1.00 second would not hurt, Apo.
Logically, we would count as 1... 2... 3...
Never 0.5... 1.0... 1.5...

Although if you really want to keep realistic count, you should make it 0.01 second per check, but that would lag the game if it prolongs wouldn't it ?

So an interval of 1.00 second is okay in this case.
0.01 would be silly and is not worth mentioning at all, you know that :p

You're right this time, since it's a single-unit interval, but I'm used to a 0.50 interval because it has double the accuracy for virtually no downsides.
With an interval of 1.00, you sometimes have to wait only 4 seconds (if it is cast right before the tick). Of course, these are 'rare' cases (about 1/100 I guess? :p).

But yes, this is single-unit and the timer starts once the unit casts something, so it will always be correct.
But in that case, you could even use an X-second interval (where X is the time you want to wait).
Whatever, I'll just put 1.00 in there.


Map attached.
 

Attachments

  • Spheres Remove-Regain.w3x
    14.4 KB · Views: 47
THANKS FOR THE HELP ap0calypse!! :grin: +Rep to all

ap0calypse the way you solved it was amazing, but then again its the ap0calypse :D. Good to see you again old friend.
Zyn, if you don't want the hero to lose sphares when he use items, make in conditions the 4 hero spells that he has, overwize using healing salve on 3 allies will remove his sphares for 15 seconds...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Well, there are 3 abilities that represent the spheres left.
If the hero has none of these abilities, he also has no spheres left.

So you have 2 options:

1) Use 3 conditions: Level of (Sphere abilities) = 0
2) Create a new variable (hasSpheres or something), set it to "false" when you remove the last ability, set it to true when regaining a sphere.
Then just use "hasSpheres Equals to false" whenever you want to check if the hero has spheres or not.

2 is actually the easiest to work with if you need to do this a lot (like, more than once).
 
Level 12
Joined
May 12, 2012
Messages
631
I'm having a hard time figuring out where and what to put the condition so let me post the trigger here for you too see clearly :)
  • Remove Spheres
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Kael
    • Actions
      • Set heroBloodMage = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Shattered Universe
          • (Level of Sphere (Exort) (Fire) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Remove Sphere (Exort) (Fire) from heroBloodMage
        • Else - Actions
          • Set sphereTimer_Fire = 25.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ice Bolt
          • (Level of Sphere (Quas) (Ice) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Remove Sphere (Quas) (Ice) from heroBloodMage
        • Else - Actions
          • Set sphereTimer_Ice = 20.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Extended Lightning
          • (Level of Sphere (Wex) (Storm) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Remove Sphere (Wex) (Storm) from heroBloodMage
        • Else - Actions
          • Set sphereTimer_Storm = 23.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Regain Spheres <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Regain Spheres <gen>
        • Else - Actions
As you can see I modified it a bit

  • Regain Spheres
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Sphere (Exort) (Fire) for heroBloodMage) Equal to 0
        • Then - Actions
          • Set sphereTimer_Fire = (sphereTimer_Fire - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • sphereTimer_Fire Equal to 0.00
            • Then - Actions
              • Unit - Add Sphere (Exort) (Fire) to heroBloodMage
            • Else - Actions
              • Do nothing
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Sphere (Quas) (Ice) for heroBloodMage) Equal to 0
        • Then - Actions
          • Set sphereTimer_Ice = (sphereTimer_Ice - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • sphereTimer_Ice Equal to 0.00
            • Then - Actions
              • Unit - Add Sphere (Quas) (Ice) to heroBloodMage
            • Else - Actions
              • Do nothing
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Sphere (Wex) (Storm) for heroBloodMage) Equal to 0
        • Then - Actions
          • Set sphereTimer_Storm = (sphereTimer_Storm - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • sphereTimer_Storm Equal to 0.00
            • Then - Actions
              • Unit - Add Sphere (Wex) (Storm) to heroBloodMage
            • Else - Actions
              • Do nothing
        • Else - Actions
The Remove Sphere works perfectly but unfortunately the Regain doesn't I figured of posting the Remove for you to see if something went wrong :grin:

I'm finally a Grunt :D


Updated the Triggering Unit variable
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
Geries said:
Doesn't the "sphere" ability that (blood)mages have by default do this? :p
Yes, but I figure that he needs it for some kind of system (like 'you cannot cast a spell unless you have enough orbs').
For that, you need to trigger it.
There are many examples like this in Warcraft, where it does something by default, but if you want an additional feature you have to trigger the entire thing yourself :p


You used "Triggering Unit" in the Regain Spheres-trigger. You should use the variable "heroBloodMage" (it may be my own mistake, I don't know).

Congratulations on not being a peon anymore :D
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Well, the only other thing I can think of is that you remove all the "Trigger - Turn off (This Trigger)"-actions.
If one orb is regained, then the others will not respawn until you cast another spell. But if none of the orb respawns, then I may need the map to do some debugging (or you could do it yourself :p).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You should never use "Do Nothing" :p (it doesn't glitch the trigger, it's just useless in every way, removing it is always the better option).

Well... the only other thing I can think of right now is that the "Regain Spheres" isn't initially off (which would make it bug at first, but should fix itself after a few casts).
It's easier if I can get the map to debug it (debugging something like this usually doesn't take long, then I can immediately tell what's wrong instead of staring at a trigger for a while).
 
Level 12
Joined
May 12, 2012
Messages
631
I managed to make it work by using waits... here is the trigger
  • Remove Spheres
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Kael
    • Actions
      • Set heroBloodMage = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Shattered Universe
          • (Level of Sphere (Exort) (Fire) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Remove Sphere (Exort) (Fire) from heroBloodMage
          • Wait 25.00 seconds
          • Unit - Add Sphere (Exort) (Fire) to heroBloodMage
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ice Bolt
          • (Level of Sphere (Quas) (Ice) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Remove Sphere (Quas) (Ice) from heroBloodMage
          • Wait 20.00 seconds
          • Unit - Add Sphere (Quas) (Ice) to heroBloodMage
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Extended Lightning
          • (Level of Sphere (Wex) (Storm) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Remove Sphere (Wex) (Storm) from heroBloodMage
          • Wait 23.00 seconds
          • Unit - Add Sphere (Wex) (Storm) to heroBloodMage
        • Else - Actions
Are there any downside of using waits, cause you didn't use it so I figured that it may be causing some errors...
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
It is one of the built in WarCraft III abilites which all Bloodmage heroes use. Sadly it is only visual.

For example, cast Flame Strike and you will see one of the orbs fly away and make the fire. Cast it many times and he will deplete his orbs. Nothing stops you from casting it with no orbs.
 
I just can't ignore a guy who give me random rep
I was given a REP! IT'S THE APPOCALIPS!!!
:grin::wink::thumbs_up::eekani::xxd::fp:
ATTACHED: Version 2 of the map, making you lose sphares for 5 seconds (changeable) , press ESC to revive hero and refresh his skills, the doom is actually my addition: it work the other way arround, instead of losing a spare you gain special spare for 5 seconds.
Tell me if it's still not fit your map.
http://www.hiveworkshop.com/forums/attachment.php?attachmentid=117047&stc=1&d=1345441758

Edit: it also gonna be funny if you make the cooldown of each sphare match the missing sphere timer :D so u can "SEE" when your spell finished cooldown , and about ultimates , for the duration instead :D so you can SEE 2 times that they are active :D thou doom lasts forever :D
 

Attachments

  • BUR V2.w3x
    16 KB · Views: 80
Level 28
Joined
Jan 26, 2007
Messages
4,789
Well, best_player_88 pretty much nailed it :p
There are only 2 things that could have been better.
The first one is that is adding a fourth orb won't work because the blood mage only has 3 attachment points to put the orbs in (sprite,first-third). Of course, it's possible to attach 2 orbs on the same attachment point, but it wouldn't look that great.
The second one is that if you have multiple if-then-elses (ITE's) and you're certain that if ITE 1 is true, then the rest is false, you should put the others in the else-section.
  • -------- SomeInteger = integer between 0 and 2 --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 0
    • Then - Actions
      • -------- Integer == 0 --------
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SomeInteger Equal to 1
        • Then - Actions
          • -------- Integer == 1 --------
        • Else - Actions
          • -------- Integer == 2 --------
As opposed to...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 0
    • Then - Actions
      • -------- Integer == 0 --------
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 1
    • Then - Actions
      • -------- Integer == 1 --------
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 2
    • Then - Actions
      • -------- Integer == 2 --------
    • Else - Actions
If the hero does not have the correct orb, simply order him to stop (Unit - Order unit with no target).
This won't work for a few spells (such as wind walk I believe), but changing the event to "begins channeling" should eliminate a few of those.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Spheres (fire) (2) for (Triggering unit)) Equal to 0
    • Then - Actions
      • Unit - Order heroBloodMage to Stop
    • Else - Actions
      • Unit - Remove Spheres (fire) (2) from heroBloodMage
      • Set sphereTimer[2] = 5.00
 
Well, best_player_88 pretty much nailed it :p
There are only 2 things that could have been better.
The first one is that is adding a fourth orb won't work because the blood mage only has 3 attachment points to put the orbs in (sprite,first-third). Of course, it's possible to attach 2 orbs on the same attachment point, but it wouldn't look that great.
The second one is that if you have multiple if-then-elses (ITE's) and you're certain that if ITE 1 is true, then the rest is false, you should put the others in the else-section.
  • -------- SomeInteger = integer between 0 and 2 --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 0
    • Then - Actions
      • -------- Integer == 0 --------
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SomeInteger Equal to 1
        • Then - Actions
          • -------- Integer == 1 --------
        • Else - Actions
          • -------- Integer == 2 --------
As opposed to...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 0
    • Then - Actions
      • -------- Integer == 0 --------
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 1
    • Then - Actions
      • -------- Integer == 1 --------
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SomeInteger Equal to 2
    • Then - Actions
      • -------- Integer == 2 --------
    • Else - Actions
If the hero does not have the correct orb, simply order him to stop (Unit - Order unit with no target).
This won't work for a few spells (such as wind walk I believe), but changing the event to "begins channeling" should eliminate a few of those.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Spheres (fire) (2) for (Triggering unit)) Equal to 0
    • Then - Actions
      • Unit - Order heroBloodMage to Stop
    • Else - Actions
      • Unit - Remove Spheres (fire) (2) from heroBloodMage
      • Set sphereTimer[2] = 5.00
You done it very well, just wanted to say about the the "if not": I was using it once, and since I overdid it, the map crushed: if not:ifnot: ifnot: on the 10 time it just crushed my map. unfixedable other than this methode of parting if: if: if: if: x1000 times won't crush, since I got used to it, I don't use ifnot anymore. And about the spells, Whatever spell that done immidiatly, without need of TARGETING, will be done instantly so stop wont effect them. And some spells that are stopped immdiatly will still make your hero lose the mana for the try, but Im not sure which spells exactly.
 
Level 12
Joined
May 12, 2012
Messages
631
By the way, I managed to create abilities with Sphere Requirement thanks to this:
If the hero does not have the correct orb, simply order him to stop (Unit - Order unit with no target).
This won't work for a few spells (such as wind walk I believe), but changing the event to "begins channeling" should eliminate a few of those.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Spheres (fire) (2) for (Triggering unit)) Equal to 0
    • Then - Actions
      • Unit - Order heroBloodMage to Stop
    • Else - Actions
      • Unit - Remove Spheres (fire) (2) from heroBloodMage
      • Set sphereTimer[2] = 5.00
THANKS FOR YOUR HELP GUYS!! :grin::grin::grin:
 
Status
Not open for further replies.
Top