Mui

hasslarn

New Member
Reaction score
20
Hello , how can i make this trigger(s) MUI?

The trigger does like this
whenever a hero die hes getting a spirit and a grave then he gots to move the spirit to the grave and then revive the hero at that pos.

Trigger:
  • Dead
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Owner of (Dying unit)) controller) Equal to User
    • Actions
      • Set Hero = (Dying unit)
      • Set Deadpos = (Center of Spawn Region <gen>)
      • Set Herodead = (Position of (Dying unit))
      • Unit - Create 1 Spirit of Paladin for (Owner of (Dying unit)) at Deadpos facing Default building facing degrees
      • Camera - Pan camera for (Owner of Hero) to Deadpos over 3.00 seconds
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
      • Set Spirit = (Last created unit)
      • Unit - Add Dead Hero to (Last created unit)
      • Unit - Add Ping Corpes to (Last created unit)
      • Unit - Create 1 (Unit-type of Hero) for Neutral Passive at Herodead facing Default building facing degrees
      • Animation - Play (Last created unit)'s death animation
      • Unit - Add Invulnerable (Neutral) to (Last created unit)
      • Unit - Pause (Last created unit)
      • Set corpes = (Last created unit)
      • Custom script: call RemoveLocation (udg_Deadpos)
      • Custom script: call RemoveLocation (udg_Herodead)



Trigger:
  • add abillity
    • Events
      • Time - Every 0.5 seconds of game time
    • Conditions
    • Actions
      • Set unitgr = (Units within 500.00 of (Position of corpes))
      • Unit Group - Pick every unit in unitgr and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Spirit of Paladin
            • Then - Actions
              • Unit - Add Revive to (Picked unit)
              • Unit - Remove Ping Corpes from (Picked unit)
              • Unit - Remove Dead Hero from (Picked unit)
            • Else - Actions
              • Custom script: call DestroyGroup (udg_unitgr)



Trigger:
  • revive
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Revive
    • Actions
      • Set Herodead = (Position of corpes)
      • Hero - Instantly revive Hero at Herodead, Show revival graphics
      • Unit - Set mana of Hero to 50.00%
      • Unit - Set life of Hero to 50.00%
      • Unit - Remove corpes from the game
      • Unit - Remove Spirit from the game
      • Set Hero = No unit
      • Set corpes = No unit
      • Set Spirit = No unit
      • Custom script: call RemoveLocation (udg_Herodead)



Trigger:
  • Spell
    • Events
      • Unit - A unit Finishes reviving
    • Conditions
      • (Reviving Hero) Equal to Hero
    • Actions
      • Set Herodead = (Position of corpes)
      • Unit - Create 1 DUMMY for (Owner of Hero) at Herodead facing Default building facing degrees
      • Unit - Add Protection to (Last created unit)
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Herodead)



Trigger:
  • Protection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Protection
    • Actions
      • Set protect = (Target unit of ability being cast)
      • Unit - Add Invulnerable (Neutral) to protect
      • Wait 10.00 seconds
      • Unit - Remove Invulnerable (Neutral) from protect
      • Set protect = No unit





+rep for helpers.
 

simonake

New Member
Reaction score
72
Mind of Jass?

It's simple, add Corps and Protect to unit group and call the group then use (Picked unit). Maybe you should do it MPI?

Mind if i do it MPI?
 

elmstfreddie

The Finglonger
Reaction score
203
You could just simplify it, and that'd make it MUI too.

All you need to do is instantly revive (without effects) the dying hero, pause it, and recolourise it (so it looks dead/like a ghost/whatever), then create a spirit for the player. When any spirit unit casts revive, check to make sure that the spirit and target are owned by the same player, and that the target is a hero. Then, remove the casting unit, and unpause the target. As for invulnerability... Maybe you should just increase the armour increase effect from inner fire so that it makes the armour so much they barely (or at all) damage the hero. I find invulnerability on revives kind of stupid anyways...

And hey, that takes it down to two triggers in the process :thup:
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Mind of Jass?

It's simple, add Corps and Protect to unit group and call the group then use (Picked unit). Maybe you should do it MPI?

Mind if i do it MPI?

If u make it MPI, y u dun make it MUI instead?
 

AgentPaper

From the depths, I come.
Reaction score
107
Elms' suggestion is probably the best one. In this case, it seems like it would be simpler to just change the trigger to be simpler, which would also make it MUI and MPI. The easiest way that I can think of:

When the hero dies, pause it, set it's life to 1, make it invulnerable, and tell it to play it's death animation. Then, create a "spirit" unit wherever you want it, under the control of the player. When the spirit uses it's revive ability on the hero, check that it's the same player, and then destroy the spirit, unpause the hero, and remove the invulnerable ability. (If you want the hero to be invulnerable for a few seconds, just wait a few seconds to remove the invulnerable ability)

