Puppet Master Spell MUI Problem

Igor_Z

You can change this now in User CP.
Reaction score
61
Hello, I made a spell called Puppet Master.
Description:
Whenever the Puppet Master attacks he has a chance to create a duplicate of himself. Limit of 3,5,7 images. Duplicates last 20 seconds. The illusions can also duplicate themselves.

So as you can see the illusions can duplicate themselves and I am really weak when it comes to many units doing the same thing at the same time so I'll ask someone kind to modify ONLY my forth and fifth triggers and convert it to MUI.
P.S: The spell works fine for my hero which means that it will work good for my illusions too but need those 2 triggers in MUI...

Triggers:

Trigger:
  • PM Add at beginning
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set PM_TempGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in PM_TempGroup and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to PM_TakeDmgGroup
          • Trigger - Add to Puppet Master <gen> the event (Unit - (Picked unit) Takes damage)
          • Trigger - Add to PM Illusions Juxta <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup(udg_PM_TempGroup)
      • Custom script: call DestroyTrigger(gg_trg_PM_Add_at_beginning)


Trigger:
  • PM DMG Detector
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is in PM_TakeDmgGroup) Equal to False
    • Actions
      • Unit Group - Add (Triggering unit) to PM_TakeDmgGroup
      • Trigger - Add to Puppet Master <gen> the event (Unit - (Triggering unit) Takes damage)
      • Trigger - Add to PM Illusions Juxta <gen> the event (Unit - (Triggering unit) Takes damage)


Trigger:
  • Puppet Master
    • Events
    • Conditions
      • ((Damage source) is an illusion) Equal to False
      • ((Damage source) has buff Puppet Master ) Equal to True
      • (Level of Puppet Master for (Damage source)) Greater than 0
      • ((Triggering unit) belongs to an ally of (Owner of (Damage source))) Equal to False
    • Actions
      • Set PM_Unit = (Damage source)
      • Set PM_Group = (Units in (Playable map area) matching ((((Matching unit) is an illusion) Equal to True) and ((((Matching unit) has buff Puppet Master ) Equal to True) and ((Owner of (Matching unit)) Equal to (Owner of PM_Unit)))))
      • Set PM_Num_of_Dummies = (Number of units in PM_Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Random integer number between 1 and 100) Less than or equal to (8 x (Level of Puppet Master for PM_Unit))) and (PM_Num_of_Dummies Less than (1 + (2 x (Level of Puppet Master for PM_Unit))))
        • Then - Actions
          • Set PM_Point = (Position of PM_Unit)
          • Unit - Create 1 Puppet Dummy for (Owner of PM_Unit) at PM_Point facing Default building facing degrees
          • Set PM_Dummy = (Last created unit)
          • Unit - Add Illusion Staff to PM_Dummy
          • Unit - Set level of Illusion Staff for PM_Dummy to (Level of Puppet Master for PM_Unit)
          • Custom script: call IssueTargetOrderById(udg_PM_Dummy, 852274, udg_PM_Unit)
          • Unit - Add a 0.30 second Generic expiration timer to PM_Dummy
          • Custom script: call DestroyGroup(udg_PM_Group)
          • Custom script: call RemoveLocation(udg_PM_Point)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_PM_Group)


Trigger:
  • PM Illusions Juxta
    • Events
    • Conditions
      • ((Damage source) is an illusion) Equal to True
      • ((Damage source) has buff Puppet Master ) Equal to True
      • (Level of Puppet Master for (Damage source)) Greater than 0
      • ((Triggering unit) belongs to an ally of (Owner of (Damage source))) Equal to False
    • Actions
      • Set PM_I_Unit = (Damage source)
      • Set PM_I_Group = (Units in (Playable map area) matching ((((Matching unit) is an illusion) Equal to True) and ((((Matching unit) has buff Puppet Master ) Equal to True) and ((Owner of (Matching unit)) Equal to (Owner of PM_I_Unit)))))
      • Set PM_I_Num_of_Dummies = (Number of units in PM_I_Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Random integer number between 1 and 100) Less than or equal to (5 x (Level of Puppet Master for PM_Unit))) and (PM_I_Num_of_Dummies Less than (3 x (Level of Puppet Master for PM_Unit)))
        • Then - Actions
          • Set PM_I_Point = (Position of PM_I_Unit)
          • Unit - Create 1 Puppet Dummy for (Owner of PM_I_Unit) at PM_I_Point facing Default building facing degrees
          • Set PM_I_Dummy = (Last created unit)
          • Unit - Add Illusion Staff to PM_I_Dummy
          • Unit - Set level of Illusion Staff for PM_I_Dummy to (Level of Puppet Master for PM_Unit)
          • Custom script: call IssueTargetOrderById(udg_PM_I_Dummy, 852274, udg_PM_Unit)
          • Unit - Add a 0.30 second Generic expiration timer to PM_I_Dummy
          • Custom script: call DestroyGroup(udg_PM_I_Group)
          • Custom script: call RemoveLocation(udg_PM_I_Point)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_PM_I_Group)


