• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] How to make this MUI

Status
Not open for further replies.
Level 7
Joined
Mar 6, 2014
Messages
203
  • Limiter
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Entering unit)) Equal to Turret
        • Then - Actions
          • Set Limiter = (Limiter + 1)
          • Set LimiterUnitID[Limiter] = (Last created unit)
        • Else - Actions
      • Unit - Remove LimiterUnitID[(Limiter - 3)] from the game
 
Level 7
Joined
Mar 6, 2014
Messages
203
This is wrong.
  • Set LimiterUnitID[Limiter] = (Last created unit)
Should be this.
  • Set LimiterUnitID[Limiter] = (Triggering unit)
Also don't use entering unit use Triggering unit.

This will then be MUI. You should also check if there is a unit in the LimiterUnitID[(Limiter - 3)] before calling the remove unit action.

what should i do ? give some trigger sample
 
Level 7
Joined
Mar 6, 2014
Messages
203
This is what i've done. I got no choice ill go with MPI.

  • Limiter
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Turret
        • Then - Actions
          • Set Limiter[(Player number of (Owner of (Triggering unit)))] = (Limiter[(Player number of (Owner of (Triggering unit)))] + 1)
          • Set LimiterUnitID[Limiter[(Player number of (Owner of (Triggering unit)))]] = (Triggering unit)
        • Else - Actions
      • Unit - Remove LimiterUnitID[(Limiter[(Player number of (Owner of (Triggering unit)))] - 3)] from the game
 
If you don't tell us what you actually try to achieve, there is no way we can help you. The trigger you posted is MUI by default, as there's no recursion possible (if you change last created unit to triggering unit, that is).

In fact, I'm pretty sure you don't even have a clue what MUI means.

Also, please do something about that avatar of yours. That flickering light is annoying as hell.
 
Level 7
Joined
Mar 6, 2014
Messages
203
Im trying to make unit limiter. Example:
When i cast a spell at target point. Unit is created permanently. Max of 3 unit. When you cast again and you got 3 unit in the map the older unit will remove.
thats all i wanna make
 
Level 12
Joined
Oct 16, 2010
Messages
680
event spell effect

kill unit3
set unit3=unit2
set unit2=unit1
create new unit for player
set unit1=last created unit

thats it . all u need is 3 unit variable used only in this trigger

EDIT: u can apply an expiration timer as well if u want after creating new unit
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
There is a problem with your array...
You have probably made some nice Object[][] codes in real languages but this is totally different.
You have a Unit[Integer[]] instead of a Unit[][]
...
Can you keep up? ([] is array. Object[] is array of objects. Object[][] is an array of objectarrays.)

Well you have for example player 1 and he has 2 turrets.
The integer in the limiter[1] is 2.
Player 2 has 3 turrets.
The integer in the limiter[2] is 3.
Then you have the unit array but Unit[limiter[player]] is still one array that stops at 3.

I dont have any idea how to explain but just forget what I said and make a hashtable.
Done is done.

EDIT:
This is some MUI trigger of what you want (Not tested)
  • MUI
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set TempUnit1 = (Triggering unit)
      • Set TempInteger1 = (Player number of (Triggering player))
      • Set TempInteger2 = (Load 0 of TempInteger1 from MyNewHashtable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInteger2 Less than 3
        • Then - Actions
          • Set TempInteger2 = (TempInteger2 + 1)
          • Hashtable - Save TempInteger2 as 0 of TempInteger1 in MyNewHashtable
          • Hashtable - Save Handle OfTempUnit1 as TempInteger2 of TempInteger1 in MyNewHashtable
        • Else - Actions
          • Unit - Remove (Load 1 of TempInteger1 in MyNewHashtable) from the game
          • Hashtable - Save Handle Of(Load 2 of TempInteger1 in MyNewHashtable) as 1 of TempInteger1 in MyNewHashtable
          • Hashtable - Save Handle Of(Load 3 of TempInteger1 in MyNewHashtable) as 2 of TempInteger1 in MyNewHashtable
          • Hashtable - Save Handle OfTempUnit1 as 3 of TempInteger1 in MyNewHashtable
 
Level 12
Joined
Oct 16, 2010
Messages
680
I know that but the unit in the spell live permanently if there 3 or more same units on the map and you cast again the spell the older unit will die
I don't know whats your problem with what i've shown:p

for MPI this is enough
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
    • (type of(entering unit)) equals to "your summon"
  • Actions
    • Set TempInt=player number of(triggering player)
    • Unit - Kill Unit[TempInt*3+2]
    • Set Unit[TempInt*3+2]=Unit[TempInt*3+1]
    • Set Unit[TempInt*3+1]=Unit[TempInt*3+0]
    • Unit - Create 1 "summon" at....
    • Set Unit[TempInt*3+0]=last created unit
for MUI, I would suggest using the same method with unit indexer and custom value as TempInt instead what wietlol showed u
 
Status
Not open for further replies.
Top