Making this trigger MUI

Super.Gnome

New Member
Reaction score
0
I have this trigger that I'd like to reuse roughly 20 more times to spawn different unit types, using the same variable.

Trigger:
  • Archer wave Light
    • Events
      • Unit - A unit enters Mainbase light <gen>
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Hire Archer Reinforcement
    • Actions
      • Set WPoints[0] = (Position of (Triggering unit))
      • Unit - Remove (Triggering unit) from the game
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set WPoints[1] = (Random point in Light Wave Spawn <gen>)
          • Set WPoints[2] = (Random point in Light Wave Spawn <gen>)
          • Unit - Create 3 Archer for Player 10 (Light Blue) at WPoints[1] facing WPoints[0]
          • Unit - Create 3 Archer for Player 10 (Light Blue) at WPoints[2] facing WPoints[0]
          • Custom script: call RemoveLocation (udg_WPoints[1])
          • Custom script: call RemoveLocation (udg_WPoints[2])
          • Custom script: call TriggerSleepAction( 5. )
      • Custom script: call RemoveLocation (udg_WPoints[0])


Is there anyway to format this trigger, and the others, so that I can reuse the variable on multiple unit spawns that may be happening simultaneously? I'm under the impression I can't as is because of the sleep action.
 

kaboo

New Member
Reaction score
45
is this what are you looking for?
Code:
events - unit enters mainbase
conditions -
actions 
- set wpoints as u want
- remove entering unit
- if then else do
        -conditions - unit type of entering unit equal to archer hire
        -then actions - create archers
- if then elso do
        -conditions - unit type of entering unit equal to footman hire
        -then actions - create footmans
.................

btw what does the sleep action trigger do?
 

Super.Gnome

New Member
Reaction score
0
is this what are you looking for?
Code:
events - unit enters mainbase
conditions -
actions 
- set wpoints as u want
- remove entering unit
- if then else do
        -conditions - unit type of entering unit equal to archer hire
        -then actions - create archers
- if then elso do
        -conditions - unit type of entering unit equal to footman hire
        -then actions - create footmans
.................

btw what does the sleep action trigger do?

It essentially is 5 second wait between loops. So that I get 6 "waves" of 6 archers, instead of 1 wave of 36 archers. Im doing it this way instead of just one massive wave for aesthetic and technical reason. One wave of 36 looks funny, and causes some lag upon being created.
 

kaboo

New Member
Reaction score
45
then use this
Code:
events - unit enters mainbase
conditions - unit type of entering unit equal to archer hire
actions 
- set wpoints as u want
- for each integer 1 to 6 do
   - if then else do
        -conditions - 
        -then actions - create archers
                           - remove entering unit
                           - wait 5 seconds
 

LoveTD's

New Member
Reaction score
34
custom script: local NameOfYourVariable

custom script: set NameOfYourVariable = .....

ow oops I did that wrong XD I think :p sec....

hmm seems like would be ok:

custom script: local integer i = 0
custom script: set i = i+1

if u get what I mean ;)
 

Super.Gnome

New Member
Reaction score
0
custom script: local NameOfYourVariable

custom script: set NameOfYourVariable = .....

ow oops I did that wrong XD I think :p sec....

hmm seems like would be ok:

custom script: local integer i = 0
custom script: set i = i+1

if u get what I mean ;)

No I don't know what you mean. I don't know how to set a local point variable to the spot I want. The whole local variable thing is foreign to me.

On second thought, is this even required? It seems that the only non-mui part of the trigger is "WPoints[0]" as the other two variables are cleared between each wait. So if I switch it so facing "default building degrees" I have fixed my problem correct?

This trigger here seems leakless, and as though I can reuse the variables in other "wave" triggers without issue:

Trigger:
  • Archer wave Light Copy
    • Events
      • Unit - A unit enters Mainbase light <gen>
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Hire Archer Reinforcement
    • Actions
      • Unit - Remove (Triggering unit) from the game
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set WPoints[1] = (Random point in Light Wave Spawn <gen>)
          • Set WPoints[2] = (Random point in Light Wave Spawn <gen>)
          • Unit - Create 3 Archer for Player 10 (Light Blue) at WPoints[1] facing Default building facing degrees
          • Unit - Create 3 Archer for Player 10 (Light Blue) at WPoints[2] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_WPoints[1])
          • Custom script: call RemoveLocation (udg_WPoints[2])
          • Custom script: call TriggerSleepAction( 5. )


Am I correct in that?
 

the Immortal

I know, I know...
Reaction score
51
Yep, MUI now it is.

For making it the other way (makin 'dem units face a point) you can either
1) use locals but since shadowing is not allowed either use NewGen or do all lines using the locals in JASS
2) use some imba GUI indexing system / algorithm
3) use arrays of [12] (15?) and make it MPI

Ask and you'll be answered as someone smartie said.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • 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 Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top