• 🏆 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!

Warcraft 3 Fusion Triggers.

Status
Not open for further replies.
Level 1
Joined
Mar 8, 2010
Messages
1
I need a fusion system that works for 4 players and for 4 different races.
I tried making it but it takes alot of lines to make and for example if I select 3 peons and make it enter the fusion zone then it will give me the desired result of 1 grunt , however when I select 12 peons and make them enter that zone then no fusion is made because the timer checks the number of units in the region and if it is not 3 then the fusion will not be made...I tried with variables and it actually worked but if the system does more then 1 fusion per second then the game might become really laggy ... So now I am looking for an alternative and practical solution to this fusion system.... If someone can help I will be really grateful... No jass solutions plz... I know it's easy to make with jass but Im kinda noobish with it so I probably couldn't make it work 100%.
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
Aye! :D T4COBELL is right :D
Here is a complete trigger without a timer:

  • Fusion
    • Events
      • Unit - A unit enters Your Region <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Peon
    • Actions
      • Set Peons = (Units in Your Region <gen> matching ((Unit-type of (Matching unit)) Equal to Peon))
      • Wait 0.01 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Peons) Greater than or equal to 3
        • Then - Actions
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Unit - Remove (Random unit from Peons) from the game
          • Unit - Create 1 Grunt for Player 1 (Red) at (Center of Your Region <gen>) facing Default building facing degrees
        • Else - Actions
      • Custom script: call DestroyGroup ( udg_Peons )
or here is the trigger for 2 units (just copy-paste the if part, and change it at 3 places: at the If, at the set variable and at the create)

>>I used "Peons" as the Unit group variable!<<


  • Fusion
    • Events
      • Unit - A unit enters Your Region <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Peon
        • Then - Actions
          • Set Peons = (Units in Your Region <gen> matching ((Unit-type of (Matching unit)) Equal to Peon))
          • Wait 0.01 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Peons) Greater than or equal to 3
            • Then - Actions
              • For each (Integer A) from 1 to 3, do (Actions)
                • Loop - Actions
                  • Unit - Remove (Random unit from Peons) from the game
              • Unit - Create 1 Grunt for Player 1 (Red) at (Center of Your Region <gen>) facing Default building facing degrees
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Peasant
        • Then - Actions
          • Set Peons = (Units in Your Region <gen> matching ((Unit-type of (Matching unit)) Equal to Peasant))
          • Wait 0.01 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Peons) Greater than or equal to 3
            • Then - Actions
              • For each (Integer A) from 1 to 3, do (Actions)
                • Loop - Actions
                  • Unit - Remove (Random unit from Peons) from the game
              • Unit - Create 1 Footman for Player 1 (Red) at (Center of Your Region <gen>) facing Default building facing degrees
            • Else - Actions
        • Else - Actions
      • Custom script: call DestroyGroup ( udg_Peons )
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This supports any unit type, and it's MUI.


  • Initialize
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set ConvertFrom[1] = Peasant
      • Set ConvertTo[1] = Footman
      • Set Conversion_Max_Index = 1
  • Enter Region 1
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
    • Actions
      • Trigger - Turn on Pick Units <gen>
      • Game - Display to (All players) the text: Loop trigger turned on.
  • Pick Units
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Units checked.
      • Set Temp_Group_1 = (Units in Region 000 <gen> matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Group_1 is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Game - Display to (All players) the text: Loop trigger off.
        • Else - Actions
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • For each (Integer B) from 1 to Conversion_Max_Index, do (Actions)
                • Loop - Actions
                  • Set Temp_Group_2 = (Units in Region 000 <gen> matching (((Unit-type of (Matching unit)) Equal to ConvertFrom[(Integer B)]) and (((Matching unit) is alive) Equal to True)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in Temp_Group_2) Equal to 3
                    • Then - Actions
                      • Unit Group - Pick every unit in Temp_Group_2 and do (Actions)
                        • Loop - Actions
                          • Unit - Remove (Picked unit) from the game
                      • Set Temp_Loc_1 = (Center of Region 000 <gen>)
                      • Unit - Create 1 ConvertTo[(Integer B)] for Player 1 (Red) at Temp_Loc_1 facing Default building facing degrees
                      • // You can create a special effect at position of last created unit here.
                      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
                    • Else - Actions
                  • Custom script: call DestroyGroup(udg_Temp_Group_2)
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
Maker: not bad, but it has a 1second loop time, which is not good if I come with 60 untis (lol 20 seconds Oo) and

"(Number of units in Temp_Group_2) Equal to 3"-this line is glithcy, what if I come with 4 units? :D It wont't work... So... And why don't you just put a trigger for checking once? (trigger runing times not=1) The way you put it in will spam the player with 20 lines of "Units Checked"
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Maker: not bad, but it has a 1second loop time, which is not good if I come with 60 untis (lol 20 seconds Oo)

And that loop time is, oh so difficult to change.

"(Number of units in Temp_Group_2) Equal to 3"-this line is glithcy, what if I come with 4 units? :D It wont't work...

It works the way the original poster wanted it to. Read the first post.

So... And why don't you just put a trigger for checking once? (trigger runing times not=1) The way you put it in will spam the player with 20 lines of "Units Checked"

It checks it for all unit types defined in the initialization trigger, and for all players separately. Ever heard of MPI?

I could change it so that it picks all units in the region, checks that they are owned by the same player, are the same unit type, and the unit type is one of the listed unit types. But that may not be that much more efficient.
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
No, I mean with the last one that it will spam "Units Checked" every second if you walk trough it with like 20 units (takes some time to walk trough xD) But without knowing why does he need that trigger, it's a bit hard to tell if that's good or not... ;) Everything depends on usage-without knowing it, it's a bit hard to read his thoughts xD
 
Status
Not open for further replies.
Top