MUI issue and random other stuff

Pharaoh_

The epic journey will soon begin... Prepare!
Reaction score
136
1) MUI issue; i am making a spell which i tried to make it MUI. To be honest, i didn't get myself busy with indexing, so, i need to know if i am that pathetic on my first -almost- MUI triggering. It certainly has a problem, cause the triggered damage doesn't work by the second time i cast the spell, but the rest stuff does; let me explain to you:

Trigger:
  • Plague
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Plague
    • Actions
      • Set MUI = (MUI + 1)
      • Set Unit[MUI] = (Triggering unit)
      • Set Point[MUI] = (Position of Unit[MUI])
      • Unit - Pause Unit[MUI]
      • Unit - Make Unit[MUI] Invulnerable
      • Set Damage = 20.00
      • Animation - Play Unit[MUI]'s stand animation
      • Trigger - Turn on Plague 2 <gen>


Trigger:
  • Plague 2
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set Timer[MUI] = (Timer[MUI] + 1)
      • Set Group[MUI] = (Units within 500.00 of Point[MUI] matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Unit[MUI])) Equal to True)))
      • Unit Group - Pick every unit in Group[MUI] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in Group2[MUI]) Equal to False
            • Then - Actions
              • Unit Group - Add (Picked unit) to Group2[MUI]
              • Unit Group - Pick every unit in Group2[MUI] and do (Actions)
                • Loop - Actions
                  • Set Sp[MUI] = (Sp[MUI] + 1)
                  • Special Effect - Create a special effect attached to the head of (Picked unit) using Units\Undead\PlagueCloud\PlagueCloudtarget.mdl
                  • Unit - Cause Unit[MUI] to damage (Picked unit), dealing Damage damage of attack type Chaos and damage type Normal
                  • Set SpecialEffect[Sp[MUI]] = (Last created special effect)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Timer[MUI] Equal to 50
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Unit Group - Remove all units from Group2[MUI]
          • Animation - Reset Unit[MUI]'s animation
          • Unit - Unpause Unit[MUI]
          • Unit - Make Unit[MUI] Vulnerable
          • For each (Integer A) from 1 to Sp[MUI], do (Actions)
            • Loop - Actions
              • Special Effect - Destroy SpecialEffect[(Integer A)]
        • Else - Actions


Questions:
1) I have seen some maps setting even the path of the special effect in a variable when it comes to MUI. Should i set it? It sounds too much.

2) The animation, the pause and the invulnerable state are all applied. What happens with the damage though? They all work for the first time, the second time only the 3 upper cases occur, but the damage and the special effects are all gone.

3) How to remove the leaks, when it comes to non specific numbered indexes (e.g. MUI -> Custom script: call RemoveLocation (udg_Point [?])?



Other stuff:

4) I want to define some units by type: Ghost/ Troll/ Tauren and such. I want to use a buff on the unit to depict this, but i am afraid that if a unit uses a dispell-type item, the buff will be displaced. Any idea on how to show the type of the unit to an enemy (without floating texts) and retain the buff status or even a better solution?

5) A camera is set, which follows the rotation of the unit. When it comes to a hill, i want the camera to get an angle equal to the facing of the unit not only by X, but by Z too. I mean, the angle of the camera to point exactly what the head unit is facing. Everything works fine on flat terrain, but the camera still keeps to show the terrain when a unit is climbing up a hill.

6) Another camera issue: When i order a unit (which has the camera locked on it) to move to a point, the unit doesn't initially directly face the point i ordered, but it's like another point with offset is created and order the unit to face that point, but as it comes closer to the point of issued order, it then faces it normally. How can i get over this annoying issue? It's like the ground has some pathing blockers. :I

7) How to edit the damage done against Light and Heavy Armor Armor in Gameplay Constants? It only has Small/Medium/Large Armor, which i would like to edit their names in Game Interface, when the only editable ones are Light and Heavy Armor.

8) How to detect the gold a player recieved by killing a unit (bounty) and give 10% of it to another player? I mean, i have an integer running once every 0.2 seconds and another every 0.5; then i get their difference, but, if a player kills with an AoE spell or a cleaving attack multiple units, the difference becomes too high and seems inaccurate in first place. How to detect such thing? Can i avoid setting the gold in variables for each unit (e.g. Set Gold[1] = 24
Events
A unit dies
Conditions
Unit-type of (Dying unit) Equal to X
Actions
Game - Display to (All Players) (String(Gold[1]))----> Not this, this would take ages. Apart from that, there are some units in the map that drop random gold amount, so, how can i know?

9) How to make a doodad model in-game to be sinked in the ground? No, not a pre-placed doodad (by using Alt+Page Down), i mean a unit with the model of a doodad. When i make the unit Amphibious in the Object Editor and place it in the map, it is normally half-shown on the ground (the other half is underground). When i spawn it in-game, it appears all over the ground normally. Any idea on how to solve such thing? Is it because it has no animations = No solution?