Trigger:
  • PM Illusion Enters
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is an illusion) Equal to True
      • (Level of Puppet Master for (Triggering unit)) Greater than 0
    • Actions
      • Set PM_Point2 = (Position of PM_Unit)
      • Unit - Move (Triggering unit) instantly to PM_Point2
 

Moridin

Snow Leopard
Reaction score
144
Ummm...as far as I can see you aren't using a wait or a timer anywhere, so it is MUI. :S
 

Moridin

Snow Leopard
Reaction score
144
It doesn't matter. It's MUI because it's instant. Let's say 4 illusions attack at the same time. What happens is:

Triggers run for illusion 1
Triggers run for illusion 2
Triggers run for illusion 3
Triggers run for illusion 4

...all instantaneously (at least to us). So don't worry.

You should note though, that because the triggers keep running per attack per illusion, the more illusions you have the more lag you're going to have all around. Be a little careful with your % chances to spawn another illusion or you could end up with a huge amount of lag.

Edit: Easiest way to find out -> Test it.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
I did try it. Maybe what you said is true, but when I tested it for some strange reason it created more illusions than my maximum amount. In my opinion the trigger runs for limited number of illusions(i.e afraid it's not MUI) so that's why the check from the conditions didn't work.
Any idea why that happens?
 

Moridin

Snow Leopard
Reaction score
144
Actually wait. I re-read all your triggers again, and you're right. It isn't MUI...because your unit variable PM_Unit might be overwritten before it's used to check the ability level in your 4th trigger.

Hmmm, you need some way to link the puppet master to each illusion he creates. Unit handles are unique and they're numerical, so maybe you could set the custom value of the illusions (or any integer variable, but that would be harder because you'd need a seperate integer variable linked to each illusion), to the handle number of it's 'master'. Then all you have to do is derive that 'master' in 4th trigger and check the level of the ability for that unit.

If you didn't understand what I meant, give me a heads up and I'll see what I can do.

--------------------
Try this. Simple enough steps to follow:

1)

In your map init trigger, create the following actions:

Trigger:
  • Actions
    • Hashtable - Create a new hashtable
    • Set PM_Hash = Last created hashtable


2) Edit your 5th trigger to match this: (Just add that last line)

Trigger:
  • PM Illusion Enters
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is an illusion) Equal to True
      • (Level of Puppet Master for (Triggering unit)) Greater than 0
    • Actions
      • Set PM_Point2 = (Position of PM_Unit)
      • Unit - Move (Triggering unit) instantly to PM_Point2
      • Hashtable - Save PM_Unit as Handle(Triggering unit) of 1 in PM_Hash


3)

In your 4th trigger, add, in the very beginning of the trigger actions:
Trigger:
  • Set PM_Unit = Load Handle(Damage Source) of 1 in PM_Hash


------------------------ As far as I can see right now, it should be MUI after that. I'm going to read through it again to make sure, but I have to go, so I'll do it a little later.
 

Moridin

Snow Leopard
Reaction score
144
Well, I can't really do anymore unless I have your map can I? I've shown you the actions that you need to make it work (hopefully). If you have trouble with any of the actions, ask me, and I'll deal with that problem specifically.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Hmm. I don't know how to use hashtables and won't need them anyways. I just need MUI like an integer increasing by 1 everytime my units attack more. Can't u just make it in a test map... It won't be very hard. It will take about 5-10 mins of your valuable time. Oh, yeah, I'm very sure this can be fixed without handles and hashtables... Seriously I can't get any real help on this forum. Everything is just thrown everywhere, not well organized, not arranged. No offense but the moderators aren't doing a good job here. This forum is dead. There aren't any good templates to look into so I may begin from something. I have studied everything in this editor alone no one is really helping anybody and the limited stuff that is available is still not reliable. There isn't any explanation about all the stuff in the editor and I still don't get why. This forum is live for 8,9 years?! I still think that the blame should be assigned to the admins because they reject everything which is not MUI or MPI.
By the way I'm not speaking specifically about you. Just saying what is on my mind...

Hope I find something similar to this spell otherwise it won't make it in my map...
 

Moridin

Snow Leopard
Reaction score
144
Well I could definitely make a test map and let you copy paste off of it, but I thought you might learn something from doing it. If that's what you want, then sure, I'll get you a test map with the triggers.

As to your comments on this forum, I disagree with you on a lot of points...and you sound extremely arrogant...but I don't think this is the right place to argue so I'll leave it at that.

Edit: Oh and btw:

