making a spell MUI

guneruh

Member
Reaction score
1
hi, i need help with a spell i made based on wow called earth shield, the spell consists that when you recieve damage you will be healed X health, and only happens 1 time each X seconds. i made a trigger so it works, but on multiplayer doesnt works is 2 units have the same buff, this is the trigger i made, and i know why isnt MUI, i would like to know how to make this trigger work for many players at the same time. thanks

Code:
escudo de tierra
    Acontecimientos
        Unidad - A unit Es atacado
    Condiciones
        ((Attacked unit) has buff Earth shield ) Igual a True
    Acciones
        Unidad - Set life of (Attacked unit) to ((Vida of (Attacked unit)) + 800.00)
        Detonador - Turn off (This trigger)
        Wait 4.00 seconds
        Detonador - Turn on (This trigger)
 

Carl-Fredrik

New Member
Reaction score
51
MUI can only be done with JASS... I would help you more but I'm not very good at it, I can only convert it if I have the trigger in the editor...
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
That's a total lie, MUI can be done in GUI and Flare make a tutorial on it here.

Another thing:

Code:
Events
A unit starts the effect of an ability

Conditions

Actions
Cause Triggering Unit to damage Target unit of ability being cast dealing 1337 damage...

That code is MUI.
 

Carl-Fredrik

New Member
Reaction score
51
Well, yeah, but since he used the action that sets life he maybe didn't want for example creeps to drop gold when he uses the ability? You may still be right, I'm kinda beginner and I've heard that it's only possible with JASS... Anyway, I'll read that tutorial!
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
MUI can only be done with JASS... I would help you more but I'm not very good at it, I can only convert it if I have the trigger in the editor...

MUI is multi-instanceable, which means multiple people can use it at once. It is very possible in GUI.

If you have a spell without any waiting time on it, then its MUI. If you have a spell that has waiting time on it, you can use local variables, by using this code:

Code:
local unit udg_variable

That can save the unit that you are using for the spell, and then, it will not interfere. But, if the variable is not a local, they probably will interfere. Its not very hard to learn, just search up locals, and that should be all you need.

_______________________________________________________

As for the spell, my suggestion is you assign a variable for how many charges are left on the Earth Shield. Integer, or a real works just fine. Also the trigger has a problem, the problem is that you are turning off the trigger for four seconds, which will disable it for everybody. You should consider variables for this one, hehe.
 

guneruh

Member
Reaction score
1
but so... what thing i could do to make the trigger work as MUI? if i need a different trigger code it plz
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
Create a boolean based variable, and call it earthUsed, now also make it an array.

Code:
Escudo de Tierra
    Acontecimientos
        Unidad - A unit Es atacado
    Condiciones
        ((Attacked unit) has buff Earth shield ) Igual a True
        earthUsed[Number of tempPlayer] is equal to False
    Acciones
        Custom script: local player udg_tempPlayer
        Set tempPlayer = (Owner of (Attacked Unit))
        Unidad - Set life of (Attacked unit) to ((Vida of (Attacked unit)) + 800.00)
        Set earthUsed[Number of tempPlayer] = True
        Wait 4 seconds
        Set earthUsed[Number of tempPlayer] = False

That should work. Now if you're wondering, why I did this, it will increase functionality, and it will make it so that if one player uses it, it will not affect any other players. Also, it will not interfere because it is MUI, as you can see the "Custom script: local player udg_tempPlayer". That will make the spell not be interfered with by other players, meaning, your Earth Shield spell is effective!
 

guneruh

Member
Reaction score
1
Create a boolean based variable, and call it earthUsed, now also make it an array.

Code:
Escudo de Tierra
    Acontecimientos
        Unidad - A unit Es atacado
    Condiciones
        ((Attacked unit) has buff Earth shield ) Igual a True
        earthUsed[Number of tempPlayer] is equal to False
    Acciones
        Custom script: local player udg_tempPlayer
        Set tempPlayer = (Owner of (Attacked Unit))
        Unidad - Set life of (Attacked unit) to ((Vida of (Attacked unit)) + 800.00)
        Set earthUsed[Number of tempPlayer] = True
        Wait 4 seconds
        Set earthUsed[Number of tempPlayer] = False

That should work. Now if you're wondering, why I did this, it will increase functionality, and it will make it so that if one player uses it, it will not affect any other players. Also, it will not interfere because it is MUI, as you can see the "Custom script: local player udg_tempPlayer". That will make the spell not be interfered with by other players, meaning, your Earth Shield spell is effective!

thx a lot mate ^^
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Even though it would probably work, it would limit the use to one unit per player, making it MPI not MUI. The best MUI sollution would be either follow Flare's tutorial or localize your global variables.

Note that local variables can only be used within the function that they're stated in, so you can't use local variables in a Unit Group loop for example. Also you have to declare local variables at the very beginning of the function.
 

guneruh

Member
Reaction score
1
another thing: where i can find this trigger?
Number of tempPlayer
it should be like: Number of Variable dont?
 

guneruh

Member
Reaction score
1
please i need helo on thast last thing. where i can find that trigger? i cant find Number of tempPlayer :(
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top