Make sure you have the "revive" ability heal the hero for however much you want him to come back with, minus 1. If you want the hero to come back with a percentage of health, just add that to the trigger that runs when he's revived.
 

hasslarn

New Member
Reaction score
20
simonake: What is MPI?

To the rest i will try making it elm and agentpapers way. Thanks for the ideas and posts! and the quick replys! :)


Edit: I tryed doing like u guys said. but it only revives the hero that died last.

Trigger:
  • Dead
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Owner of (Dying unit)) controller) Equal to User
    • Actions
      • Set Hero = (Dying unit)
      • Set Deadpos = (Center of Spawn Region <gen>)
      • Set Herodead = (Position of (Dying unit))
      • Unit - Create 1 Spirit of Paladin for (Owner of (Dying unit)) at Deadpos facing Default building facing degrees
      • Camera - Pan camera for (Owner of Hero) to Deadpos over 1.00 seconds
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
      • Set Spirit = (Last created unit)
      • Hero - Instantly revive Hero at Herodead, Hide revival graphics
      • Unit - Pause Hero
      • Unit - Add Dead Hero to Hero
      • Unit - Add Invulnerable (Neutral) to Hero
      • Unit - Set life of Hero to 0.50%
      • Animation - Play Hero's death animation
      • Set corpes = Hero
      • Custom script: call RemoveLocation (udg_Deadpos)
      • Custom script: call RemoveLocation (udg_Herodead)



Trigger:
  • add abillity
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set unitgr = (Units within 500.00 of (Position of corpes))
      • Unit Group - Pick every unit in unitgr and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Spirit of Paladin
            • Then - Actions
              • Unit - Add Revive to (Picked unit)
              • Unit - Remove Dead Hero from (Picked unit)
              • Unit - Remove Dead Hero from (Picked unit)
              • Custom script: call DestroyGroup (udg_unitgr)
            • Else - Actions



Trigger:
  • revive
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Revive
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Casting unit)) Equal to (Owner of corpes)
        • Then - Actions
          • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Set mana of (Target unit of ability being cast) to 50.00%
          • Unit - Set life of (Target unit of ability being cast) to 50.00%
          • Unit - Remove (Casting unit) from the game
          • Animation - Reset (Target unit of ability being cast)'s animation
          • Unit - Remove Dead Hero from (Target unit of ability being cast)
          • Unit - Unpause corpes
          • Wait 5.00 seconds
          • Unit - Remove Invulnerable (Neutral) from corpes
          • Custom script: call RemoveLocation (udg_Herodead)
        • Else - Actions
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>What is MPI?
Multi-Player Instanceable
 

crazyfanatic

New Member
Reaction score
20
Just add the variables Array and set XXX[Player number of(owner of(triggering unit))] and it will work fine.
 

AgentPaper

From the depths, I come.
Reaction score
107
Trigger:
  • Dead
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit - Create 1 Spirit of Paladin for (Owner of (Dying unit)) at (Center of Spawn Region <gen>) facing Default building facing degrees
      • Camera - Pan camera for (Owner of Hero) to (Center of Spawn Region <gen>) over 1.00 seconds
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
      • Hero - Instantly revive (Dying unit) at Herodead, Hide revival graphics
      • Unit - Pause (Dying unit)
      • Unit - Add Invulnerable (Neutral) to (Dying unit)
      • Unit - Set life of (Dying unit) to 0.50%
      • Animation - Play (Dying unit)'s death animation



Trigger:
  • revive
    • Events
      • Unit - A unit finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Revive
      • (Owner of (Casting unit)) Equal to (Owner of (Target unit of ability being cast))
      • ((Target unit of ability being cast) is A Hero) Equal to True
    • Actions
      • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set mana of (Target unit of ability being cast) to 50.00%
      • Unit - Set life of (Target unit of ability being cast) to 50.00%
      • Unit - Remove (Casting unit) from the game
      • Animation - Reset (Target unit of ability being cast)'s animation
      • Unit - Unpause (Target unit of ability being cast)
      • Wait 5.00 seconds
      • Unit - Remove Invulnerable (Neutral) from (Target unit of ability being cast)


Revive should be a spell with a range of 500.
You're making this a lot more complicated than it needs to be. The number 1 rule of any type of programming is to keep it as simple and efficient as possible. For example you're setting variables that don't need to be set. If the trigger was really long, then it might be helpful (and more efficient coding) to save the hero to a unit variable, but doing so with such a short code is just a waste. The default variables like (Dying Unit) are also already local variables, which means that if the trigger runs ten times in a second, it will also create ten (Dying Unit) variables, with each hero and unique to each instance of the trigger, which makes it MUI and MPI. If you use a variable, though, then it'll just overwrite the variable ten times. (assuming the trigger is long enough, or has any sort of wait time) It is possible to make your own local variables, but like I said, it's not worth it for smaller bits of code.