10) Is this considered as a MUI timer? (Meaning that the effects will not stop for the first cast, when a second cast is done) Set Timer[MUI] (The value MUI = (MUI + 1))= (Last created timer), Countdown Timer - Start Timer [MUI] as a one shot (...). Is this "Timer[MUI]" variable enough to apply the same effects of a spell and avoid timers pausing each other, due to the inefficience of GUI triggering?

11) I am making GUI MUI spells. The increasing MUI-based value integer that increases by 1 every time a unit casts a spell, can it be placed on any spell i make or it will have to be an additional integer, so it becomes:
Set MUI1 = (MUI1 + 1)
Set MUI2[MUI1] = (MUI2[MUI1] + 1)
and so that i use on every MUI spell the second value (MUI2[MUI1])?

Sorry for such flood, but instead of opening 7 threads, i have this!

Every time a question is answered, the question will be hidden with "Hide" tag.

+Rep to all helpful answers
 

millzy

Ultra Cool Member
Reaction score
44
here ill give u the best ansers i can

your questions
Code:
Questions:
1) I have seen some maps setting even the path of the special effect in a variable when it comes to MUI. Should i set it? It sounds too much.

2) The animation, the pause and the invulnerable state are all applied. What happens with the damage though? They all work for the first time, the second time only the 3 upper cases occur, but the damage and the special effects are all gone.

3) How to remove the leaks, when it comes to non specific numbered indexes (e.g. MUI -> Custom script: call RemoveLocation (udg_Point [?])?



Other stuff:

4) I want to define some units by type: Ghost/ Troll/ Tauren and such. I want to use a buff on the unit to depict this, but i am afraid that if a unit uses a dispell-type item, the buff will be displaced. Any idea on how to show the type of the unit to an enemy (without floating texts) and retain the buff status or even a better solution?

5) A camera is set, which follows the rotation of the unit. When it comes to a hill, i want the camera to get an angle equal to the facing of the unit not only by X, but by Z too. I mean, the angle of the camera to point exactly what the head unit is facing. Everything works fine on flat terrain, but the camera still keeps to show the terrain when a unit is climbing up a hill.

6) Another camera issue: When i order a unit (which has the camera locked on it) to move to a point, the unit doesn't initially directly face the point i ordered, but it's like another point with offset is created and order the unit to face that point, but as it comes closer to the point of issued order, it then faces it normally. How can i get over this annoying issue? It's like the ground has some pathing blockers. :I

7) How to edit the damage done against Light and Heavy Armor Armor in Gameplay Constants? It only has Small/Medium/Large Armor, which i would like to edit their names in Game Interface, when the only editable ones are Light and Heavy Armor.

8) How to detect the gold a player recieved by killing a unit (bounty) and give 10% of it to another player? I mean, i have an integer running once every 0.2 seconds and another every 0.5; then i get their difference, but, if a player kills with an AoE spell or a cleaving attack multiple units, the difference becomes too high and seems inaccurate in first place. How to detect such thing? Can i avoid setting the gold in variables for each unit (e.g. Set Gold[1] = 24
Events
A unit dies
Conditions
Unit-type of (Dying unit) Equal to X
Actions
Game - Display to (All Players) (String(Gold[1]))----> Not this, this would take ages. Apart from that, there are some units in the map that drop random gold amount, so, how can i know?

9) How to make a doodad model in-game to be sinked in the ground? No, not a pre-placed doodad (by using Alt+Page Down), i mean a unit with the model of a doodad. When i make the unit Amphibious in the Object Editor and place it in the map, it is normally half-shown on the ground (the other half is underground). When i spawn it in-game, it appears all over the ground normally. Any idea on how to solve such thing? Is it because it has no animations = No solution?

10) Is this considered as a MUI timer? (Meaning that the effects will not stop for the first cast, when a second cast is done) Set Timer[MUI] (The value MUI = (MUI + 1))= (Last created timer), Countdown Timer - Start Timer [MUI] as a one shot (...). Is this "Timer[MUI]" variable enough to apply the same effects of a spell and avoid timers pausing each other, due to the inefficience of GUI triggering?

