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!
im one of the millions on this forum and maybe others that is having an issue with triggers detecting abiliy/spell hit.
i set an example for storm bolt. i had its distance set to a 1000 and speed set to 500. when i used to spell, it was design to remove the remove target from the game. but it instantly moved the target from the game before the missle even hit it.
i tried setting a buff detection every .01 seconds on a seperate trigger, but it didnt detect the buff.
anyone can help me quickly solve my mystery? or have link to a better idea? i need mui not jazzed
There are many ways you can do this. The 1-st 2 ways use GDD (damage detecting system) and the 3-rd is sloppy, but it could work:
1) add a custom buff to the storm bolt ability and with the GDD, detect when the unit takes damage. In conditions add "The unit has buff" and there put your custom buff. And rest should work fine.
2) (This needs 2 triggers) when a unit starts the effect of ability (storm bolt), add the target of ability being cast to unit group. And with GDD, detect when the unit takes damage. In conditions add "The unit is in unit group", "Damage source is equal to (a unit variable, that has been set in the 1-st trigger to the casting unit). Rest should work fine.
3) When a target starts the effect of ability (sotrm bolt), add target of ability being cast to some variable, wait (distance between casting unit and target of ability / storm bolt's speed), then do the actions you want.
In my opinion the 1-st way is the best (and easiest).
1, (As WereElf mentioned) use a custom buff and check if the target has the buff when it takes damage (event from any damage system).
2, Make the missile yourself using a missile system.
3, Make a dummy cast the ability.
Then you can check the damage source of the applied damage and backtrace the original source via indexed variables.
(Event from any damage system, indexes of variables preferably by a unit indexer.)
Any damage detection system will do.
Weep's, Bribe's, looking_for_help's.
Just search their names in the spell section or search for "Damage detection system".
GUI = Graphical User Interface
So GUI is the form how you write the triggers/code. (you click in a interface)
MUI = Multiple Unit Instanceability
MUI is only like a state/beheaviour of certain code.
It is not directly related to any way how you write your code. (JASS or GUI)
It does only mean that your code works for multiple units for multiple players at the same time without bugging.
The Hive Workshop is currently backing up the database, please stand by!
You were sending a message:
Note: most spells that are "instant" (and have no effect over time) and use only 1 trigger are MUI.
Personally I am using 2 ways to convert GUI to MUI:
1) For spells using only 1 trigger and "wait" commands: I'm using "custom script" and adding local variables to my triggers. Then I'm adding the values of my glabal variables to the local ones before the "wait", and then I'm giving back the global variables the values of the local ones (after the "wait")
2) For triggers that use more than 1 trigger: I'm using array variables.
a) Most of my spells are MPI = each player can cast them at the same time, but each player can be casting them only 1-ce at a time. Doing it this way - you need your variables to have 13 "powers" (or 12 if you are using "-1" in indexing them), and use player number as index (for example "TempPoint[PlayerNumber(Owner of (Triggering unit))] - or you can have a TempPlayer variable and do "TempPoint[PlayerNumber(TempPlayer)]").
b) This method can also be used if each player can use the spell up to N times at once.
Example: set count[PlayerNumber(TempPlayer)]=(count[PlayerNumber(TempPlayer)+1) (this counts how many times has the player used the spell), and then use: TempPoint[((count-1)*12)+PlayerNumber(TempPlayer)]
in this case, TempPoint would need to have a bigger array.
c) You could also do (this one is too long to explain, so I will just give you an example of something I'm using):
Concentration Acti
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Concentration
Actions
Custom script: local location l = GetSpellTargetLoc()
Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
Set concentration_effect[(Player number of (Owner of (Triggering unit)))] = (Last created special effect)
Set concentration_check[(Player number of (Owner of (Triggering unit)))] = True
Wait (1.00 + mode) seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
concentration_check[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Set concentration_started[(Player number of (Owner of (Triggering unit)))] = True
Set concentration_count = (concentration_count + 1.00)
Custom script: set udg_concentration_point[R2I(udg_concentration_count)] = l
Unit - Set the custom value of (Triggering unit) to (Integer(concentration_count))
Unit Group - Add (Triggering unit) to conentration_group
Else - Actions
Concentration Deacti
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Concentration
Actions
Special Effect - Destroy concentration_effect[(Player number of (Owner of (Triggering unit)))]
Set concentration_check[(Player number of (Owner of (Triggering unit)))] = False
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
concentration_started[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Triggering unit)) Less than (Integer(concentration_count))
Then - Actions
For each (Integer conc_deact_loop) from 1 to ((Integer(concentration_count)) - ((Custom value of (Triggering unit)) - 1)), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
conc_deact_loop Equal to ((Integer(concentration_count)) - ((Custom value of (Triggering unit)) - 1))
Set concentration_point[((Custom value of (Triggering unit)) + (conc_deact_loop - 1))] = concentration_point[((Custom value of (Triggering unit)) + conc_deact_loop)]
Unit Group - Pick every unit in conentration_group 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 ((Custom value of (Triggering unit)) + conc_deact_loop)
Then - Actions
Unit - Set the custom value of (Picked unit) to ((Custom value of (Triggering unit)) + (conc_deact_loop - 1))
Unit Group - Remove (Triggering unit) from conentration_group
Set concentration_started[(Player number of (Owner of (Triggering unit)))] = False
Set concentration_count = (concentration_count - 1.00)
Else - Actions
I didn't include the spell effect here. You can make it whatever you want.
Just so you know, these triggers are a bit more complex than what you'd need for most spells, as my spell has 2 parts: 1-st = chanelling with no effect, 2-nd = chanelling with effect.
However, the overal idea is this:
If you have 4 units casting the same spell at the same time:
if "2" stops chanelling - "2" gets the value (and variables) of "3", "3" gets the variables from "4" and "4" gets destroyed.
EDIT: The spell in (2.c) is MPI, not MUI, because the boolean "concentration_started" is using the player's number and ranges from 0 to 12, if I really wanted to make it MUI, I'd have to change its index to [counentration_count] instead. (My skill is meant to be MPI tho, I've made the deactivation trigger like this, because the effect trigger required it)
EDIT 2:
I remembered there is a 3-rd way to make spells MUI, but this is used for simpler spells:
3) Add the unit, under the effect of ability in a unit group. And:
a) If it's a buff type spell: another trigger is checking every 0,5-1 seconds if the units in the unit group have the buff. If they don't - it removes the benefits of the buff and removes them from the group.
b) If it's a damage over time spell (or some effect that occures every x seconds): another trigger, that runs every x seconds (0,5-2) selects all the units in the unit group and applies the effect/damage. When the buff is gone - it removes them from the group.
c) If it's an event buff (for example when a unit casts a spell - it damages it): add event "a unit starts the effect of ability" and as conditions add "triggering unit has buff", and then do the actions you want. You don't really need unit groups for this one, unless the ability has several levels.
There are other types as well, but I think this will be enough for your needs
"Personally I am using 2 ways to convert GUI to MUI:"
GUI and MUI are two completely separate things.
You cant convert GUI to MUI or the other way around.
GUI is used in terms of Triggers where you just click on the thing that you want.
Scripting (in JASS code in WE) is where you instead of click the action you want, have to write the name of the function instead.
MUI is a classification to tell that something works for multiple units at the same moment.
MPI is a classification to tell that something works for multiple players at the same moment.
Nothing is pretty much neither of both.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.