MUI means that a trigger works with different units at the same time, while MPI means it works with different players at the same time. They don't necessarily go hand-in-hand. For example, if your map only has a single hero per player, the trigger doesn't need to be MUI, just MPI. (as in, it'll only work for 1 hero for each player) If your map has only one player with heroes, but a lot of them, then the trigger needs to be MUI, but not MPI.
 

jig7c

Stop reading me...-statement
Reaction score
123
MUI - multi unit instanceable, multiple units can do it during gameplay
MPI - multi player instanceable, multiple players can do it during gameplay
 

hasslarn

New Member
Reaction score
20
agent , you'r triggers dosent work :/

it dosent unpause the unit or reset its animation or removing the Inuvrl.
 

AgentPaper

From the depths, I come.
Reaction score
107
What ability are you using to revive with? And could you post the exact trigger you used?
 

hasslarn

New Member
Reaction score
20
What ability are you using to revive with? And could you post the exact trigger you used?

Inner fire

Trigger:
  • Dead Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit - Create 1 Spirit of Paladin for (Owner of (Dying unit)) at (Center of Spawn Region <gen>) facing Default building facing degrees
      • Camera - Pan camera for (Owner of (Dying unit)) to (Center of Spawn Region <gen>) over 0.00 seconds
      • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Hide revival graphics
      • Unit - Pause (Dying unit)
      • Unit - Set life of (Dying unit) to 0.50%
      • Unit - Add Invulnerable (Neutral) to (Dying unit)
      • Animation - Play (Dying unit)'s death animation



Trigger:
  • revive Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Revive
      • (Owner of (Casting unit)) Equal to (Owner of (Target unit of ability being cast))
      • ((Target unit of ability being cast) is A Hero) Equal to True
    • Actions
      • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set mana of (Target unit of ability being cast) to 50.00%
      • Unit - Set life of (Target unit of ability being cast) to 50.00%
      • Unit - Remove (Casting unit) from the game
      • Animation - Reset (Target unit of ability being cast)'s animation
      • Unit - Unpause (Target unit of ability being cast)
      • Wait 5.00 seconds
      • Unit - Remove Invulnerable (Neutral) from (Target unit of ability being cast)



just as u told me. The thing is eighter the revive doesnt work or it will overwrite it self.

Thanks for you'r help so far Agent! i realy appreciate it.
 

AgentPaper

From the depths, I come.
Reaction score
107
Just to check, can your custom ability target invulnerable? Also, try having each trigger send a text message whenever it's run, to make sure each trigger is running.

Edit: Just tested this out, the issue seems to come from removing the casting unit. You can fix this by just having the remove action be the last line. The problem comes with removing the invulnerable, which you would have to do before the wait, or you'd have to not remove the casting unit until after the wait.

Edit: Edit: Since you're using Inner Fire as a base ability anyways, I found that you can just have it add a ridiculous amount of armor, reduce the duration to 5 seconds, (or however long) and use that as the temporary invulnerability. Unfortunately, since we're pausing the unit, the ability doesn't work normally, but if you reduce the cooldown to 0, you can just order the spirit to cast inner fire again after unpausing it. After these tweaks, here's what I had for the second bit of code:

Trigger:
  • Revive
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Inner Fire
    • Actions
      • Unit - Unpause (Target unit of ability being cast)
      • Unit - Order (Casting unit) to Human Priest - Inner Fire (Target unit of ability being cast)
      • Unit - Set life of (Target unit of ability being cast) to 50.00%
      • Unit - Set mana of (Target unit of ability being cast) to 50.00%
      • Unit - Remove Invulnerable (Neutral) from (Target unit of ability being cast)
      • Wait 0.50 game-time seconds
      • Unit - Remove (Casting unit) from the game


And it worked fine. There's a couple bugs, like the hero still regenerating life while he's dead (which is odd, since he's paused) but those should be simple enough to fix.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Change all your casting unit to triggering unit. Casting unit is slower then triggering unit and more risky.
 

AgentPaper

From the depths, I come.
Reaction score
107
Good suggestions, but you should just edit in anything you need to add, instead of double-posting. Especially when it's only been a few minutes and there's no replies. ;)
 

hasslarn

New Member
Reaction score
20
Thanks alot Agent! +rep to you! worth more than one!

Edit: Now one last question i forgot to ask , for instanse if your playing an rpg there are going to be alot of towns , how can i make it so that the player when entering a new city gets a new place where the spirit would be created

Ex.
Hasslarn enters Thehelpers city
New Spawn point for spirit

Hasslarn enters Thehiveworkshop City
New Spawn point for spirit.
if that is even possible with GUI.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top