11) I am making GUI MUI spells. The increasing MUI-based value integer that increases by 1 every time a unit casts a spell, can it be placed on any spell i make or it will have to be an additional integer, so it becomes:
Set MUI1 = (MUI1 + 1)
Set MUI2[MUI1] = (MUI2[MUI1] + 1)
and so that i use on every MUI spell the second value (MUI2[MUI1])?


ansers
Code:
1)i wouldent warry about it
2)not sure what asking
3)Custom script: call RemoveLocation (udg_Point [?])?
use
Custom script: call RemoveLocation (udg_Point [udg_MUI])
4)im sure you cant dispell a aura buff give the aura ability to the units
5)im not good with cameras soz
6)im not good with cameras soz
7)dono what u can do there
8)do somthing setting how much gold has been added to the player and stuff
9)dont know
10)srry dunno what your saying there
11)use a diferent MUI integer for each spell
MUI1
MUI2
MUI3 and so on

sorry i couldent anser many questions but i tryed
 

Dirac

22710180
Reaction score
147
Your spell is not MUI :S, since if cast again the MUI integer is higher and the periodic trigger gets fucked up. Plus turning on/off it can mess things up too.
Do This
Set MUI = MUI +1
Create 1 dummy
Set a var for each thing involved in the way with array
(Set MUICaster[MUI] = Unit)
Add the dummy created to SomeGroup
Set the custom value of the dummy created to MUI

Periodic
Pick every unit in SomeGroup
Set MUIness = Custom value of unit
DO YOUR ACTIONS USING THE ARRAY LIKE THIS: MUICaster[MUIness]
When the effect ends, remove the picked unit (the dummy) from the game

You might want to check this code in order to understand
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Questions:
1) I have seen some maps setting even the path of the special effect in a variable when it comes to MUI. Should i set it? It sounds too much.

Nah, unless each unit has a specific path, you don't need that

2) The animation, the pause and the invulnerable state are all applied. What happens with the damage though? They all work for the first time, the second time only the 3 upper cases occur, but the damage and the special effects are all gone.
Like Dirac said, everytime it's cast, MUI goes higher and it fucks up the periodic.

3) How to remove the leaks, when it comes to non specific numbered indexes (e.g. MUI -> Custom script: call RemoveLocation (udg_Point [?])?
udg_Point[udg_MUI]
but now thats kinda useless, since your system doesnt work



Other stuff:

4) I want to define some units by type: Ghost/ Troll/ Tauren and such. I want to use a buff on the unit to depict this, but i am afraid that if a unit uses a dispell-type item, the buff will be displaced. Any idea on how to show the type of the unit to an enemy (without floating texts) and retain the buff status or even a better solution?

Use a few 1 range auras, one for each unit class, with no effects but the buff itself.

5) A camera is set, which follows the rotation of the unit. When it comes to a hill, i want the camera to get an angle equal to the facing of the unit not only by X, but by Z too. I mean, the angle of the camera to point exactly what the head unit is facing. Everything works fine on flat terrain, but the camera still keeps to show the terrain when a unit is climbing up a hill.

That would be hard to do, you would need a good height detection system, and I believe they only exist in jass if that bothers you. The only one I know of is GetUnitZ, but that only detects a unit's Z height, not the hill's angle.

6) Another camera issue: When i order a unit (which has the camera locked on it) to move to a point, the unit doesn't initially directly face the point i ordered, but it's like another point with offset is created and order the unit to face that point, but as it comes closer to the point of issued order, it then faces it normally. How can i get over this annoying issue? It's like the ground has some pathing blockers. :I
The simplest solution would be a higher Turn Rate, but else you can base the camera's facing off the angle between target point and unit instead of unit's facing.

7) How to edit the damage done against Light and Heavy Armor Armor in Gameplay Constants? It only has Small/Medium/Large Armor, which i would like to edit their names in Game Interface, when the only editable ones are Light and Heavy Armor.
Small = Light, I don't know why in Gameplay constants its like that but it is. Same for large = heavy. As for Gameplay interface, search better, I'm sure it's there.