feelingparty said:
Well hashtables have proved really handy to me and I strongly recommend you to learn how to use them if you want to create MUI spells in GUI. Here's a link for a good tutorial:
http://www.hiveworkshop.com/forums/t...es-mui-133407/
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Hmm arrogant no. I would prefer furious. I'm not trying to do any harm or hurt someone but in my opinion most of the stuff I said above is true.
If I were admin or mod. I would create different sections like templates GUI or JASS(On attack, A unit takes damage, MUI damage detection, Spells in circle, Spells in line, Spells with no target, Global Spells, Complex spells(Like spheres or pyramids) and many more). I would make a section for tutorials, models, icons, skins, maps, projects, tools, chat etc. Maybe a section where you can get proffesional help, for example from Paladon, Ghan_04, Sevion, Tom_Kazansky and many more great programmers that work out there.
And yeah as you said this is not the place and the time to talk about this stuff. Went a bit off topic there.

About the spell yes make it. I would look at the triggers. I will figure out what you are doing with those hashtables on my own.
Thank you for your time and help. Glad there are more good guys out there.

BEST WISHES and sorry for all the trouble.
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
Couldn't it be done in simple GUI triggering? I would have done it like this.

Trigger:
  • Illusion Limit
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) has buff Illusion) Equal to True
    • Actions
      • Set Temp_Group = (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) has buff Illusion) Equal to True))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Temp_Group) Equal to 5
            • Then - Actions
              • Unit - Remove (Triggering unit) from the game
            • Else - Actions
      • Custom script: call DestroyGroup( udg_Temp_Group )


The buff illusion is the buff you use for the illusion skill use a special buff instead like maybe "puppet illusion".

The Equal to 5 is where the max limit of illusions of the player can have.

Downside for this is that dummies would still appear since the trigger would still run since the limiter is not done in an instance in the chance trigger. Though you could just utilize the if then condition to incorporate it with the original spell trigger to not run the trigger if there are 5 illusions already.

By the way just imagined this trigger and it would output 4 illusions only since the entering unit would be counted as well so if you want a max of 5 set the trigger to 6...

PS didn't had the chance to read your triggers, I want to finish my project soon and release it :D
 

Moridin

Snow Leopard
Reaction score
144
Couldn't it be done in simple GUI triggering? I would have done it like this.
Unfortunately your solution won't work, because the limit on the number of illusions change according to the level of the ability of the caster. Let's say an illusion enters the map, you can't really track the level of the ability "puppet master" for the caster unit, so you won't have an accurate limit. Your solution would definitely work for static limits though.

Btw, Igor Z, I haven't forgotten about this. I am making a test map, it's just that I'm a little busy unfortunately, so I might take another day. Sorry about the delay.
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
Oh so you mean limit increases with each level. You could simply have an index for the heroes then...
 

Moridin

Snow Leopard
Reaction score
144
Oh so you mean limit increases with each level. You could simply have an index for the heroes then...
Yeah that is what I meant. An index being...? You have to link every single illusion with it's respective caster, so I personally think the easiest solution is to use hashtables.
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
Wait, you could actually check the level of the skill and set the limit, downside is that it would only be MPI but it's better than none, I don't think he really needs MUI since if multiple units for each player has that skill it would flood the game with illusions. So it goes lilke.

When the unit enters the map
The unit has specific buff
Pick all the unit of type (the hero)
from here you could now see the level of the hero's ability allowing you to set the limit in sync with the level.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Hmm. I won't have the ability on multiple units. Only my puppet master has this ability and I need it MUI because many illusions which are created will deal damage at the same time and the triggers will malfunction...

Btw, Igor Z, I haven't forgotten about this. I am making a test map, it's just that I'm a little busy unfortunately, so I might take another day. Sorry about the delay.

No problem mate. Take your time. I'm not in a big hurry. Fixing every spell, one by one, because I'm back at map making, after a 1-2 years break, and I'm better than ever ;).
Hope you finish your projects soon so we can look back at this and laugh :p...
 

Moridin

Snow Leopard
Reaction score
144
Hey. Almost done with your ability, but I had a few questions:

1) The buff Puppet master is on your caster AND your illusions. What exactly are you doing to maintain that?

2) Is there a reason why this condition:

Trigger:
  • PM_NumOfDummies Less than (1 + (2 x (Level of Puppet Master for PM_Unit)))


has a different number for the different triggers?

-----------------------
Also, your triggers have a few extra, un-needed variables that I cleared up. You also had a leak or two that I fixed.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Also, your triggers have a few extra, un-needed variables that I cleared up. You also had a leak or two that I fixed.
Yes I know. Checked them and fixed...
1) The buff Puppet master is on your caster AND your illusions. What exactly are you doing to maintain that?
It is based on brilliance aura in order to give a buff.

2) Is there a reason why this condition:

Trigger:

* PM_NumOfDummies Less than (1 + (2 x (Level of Puppet Master for PM_Unit)))

has a different number for the different triggers?
Hmm that is a mistake. It is suppose to be like this in both triggers:

Code:
(PM_Num_of_Dummies Less than (1 + (2 x (Level of Puppet Master for X Unit)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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