8) How to detect the gold a player recieved by killing a unit (bounty) and give 10% of it to another player? I mean, i have an integer running once every 0.2 seconds and another every 0.5; then i get their difference, but, if a player kills with an AoE spell or a cleaving attack multiple units, the difference becomes too high and seems inaccurate in first place. How to detect such thing? Can i avoid setting the gold in variables for each unit (e.g. Set Gold[1] = 24
Events
A unit dies
Conditions
Unit-type of (Dying unit) Equal to X
Actions
Game - Display to (All Players) (String(Gold[1]))----> Not this, this would take ages. Apart from that, there are some units in the map that drop random gold amount, so, how can i know?

There is no built-in way to do that, and anyways, even using a splash attack, it shouldnt be so inaccurate. If you REALLY think it is, then I guess you can try using point values.
EDIT: You don't need 2 integers, just make an array integer, 1 index for each player, then just compare the player's gold with the integer, thats your bounty, then set the integer to that player's gold and there you go.

9) How to make a doodad model in-game to be sinked in the ground? No, not a pre-placed doodad (by using Alt+Page Down), i mean a unit with the model of a doodad. When i make the unit Amphibious in the Object Editor and place it in the map, it is normally half-shown on the ground (the other half is underground). When i spawn it in-game, it appears all over the ground normally. Any idea on how to solve such thing? Is it because it has no animations = No solution?
No idea about that :S

10) Is this considered as a MUI timer? (Meaning that the effects will not stop for the first cast, when a second cast is done) Set Timer[MUI] (The value MUI = (MUI + 1))= (Last created timer), Countdown Timer - Start Timer [MUI] as a one shot (...). Is this "Timer[MUI]" variable enough to apply the same effects of a spell and avoid timers pausing each other, due to the inefficience of GUI triggering?
Yeah, although you have about 8k different timers in that. You should consider finding a way to recycle them or at least destroy them.

11) I am making GUI MUI spells. The increasing MUI-based value integer that increases by 1 every time a unit casts a spell, can it be placed on any spell i make or it will have to be an additional integer, so it becomes:
Set MUI1 = (MUI1 + 1)
Set MUI2[MUI1] = (MUI2[MUI1] + 1)
and so that i use on every MUI spell the second value (MUI2[MUI1])?

Like I said, that system is not MUI already, but if you had to do that, then yes you would need another integer.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Use locals to make ur spell 100% MUI !!!!

1) Use string variables.
2) Use locals should fix ur prob.
3) Use udg_Point [MUI], I prefer u use X and Y, they do not leak and faster + No nid to nullify it. :thup:
4) Use passive aura, with a dummy following the unit.
5-10) I m noob, dunno solve it.
11) Use locals to make ur spell MUI.
 

Flare

Stops copies me!
Reaction score
662
Use locals to make ur spell 100% MUI !!!!

1) Use string variables.
2) Use locals should fix ur prob.
3) Use udg_Point [MUI], I prefer u use X and Y, they do not leak and faster + No nid to nullify it. :thup:
4) Use passive aura, with a dummy following the unit.
5-10) I m noob, dunno solve it.
11) Use locals to make ur spell MUI.
Using JASS logic to solve a GUI problem? Ugh...

1) Using a string var for the sake of a special effect model path? Unless it's to allow easier configuration (even though, for GUI triggers, it's not hard to find Create Special Effect lines), that's a waste of time and effort. Unless the string needs to be stored for use later (pff, not likely), it's pointless. Why don't we just set a integer var to 1 while we are at it, so we can do
Code:
Set MUICounter = MUICounter + IntVar
while we're at it...

2) Locals have really limited use in GUI, and the idea that locals magically make code MUI is just stupid - they can make some, usually pretty simple, codes MUI but definitely not this. As you can see, there are 2 triggers. I'm sure you should know that locals are specific to a function, not to mind separate triggers...

3) I don't think there are any GUI actions that use coordinates, so another wasted idea. Also, there isn't any major need to null globals.

4 - 10) No comment :p

11) See #2

3) How to remove the leaks, when it comes to non specific numbered indexes (e.g. MUI -> Custom script: call RemoveLocation (udg_Point [?])?
Assuming MUI is a global var, just prefix it with udg_ when doing RemoveLocation, as bOb pointed out

Can i avoid setting the gold in variables for each unit (e.g. Set Gold[1] = 24
You could use Point Value, in the Object Editor, and set that as the bounty (assuming you have set the bounty values so they don't allow for a random value)

As regards the rest of the questions, not fully sure what you're saying :p
 

Pharaoh_

The epic journey will soon begin... Prepare!
Reaction score
136
Thank you guys for the response, but i would like to know some more stuff:
You just told me that the spell is not MUI, i assure you i am not asking for the trigger itself nor a MUI mini-tutorial, but, do i need to add the indexing and the recycling thing of the indexing to fully turn that into MUI-enhanced trigger?

The thing with the buff and the unit following it; ok, once it is dispelled, for how long will it be dispelled? I want it stable on a status there; can i have it?
 
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