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

[General] I need help to fix 2 minor issues in my map

Status
Not open for further replies.
Level 4
Joined
Feb 9, 2009
Messages
50
Hello here !

I'm making a custom game map and everything has been fine untill I find two issues.

1) The biggest one happens when I use transport ships to harvest gold (oil platform) in the sea. It seems to works except when I build a new Town Hall, then the transport ships get a new pathfinding to the last built Town Hall to bring back their gold but they cannot gather it because town hall are inland and transport ships MUST gather gold to the nearest shipyard ! The only way I've found yet in game is to kill my shipyard and build a new one so the transport ships find their good way to harvest gold correctly once again. But guess what ? If I build another Town Hall on land, the bug happens again ... so it's a bit of an issue when playing my map. [FIXED] => Thanks to
Death Adder

2) This one is a little less anoying but still ... it happens when someone finishes his tier 4 upgrade with the high elves/blood elves (I made a trigger to change the default facing angle by replacing the building). So half of the workers stop harvesting gold and lumber because they don't find the new path to gather ressources. [NOW FIXED] => I've made a custom model which I rotated in mdleditor from the basic ingame model

Thank you for any help you can provide and I'm sorry for my aproximative english.

Hope to see a solution soon and learn from more advanced mapmakers ! :)

EDIT in bold characters + underlines
 

Attachments

  • Mini_Guerre_Mondiale_TEST_0.9A.w3x
    7.4 MB · Views: 67
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
2) This one is a little less anoying but still ... it happens when someone finishes his tier 4 upgrade with the high elves/blood elves (I made a trigger to change the default facing angle by replacing the building). So half of the workers stop harvesting gold and lumber because they don't find the new path to gather ressources.
This seems a bit weird, because of how you've worded it I think, but if I'm thinking correctly here, what happens is that you remove the townhall while workers are moving towards it to return resources, but then they stop because you replaced it with a new one (on the same spot).

I imagine it would be solved if you just selected all the affected units and issued the return gold and lumber order for them.

1) The biggest one happens when I use transport ships to harvest gold (oil platform) in the sea. It seems to works except when I build a new Town Hall, then the transport ships get a new pathfinding to the last built Town Hall to bring back their gold but they cannot gather it because town hall are inland and transport ships MUST gather gold to the nearest shipyard ! The only way I've found yet in game is to kill my shipyard and build a new one so the transport ships find their good way to harvest gold correctly once again. But guess what ? If I build another Town Hall on land, the bug happens again ... so it's a bit of an issue when playing my map.
You can't even make them return gold by making them return to the shipyard manually ingame?


Worst case scenario, I guess you'll simply just have to delete and recreate the shipyards with triggers. And if it has to be built instead of simply being created, then spawn a dummy unit, make it place down the building, use trigger to set building progress to 99.99%, then the spawned dummy unit will complete the last 0.01% almost instantly, and poof you've got a shipyard rebuilt on the same spot.
 
Level 4
Joined
Feb 9, 2009
Messages
50
Thanks for your help ! :psmile:

This seems a bit weird, because of how you've worded it I think, but if I'm thinking correctly here, what happens is that you remove the townhall while workers are moving towards it to return resources, but then they stop because you replaced it with a new one (on the same spot).

I imagine it would be solved if you just selected all the affected units and issued the return gold and lumber order for them.

How can I trigger this ? I mean by selecting the right units who are returning ressources and not the others ? And also do I have to use region around the main building ?

You can't even make them return gold by making them return to the shipyard manually ingame?


Worst case scenario, I guess you'll simply just have to delete and recreate the shipyards with triggers. And if it has to be built instead of simply being created, then spawn a dummy unit, make it place down the building, use trigger to set building progress to 99.99%, then the spawned dummy unit will complete the last 0.01% almost instantly, and poof you've got a shipyard rebuilt on the same spot.

Yeah the shipyard issue is really bad compared to the second minor problem. But with what you just told me I can see a bit on how I'll make it. First I'll run some test to see if a simple replacement for the shipyard works or if I need to do the more complicated dummy thing (which I dunno how to make it atm)

EDIT : Ok, so it works just by replacing the shipyard with a new one. I need to do it with each race now because there are 11 different shipyards. It seems to be fixed but I'm now facing the same issue as the worker one for my ships ... some of them will stop gathering ressources because of the new building replacement :eek:

I'll now wait for your answer to start solving the workers issue.
 
Last edited:
Level 4
Joined
Feb 9, 2009
Messages
50
So for the shipyard issue I had to do it in two steps (2 triggers)

  • Shipyard Human
    • Events
      • Unité - A unit Finit la construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Constructed structure) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Constructed structure)) Egal à Naval Shipyard
        • Alors - Actions
          • Groupe unité - Add (Constructed structure) to ShipyardsHuman
        • Sinon - Actions
          • Do nothing
  • Oil Pathing Human
    • Events
      • Unité - A unit Finit la construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Constructed structure) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Constructed structure)) Egal à Human Townhall
        • Alors - Actions
          • Groupe unité - Pick every unit in ShipyardsHuman and do (Unité - Replace (Picked unit) with a Naval Shipyard using Des anciennes unités life and mana)
          • Groupe unité - Add (Last replaced unit) to ShipyardsHuman
        • Sinon - Actions
          • Do nothing
Now my problem is that it replaces every shipyards for each race and not only from the owner ... and when you add that with my worker issue it can lead to some abuse in the game (building multiple townhalls to stop enemy oil production from same race).
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
How can I trigger this ? I mean by selecting the right units who are returning ressources and not the others ? And also do I have to use region around the main building ?
When units are ordered to gather resoruces from a goldmine, they'll either be issued the "smart" order (if you rightclick on the goldmine) or "harvest".

Then when they exit the goldmine they'll automatically receive the "resumeharvest" order.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String((Issued order)))
smart, harvest, and resumeharvest are all categorized as "an order targeting a object", which means that you can get which townhall the unit was returning to. (or the goldmine they're going to, if needed, but I don't think it should be)


Exactly how you want to solve it is up to you, but you could make a unit group for each townhall, any unit that is ordered to "resumeharvest" targeting that townhall gets added to the relevant unit group, then if a unit from that unitgroup gets ordered to do something else, it's removed from the unit group.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Peasant
    • Actions
      • Game - Display to (All players) the text: (String((Issued order)))
      • For each (Integer A) from 1 to harvest_townhall_maxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(resumeharvest))
              • (Target unit of issued order) Equal to harvest_townhall[(Integer A)]
            • Then - Actions
              • Unit Group - Add (Triggering unit) to harvest_townhall_group[(Integer A)]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Triggering unit) is in harvest_townhall_group[(Integer A)]) Equal to True
                • Then - Actions
                  • Unit Group - Remove (Triggering unit) from harvest_townhall_group[(Integer A)]
                • Else - Actions
Then of course you'd also need a trigger for whenever a townhall is built or destroyed.
 
Level 4
Joined
Feb 9, 2009
Messages
50
Exactly how you want to solve it is up to you, but you could make a unit group for each townhall, any unit that is ordered to "resumeharvest" targeting that townhall gets added to the relevant unit group, then if a unit from that unitgroup gets ordered to do something else, it's removed from the unit group.

Then of course you'd also need a trigger for whenever a townhall is built or destroyed.

Do you know if I can make a trigger which makes a new variable (unit group) each time a player build a new main ? Because the map I'm trying to do is a "world war" type map. There are a lot of gold ressources and macro to do in order to spam buildings/flood units and defeat other players, so I need to compress my triggers to the maximum (It's possible that each player makes more than 12 bases during a single game !)
 
Level 12
Joined
Nov 3, 2013
Messages
989
Do you know if I can make a trigger which makes a new variable (unit group) each time a player build a new main ? Because the map I'm trying to do is a "world war" type map. There are a lot of gold ressources and macro to do in order to spam buildings/flood units and defeat other players, so I need to compress my triggers to the maximum (It's possible that each player makes more than 12 bases during a single game !)
That's precisely what I did, and that's why you would need the unit variable and unitgroup variable to both be "arrays", it's shown as a checkbox which you tick in when you create the variables.

A variable that's an array will have brackets at the end, something like this: "myVariable[]". Which means that you can use numbers inside the brackets to use the same variable for multiple units etc. like "myVariable[1]", "myVariable[2]", "myVariable[3]", and so on.

Each time a new townhall is created, you set a new variable with a higher number inside the brackets. You'll need an integer variable to keep track of how many of these townhalls there are, which is what "harvest_townhall_maxIndex" was meant for in my post.

Then every a townhall is destroyed, you should also remove it, which means that the "harvest_townhall_maxIndex" would be lowered. Here's a tutorial for how to make "dynamic indexing" for MUI or the like Visualize: Dynamic Indexing

Though probably you wouldn't really need to since the chances of enough townhalls being made for it to be a problem isn't all that high...
 
Level 4
Joined
Feb 9, 2009
Messages
50
townhallindexmax.jpg


Ok so I started the trigger and I can't find where/how you only put the index variable :eek:
I think that I missunderstood what you said here :

Each time a new townhall is created, you set a new variable with a higher number inside the brackets. You'll need an integer variable to keep track of how many of these townhalls there are, which is what "harvest_townhall_maxIndex" was meant for in my post.

I also have another question : Do I need to put a specific number at the right of the array of the integer variable ?

That's precisely what I did, and that's why you would need the unit variable and unitgroup variable to both be "arrays", it's shown as a checkbox which you tick in when you create the variables.

I'll try to search by my own if I can find the way to make the trigger in the same shape as you did, in the mean time waiting for your answer ! Thanks !
 
Level 12
Joined
Nov 3, 2013
Messages
989
It's an option you turn on/off while creating/editing the variable.

99a4f9e54d.png


I also have another question : Do I need to put a specific number at the right of the array of the integer variable ?
Well... yes and no.

The number should be based of an integer variable, which keeps track of how many townhalls there are.


So in practice, when the first townhall is created, it becomes townhall[1]. When the second one is created, it becomes townhall[2], and so on.

And similarly you'd have the unit groups with the same index (number inside the brackets), so for townhall[1] you'd use unitgroup[1], and so on.

p.s. the names for the variables can be whatever you want, so don't focus about it that much.
 
Level 4
Joined
Feb 9, 2009
Messages
50
Here is what I did so far :

  • Harvest Human Townhall
    • Events
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Peasant
    • Actions
      • Partie - Display to (All players) the text: (String((Issued order)))
      • For each (Integer A) from 1 to harvest_humantownhall_maxindex[0], do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Issued order) Egal à (Order(resumeharvest))
              • (Target unit of issued order) Egal à harvest_humantownhall[0]
            • Alors - Actions
              • Groupe unité - Add (Triggering unit) to harvest_humantownhall_group[0]
            • Sinon - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_humantownhall_group[0]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_humantownhall_group[0]
                • Sinon - Actions
                  • Do nothing
 
Level 4
Joined
Feb 9, 2009
Messages
50
It's an option you turn on/off while creating/editing the variable.

No in fact I mean how can you have the index "harvest_townhall_maxIndex" without any number at the right ?
On my screenshot I try to do it same as you "from 1 to harvest_human_townhallmaxindex" but it doesn't work as I need to put a value on the index. This is precisely what I don't understand :oops:

townhallindexmax2.jpg
 
Level 7
Joined
Apr 17, 2017
Messages
316
No in fact I mean how can you have the index "harvest_townhall_maxIndex" without any number at the right ?
On my screenshot I try to do it same as you "from 1 to harvest_human_townhallmaxindex" but it doesn't work as I need to put a value on the index. This is precisely what I don't understand :oops:

townhallindexmax2.jpg
Max index should have no array. Go to your variable editor, find your maxindex variable uncheck the array option.
 
Level 4
Joined
Feb 9, 2009
Messages
50
  • Harvest Townhall
    • Events
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Peasant
    • Actions
      • Partie - Display to (All players) the text: (String((Issued order)))
      • For each (Integer A) from 1 to maxindex, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Issued order) Egal à (Order(resumeharvest))
              • (Target unit of issued order) Egal à harvest_townhall[(Integer A)]
            • Alors - Actions
              • Groupe unité - Add (Triggering unit) to harvest_townhall_group[(Integer A)]
            • Sinon - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_townhall_group[(Integer A)]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_townhall_group[(Integer A)]
                • Sinon - Actions
                  • Do nothing

If I've understood all of this correctly, this shoulds work fine to add and remove units from the harvest group ^^

WC3-Scrn-Shot-021619-105725-01.png

Now I'll add more actions to the trigger to try to solve my issue. Thank you for the help so far ... I've added you into the credits of the map as a special thanks. If I have another issue doing the whole thing, I'll tell you and also whenever I'm successfull with fixing all of this :goblin_boom:
 
Last edited:
Level 4
Joined
Feb 9, 2009
Messages
50
I've certainly done mistakes because I don't get it to work properly ! :eek:

Here are all the concerned triggers (harvest/create/remove/upgradefacingangle/upgradefromthestarterbuilding) :

  • Harvest High Elf
    • Events
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Operative
    • Actions
      • For each (Integer A) from 1 to maxindex, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Issued order) Egal à (Order(resumeharvest))
              • (Target unit of issued order) Egal à harvest_townhall[(Integer A)]
            • Alors - Actions
              • Groupe unité - Add (Triggering unit) to harvest_townhall_group[(Integer A)]
              • Groupe unité - Pick every unit in harvest_townhall_group[(Integer A)] and do (Actions)
                • Boucle - Actions
                  • Unité - Order (Picked unit) to Rapporter les ressources
            • Sinon - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_townhall_group[(Integer A)]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_townhall_group[(Integer A)]
                • Sinon - Actions
                  • Do nothing
  • Create HE Townhall
    • Events
      • Unité - A unit Finit la construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Constructed structure) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Constructed structure)) Egal à High Elf Townhall (High Elf2)
        • Alors - Actions
          • Groupe unité - Add (Triggering unit) to HE_Townhallgroup[(Integer A)]
          • Set harvest_townhall[(Integer A)] = (Triggering unit)
        • Sinon - Actions
          • Do nothing
  • Upgrading into HE DK
    • Events
      • Unité - A unit Termine une amélioration
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Triggering unit) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Triggering unit)) Egal à Dungeon Keep (High Elf)
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Triggering unit) is in HE_Townhallgroup[(Integer A)]) Egal à FALSE
            • Alors - Actions
              • Set harvest_townhall[(Integer A)] = (Triggering unit)
              • Groupe unité - Add (Triggering unit) to HE_Townhallgroup[(Integer A)]
            • Sinon - Actions
              • Do nothing
        • Sinon - Actions
          • Do nothing
  • Remove HE Citadel
    • Events
      • Unité - A unit Meurt
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Triggering unit) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Triggering unit)) Egal à Citadel (High Elf)
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Triggering unit) is in HE_Townhallgroup[(Integer A)]) Egal à FALSE
            • Alors - Actions
              • Groupe unité - Remove (Triggering unit) from HE_Townhallgroup[(Integer A)]
            • Sinon - Actions
              • Do nothing
        • Sinon - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Triggering unit) is Un bâtiment) Egal à TRUE
              • (Unit-type of (Triggering unit)) Egal à Castle (High Elf)
            • Alors - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in HE_Townhallgroup[(Integer A)]) Egal à FALSE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from HE_Townhallgroup[(Integer A)]
                • Sinon - Actions
                  • Do nothing
            • Sinon - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is Un bâtiment) Egal à TRUE
                  • (Unit-type of (Triggering unit)) Egal à Dungeon Keep (High Elf)
                • Alors - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si - Conditions
                      • ((Triggering unit) is in HE_Townhallgroup[(Integer A)]) Egal à FALSE
                    • Alors - Actions
                      • Groupe unité - Remove (Triggering unit) from HE_Townhallgroup[(Integer A)]
                    • Sinon - Actions
                      • Do nothing
                • Sinon - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si - Conditions
                      • ((Triggering unit) is Un bâtiment) Egal à TRUE
                      • (Unit-type of (Triggering unit)) Egal à High Elf Townhall (High Elf2)
                    • Alors - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Si - Conditions
                          • ((Triggering unit) is in HE_Townhallgroup[(Integer A)]) Egal à FALSE
                        • Alors - Actions
                          • Groupe unité - Remove (Triggering unit) from HE_Townhallgroup[(Integer A)]
                        • Sinon - Actions
                          • Do nothing
                    • Sinon - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Si - Conditions
                          • ((Triggering unit) is Un bâtiment) Egal à TRUE
                          • (Unit-type of (Triggering unit)) Egal à High Elf Townhall (High Elf)
                        • Alors - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • Si - Conditions
                              • ((Triggering unit) is in HE_Townhallgroup[(Integer A)]) Egal à FALSE
                            • Alors - Actions
                              • Groupe unité - Remove (Triggering unit) from HE_Townhallgroup[(Integer A)]
                            • Sinon - Actions
                              • Do nothing
                        • Sinon - Actions
  • Upgrading into HE Citadel
    • Events
      • Unité - A unit Termine une amélioration
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Triggering unit) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Triggering unit)) Egal à Citadel (High Elf)
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Triggering unit) is in BurningUpgradeGroup) Egal à FALSE
            • Alors - Actions
              • Unité - Remove (Triggering unit) from the game
              • Unité - Create 1 Citadel (High Elf) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 210.00 degrees
            • Sinon - Actions
              • Do nothing
        • Sinon - Actions
          • Do nothing
 
Last edited:
Level 4
Joined
Feb 9, 2009
Messages
50
I've tried something different becuz the array & integer/index thing gave me a big headache. So, I could be wrong but I think the "return ressource" orders doesn't work to fix my issue here.

The workers return their gold/lumber and then they just stop working. I have to select them manually again and that's a problem for the intense macrogame. :eek:

  • Harvest High Elf Copier
    • Evénements
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Operative
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si - Conditions
        • (Issued order) Egal à (Order(resumeharvest))
        • ((Triggering unit) is in HE_Group) Egal à FALSE
      • Alors - Actions
        • Groupe unité - Add (Triggering unit) to HE_Group
      • Sinon - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Si - Conditions
            • (Issued order) Egal à (Order(harvest))
            • ((Triggering unit) is in HE_Group) Egal à TRUE
          • Alors - Actions
            • Groupe unité - Remove (Triggering unit) from HE_Group
          • Sinon - Actions
            • Do nothing
  • Upgrading into HE Citadel
    • Evénements
      • Unité - A unit Termine une amélioration
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Triggering unit) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Triggering unit)) Egal à Citadel (High Elf)
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Triggering unit) is in BurningUpgradeGroup) Egal à FALSE
            • Alors - Actions
              • Unité - Remove (Triggering unit) from the game
              • Unité - Create 1 Citadel (High Elf) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 210.00 degrees
              • Groupe unité - Pick every unit in HE_Group and do (Actions)
                • Boucle - Actions
                  • Unité - Order (Picked unit) to Rapporter les ressources
            • Sinon - Actions
              • Do nothing
        • Sinon - Actions
          • Do nothing

Now if you have any idea on how to solve this, you would be my guest ! :infl_thumbs_up:
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
  • Harvest High Elf
    • Events
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Operative
    • Actions
      • For each (Integer A) from 1 to maxindex, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Issued order) Egal à (Order(resumeharvest))
              • (Target unit of issued order) Egal à harvest_townhall[(Integer A)]
            • Alors - Actions
              • Groupe unité - Add (Triggering unit) to harvest_townhall_group[(Integer A)]
              • Groupe unité - Pick every unit in harvest_townhall_group[(Integer A)] and do (Actions)
                • Boucle - Actions
                  • Unité - Order (Picked unit) to Rapporter les ressources
            • Sinon - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_townhall_group[(Integer A)]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_townhall_group[(Integer A)]
                • Sinon - Actions
                  • Do nothing
I'm not quite sure what this part says:
  • Groupe unité - Pick every unit in harvest_townhall_group[(Integer A)] and do (Actions)
    • Boucle - Actions
      • Unité - Order (Picked unit) to Rapporter les ressources
But I'm pretty sure that it shouldn't be there.

In the second trigger it says this:
  • Groupe unité - Add (Triggering unit) to HE_Townhallgroup[(Integer A)]
But there's no loop, so (Integer A) is always going to be equal to 0.

Though I'm not sure what it would be needed for, and even if you needed it, I think it would work without being an array. Since it appears to be a unit group for the townhalls.

  • Create HE Townhall
    • Events
      • Unité - A unit Finit la construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Constructed structure) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Constructed structure)) Egal à High Elf Townhall (High Elf2)
        • Alors - Actions
          • Groupe unité - Add (Triggering unit) to HE_Townhallgroup[(Integer A)]
          • Set harvest_townhall[(Integer A)] = (Triggering unit)
        • Sinon - Actions
          • Do nothing
"Set harvest_townhall[(Integer A)] = (Triggering unit)"

Again, there's no loop in this trigger, so (Integer A) is always going to be 0. And also, "(Triggering Unit)" refers to the unit that contstructed the building I'm pretty sure. What you should use here is (Constructed structure)
c8d96c7475.png


And there were similar problems with the other triggers as well



Anyway, it's possible that even if you fix it all, it won't work. I would assume that it will work, but maybe it won't. I can't know for sure without seeing the map, so if feel like you're having too much trouble here, you could upload another test map that replicates the problem (because I assume you wouldn't want to upload the original map, right?) and I'll take a look at it and fix it.
 
Level 12
Joined
Nov 3, 2013
Messages
989
I've tried something different becuz the array & integer/index thing gave me a big headache. So, I could be wrong but I think the "return ressource" orders doesn't work to fix my issue here.

The workers return their gold/lumber and then they just stop working. I have to select them manually again and that's a problem for the intense macrogame. :eek:

  • Harvest High Elf Copier
    • Evénements
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Operative
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si - Conditions
        • (Issued order) Egal à (Order(resumeharvest))
        • ((Triggering unit) is in HE_Group) Egal à FALSE
      • Alors - Actions
        • Groupe unité - Add (Triggering unit) to HE_Group
      • Sinon - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Si - Conditions
            • (Issued order) Egal à (Order(harvest))
            • ((Triggering unit) is in HE_Group) Egal à TRUE
          • Alors - Actions
            • Groupe unité - Remove (Triggering unit) from HE_Group
          • Sinon - Actions
            • Do nothing
  • Upgrading into HE Citadel
    • Evénements
      • Unité - A unit Termine une amélioration
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Triggering unit) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Triggering unit)) Egal à Citadel (High Elf)
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Triggering unit) is in BurningUpgradeGroup) Egal à FALSE
            • Alors - Actions
              • Unité - Remove (Triggering unit) from the game
              • Unité - Create 1 Citadel (High Elf) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 210.00 degrees
              • Groupe unité - Pick every unit in HE_Group and do (Actions)
                • Boucle - Actions
                  • Unité - Order (Picked unit) to Rapporter les ressources
            • Sinon - Actions
              • Do nothing
        • Sinon - Actions
          • Do nothing

Now if you have any idea on how to solve this, you would be my guest ! :infl_thumbs_up:
Hmm, this looks like it should work, I think. I'm not entierly sure since I don't understand all of text that's not in english.

Just on the off chance though, try and see if it works if you put a 0.01 wait between

  • Unité - Create 1 Citadel (High Elf) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 210.00 degrees
and
  • Groupe unité - Pick every unit in HE_Group and do (Actions)
    • Boucle - Actions
      • Unité - Order (Picked unit) to Rapporter les ressources
It probably won't work if the trigger doesn't work already, but it might, so give it a try.
 
Level 4
Joined
Feb 9, 2009
Messages
50
Anyway, it's possible that even if you fix it all, it won't work. I would assume that it will work, but maybe it won't. I can't know for sure without seeing the map, so if feel like you're having too much trouble here, you could upload another test map that replicates the problem (because I assume you wouldn't want to upload the original map, right?) and I'll take a look at it and fix it.

Yeah, all of this is getting pretty damn confusing right now :plol:
I'm so glad that you can help me facing this issue as it is really hard for me to fix things. And so here is the map (I don't mind giving you the original).

I've deleted the integer version of the trigger in this version and tried/failled to make one without aray ... (you'll find those triggers in the Building Issues file of the triggers just under "High Elf" category).

It probably won't work if the trigger doesn't work already, but it might, so give it a try.

I've tried and it didn't work, my triggers are all doomed :D
 

Attachments

  • Mini_Guerre_Mondiale_TEST_0.9B.w3x
    9.1 MB · Views: 31
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
Ok I figured out the 2 underlying problems.

First of all, I said "resumeharvest" but the order was "resumeharvesting", so the units were never being added to the unit group.

Secondly, "Unit - Order (Picked unit) to Return Resources" is apparently a different order than "resumeharvesting", because this order will make the units only return to the townhall, but they won't continue harvesting afterwards. So they end up idle around the townhall.

Also, the "resumeharvesting" order doesn't seem to appear on gui, so you have to do like this:
  • Custom script: call IssueTargetOrderById(GetEnumUnit(), 852017, udg_townhall)

I'll get back in a while with test map and/or fixing your map.
 
Last edited:
Level 4
Joined
Feb 9, 2009
Messages
50
Ok I figured out the 2 underlying problems.

First of all, I said "resumeharvest" but the order was "resumeharvesting", so the units were never being added to the unit group.

Secondly, "Unit - Order (Picked unit) to Return Resources" is apparently a different order than "resumeharvesting", because this order will make the units only return to the townhall, but they won't continue harvesting afterwards. So they end up idle around the townhall.

Also, the "resumeharvesting" order doesn't seem to appear on gui, so you have to do like this:
  • Custom script: call IssueTargetOrderById(GetEnumUnit(), 852017, udg_townhall)

I'll get back in a while with test map and/or fixing your map.

This explains why it didn't work well. Thank you again for all your help :infl_thumbs_up:
 
Level 12
Joined
Nov 3, 2013
Messages
989
sigh, it still doesn't work. For some reason it's different when you issue order with triggers. Return resources doesn't work, resume harvesting doesn't work, right-click doesn't work either...

I'll continue looking if I can find an order, otherwise it will get a lot more complicated if it's not possible to make the units resume harvesting automatically.
 
Level 4
Joined
Feb 9, 2009
Messages
50
sigh, it still doesn't work. For some reason it's different when you issue order with triggers. Return resources doesn't work, resume harvesting doesn't work, right-click doesn't work either...

I'll continue looking if I can find an order, otherwise it will get a lot more complicated if it's not possible to make the units resume harvesting automatically.

Yeah ... I guess it's much more of a major than a minor issue now ^^
I tried to avoid fixing it for a long time, now I know why :p
 
Level 7
Joined
Apr 17, 2017
Messages
316
sigh, it still doesn't work. For some reason it's different when you issue order with triggers. Return resources doesn't work, resume harvesting doesn't work, right-click doesn't work either...

I'll continue looking if I can find an order, otherwise it will get a lot more complicated if it's not possible to make the units resume harvesting automatically.
Were you able to get it's order id by using
  • call BJDebugMsg(I2S(GetIssuedOrderId()))
if not then it's a lost cause
 
Level 12
Joined
Nov 3, 2013
Messages
989
Were you able to get it's order id by using
  • call BJDebugMsg(I2S(GetIssuedOrderId()))
if not then it's a lost cause
resumeharvesting when used automatically shows 852017, but when I issued it with trigger, the workers wouldn't automatically use harvest again afterwards. (So the same order didn't work the same depending on if it was issued normally or by a trigger.)


Right now I'm looking at custom event resources. Otherwise it seems like one could issue the order to gather again (so the workers would start walking to the townhall, then back to the tree or goldmine they were gathering from earlier, then they'll automatically return resources and act as normal again.) because for some reason gather appears to work normally.

The second option would be to use a custom event or on newer warcraft 3 version detect a unit becoming idle. Or maybe a periodic event that check for units within range of the townhall...


So yeah it would be a lot nicer if there's an event to detect if a unit has returned resources, because in that case one would only have to issue resumeharvesting/returnresources, then it would work to issue the gather order since that works as it should.

I haven't used these autoharvestgold/autoharvestlumber orders before, but that should work, and if not I guess one would have to keep track of the goldmine or tree that was harvested from.



So I wouldn't say that it's a completely lost cause, but a lot of effort would go into making a decent workaround...
 
Level 12
Joined
Nov 3, 2013
Messages
989
I didn't manage to make a proper workaround, but the easiest fix which should be good enough is to instead of trying to make the workers return to the townhall, and then resume harvesting again after dropping off the resources, is to simply order them to harvest again.

They'll spend some time walking back to the trees or goldmine, but how often will a player upgrade their townhall or build a new one?

Anyway, if you really want to be thorough you'd have to store the trees or goldmines with variables for each worker, but I think you should be able to simply use
  • Unit - Order (Picked unit) to Harvest Nearby Lumber
since it seems like the workers only harvest lumber on your map anyway.

Though I'm not sure about those boats.


Anyway, I finally put together the test map, I got stuck and didn't realize what was wrong until I figured out that apparently you have to initialize the array size of unit group variables when you make them...
Currently I've set it to 14, so you can't have more than 14 town halls or the trigger won't work anymore. Of course you could change this limit, I just randomly decided that 14 is pretty good, but I'm not sure about the limit, and whether or not it's possible to change the arraysize dynamically.

p.s. on the map I differentiated between gold miners and lumberjacks, but that might be unnecessary on your map.
 

Attachments

  • resume harvest.w3x
    30.5 KB · Views: 27
Level 4
Joined
Feb 9, 2009
Messages
50
I didn't manage to make a proper workaround, but the easiest fix which should be good enough is to instead of trying to make the workers return to the townhall, and then resume harvesting again after dropping off the resources, is to simply order them to harvest again.

They'll spend some time walking back to the trees or goldmine, but how often will a player upgrade their townhall or build a new one?

Anyway, if you really want to be thorough you'd have to store the trees or goldmines with variables for each worker, but I think you should be able to simply use
  • Unit - Order (Picked unit) to Harvest Nearby Lumber
since it seems like the workers only harvest lumber on your map anyway.

Though I'm not sure about those boats.


Anyway, I finally put together the test map, I got stuck and didn't realize what was wrong until I figured out that apparently you have to initialize the array size of unit group variables when you make them...
Currently I've set it to 14, so you can't have more than 14 town halls or the trigger won't work anymore. Of course you could change this limit, I just randomly decided that 14 is pretty good, but I'm not sure about the limit, and whether or not it's possible to change the arraysize dynamically.

p.s. on the map I differentiated between gold miners and lumberjacks, but that might be unnecessary on your map.

Wow i'm really impressed ! I'll have a look at all of this tomorrow and start fixing my map. I wish you a good night and ... all my thanks again ! :infl_thumbs_up:
 
Level 4
Joined
Feb 9, 2009
Messages
50
Hmmm, I'm sorry to tell you this but it still doesn't work on my map. I checked array to initialize unit groups and then unchecked, set the arraysize at 20 for the townhalls and changed a bit the triggers to fit them with my map :eek: (I also attached last version of my map if you want to look at it)

  • Upgrading into HE Citadel
    • Evénements
      • Unité - A unit Termine une amélioration
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Triggering unit) is Un bâtiment) Egal à TRUE
          • (Unit-type of (Triggering unit)) Egal à Citadel (High Elf)
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Triggering unit) is in BurningUpgradeGroup) Egal à FALSE
            • Alors - Actions
              • Unité - Remove (Triggering unit) from the game
              • Unité - Create 1 Citadel (High Elf) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 210.00 degrees
              • For each (Integer A) from 1 to harvest_townhall_index, do (Actions)
                • Boucle - Actions
                  • Set harvest_townhall_index = (harvest_townhall_index + 1)
                  • Set harvest_townhall[harvest_townhall_index] = (Last created unit)
                  • Groupe unité - Pick every unit in harvest_group[(Integer A)] and do (Actions)
                    • Boucle - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Si - Conditions
                          • ((Picked unit) is in harvest_lumberjacks) Egal à TRUE
                        • Alors - Actions
                          • Unité - Order (Picked unit) to Récolter le bois proche
                        • Sinon - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • Si - Conditions
                              • ((Picked unit) is in harvest_miners) Egal à TRUE
                            • Alors - Actions
                              • Unité - Order (Picked unit) to Collecter or proche
                            • Sinon - Actions
                              • Do nothing
            • Sinon - Actions
              • Do nothing
        • Sinon - Actions
          • Do nothing

  • townhall built
    • Evénements
      • Unité - A unit Finit la construction
    • Conditions
      • (Unit-type of (Constructed structure)) Egal à High Elf Townhall (High Elf2)
    • Actions
      • Set harvest_townhall_index = (harvest_townhall_index + 1)
      • Set harvest_townhall[harvest_townhall_index] = (Constructed structure)
  • townhall destroyed
    • Evénements
      • Unité - A unit Meurt
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Egal à High Elf Townhall (High Elf)
          • (Unit-type of (Dying unit)) Egal à High Elf Townhall (High Elf2)
          • (Unit-type of (Dying unit)) Egal à Dungeon Keep (High Elf)
          • (Unit-type of (Dying unit)) Egal à Castle (High Elf)
          • (Unit-type of (Dying unit)) Egal à Citadel (High Elf)
    • Actions
      • For each (Integer A) from 1 to harvest_townhall_index, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Triggering unit) Egal à harvest_townhall[(Integer A)]
            • Alors - Actions
              • Groupe unité - Remove all units from harvest_group[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • (Integer A) Inférieur à harvest_townhall_index
                • Alors - Actions
                  • Set harvest_townhall[(Integer A)] = harvest_townhall[harvest_townhall_index]
                • Sinon - Actions
              • Set harvest_townhall_index = (harvest_townhall_index - 1)
              • Skip remaining actions
            • Sinon - Actions
  • harvest
    • Evénements
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Operative
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Issued order) Egal à (Order(harvest))
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Unit-type of (Target unit of issued order)) Egal à Mine d'or
            • Alors - Actions
              • Groupe unité - Remove (Triggering unit) from harvest_lumberjacks
              • Groupe unité - Add (Triggering unit) to harvest_miners
            • Sinon - Actions
              • Groupe unité - Remove (Triggering unit) from harvest_miners
              • Groupe unité - Add (Triggering unit) to harvest_lumberjacks
          • For each (Integer A) from 1 to harvest_townhall_index, do (Actions)
            • Boucle - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_group[(Integer A)]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_group[(Integer A)]
                • Sinon - Actions
          • Skip remaining actions
        • Sinon - Actions
          • Set tempUnit = (Target unit of issued order)
          • For each (Integer A) from 1 to harvest_townhall_index, do (Actions)
            • Boucle - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_group[(Integer A)]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_group[(Integer A)]
                • Sinon - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • tempUnit Egal à harvest_townhall[(Integer A)]
                • Alors - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si - Conditions
                      • (Issued order) Egal à (Order(resumeharvesting))
                    • Alors - Actions
                      • Groupe unité - Add (Triggering unit) to harvest_group[(Integer A)]
                    • Sinon - Actions
                • Sinon - Actions

As I'm not familiar with all of this, I could've done something wrong again :confused:

since it seems like the workers only harvest lumber on your map anyway.
p.s. on the map I differentiated between gold miners and lumberjacks, but that might be unnecessary on your map.

In fact, High Elf Operatives harvest both gold and lumber so it's necessary to have them both

They'll spend some time walking back to the trees or goldmine, but how often will a player upgrade their townhall or build a new one ?

As often as they make an expansion which is really often in this kind of map (I usually see 10+ expands by players) and also when they're rebuilding their economy after being almost completely destroyed ^^

Though I'm not sure about those boats.

The transport ships have a harvest gold ability so they can harvest gold in the water (oil platforms are equivalent to goldmines and shipyards to townhall with gather ability), but this is just an addition to the game to have an additional source of income when land goldmines ain't enough ! Main gold income comes from traditional goldmines here :psmile:

Anyway, sorry to bother you again, I know it's exhausting to try to fix this issues :eek:
 

Attachments

  • Mini_Guerre_Mondiale_TEST_0.9B.w3x
    9.1 MB · Views: 36
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
Umm, ok. I got a bit fixated on fixing the problem that happens when the town hall is upgraded and replaced, but I just can't seem to get it right...

Eventually I remembered that this was the minor problem of the two, and all this workaround is merely to allow the building to be rotated a bit... Even when I get it to work the town hall usually gets moved a bit out of place and well it just doesn't seem like its worth it all just to rotate a building.


Anyway, I didn't think much about it until I started to think that maybe I should tackle the actual problem; the thing with the transport ships and oil platforms.

Well... Remember how I thought there were no goldmines on your map? That's because ingame there's no goldmines or oil platforms, but when I look in the world editor there's both goldmines and oil platforms...

Anyway, I realized why that is, it's since I prefer to use JNGP world editor, so I'm using an older version of warcraft 3, which means the player owning the goldmines etc. doesn't exist for me. So I'll have to use the standard world editor with the newer warcraft 3 version.


p.s. I just thought to give you an update since I haven't said anything for a while to let you know what's up.
 
Level 4
Joined
Feb 9, 2009
Messages
50
Umm, ok. I got a bit fixated on fixing the problem that happens when the town hall is upgraded and replaced, but I just can't seem to get it right...

Eventually I remembered that this was the minor problem of the two, and all this workaround is merely to allow the building to be rotated a bit... Even when I get it to work the town hall usually gets moved a bit out of place and well it just doesn't seem like its worth it all just to rotate a building.

Yeah I think that's it's complicating things too. In fact it shoul've been easier to rotate the building by making it a custom model to fit with the first 3 tiered townhall building of the high elves, but I dunno how to do that (I've just added a custom harvestgold animation to the VoidWalker ingame based on the acolyte animation).

EDIT : I've just figured it out how to rotate the model properly so it's now a custom model instead of the basic ingame model. Yes, indeed I don't need to rotate this building in triggers anymore ! (and I also did the same on my Sinister Statue building ...)


Anyway, I didn't think much about it until I started to think that maybe I should tackle the actual problem; the thing with the transport ships and oil platforms.

Well... Remember how I thought there were no goldmines on your map? That's because ingame there's no goldmines or oil platforms, but when I look in the world editor there's both goldmines and oil platforms...

Anyway, I realized why that is, it's since I prefer to use JNGP world editor, so I'm using an older version of warcraft 3, which means the player owning the goldmines etc. doesn't exist for me. So I'll have to use the standard world editor with the newer warcraft 3 version.

The issue with boats and oil platforms is half-fixed, they got a new and correct path to gather gold to the shipyard but they stop harvesting when the shipyard is replaced (but that one seems really necessary).

p.s. I just thought to give you an update since I haven't said anything for a while to let you know what's up.

NP, we all have life to run. I'm already glad that you can provide your help and your point of view on this matter ! :infl_thumbs_up:

EDIT : But I still need your help for the shipyards, transports and oil ^^

So I've started to modify your triggers once more

  • shipyard built
    • Evénements
      • Unité - A unit Finit la construction
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Constructed structure)) Egal à Naval Shipyard
          • (Unit-type of (Constructed structure)) Egal à Chantier naval des Elfes|nde la nuit (High Elf)
          • (Unit-type of (Constructed structure)) Egal à Chantier naval des Gobelins
          • (Unit-type of (Constructed structure)) Egal à Naval Shipyard (Dwarf)
          • (Unit-type of (Constructed structure)) Egal à Chantier naval des Orcs
          • (Unit-type of (Constructed structure)) Egal à Chantier naval des Trolls
          • (Unit-type of (Constructed structure)) Egal à Demonic Shipyard
          • (Unit-type of (Constructed structure)) Egal à Chantier naval des Morts-vivants
          • (Unit-type of (Constructed structure)) Egal à Chantier naval des Elfes|nde la nuit
          • (Unit-type of (Constructed structure)) Egal à Dark Elves Shipyard
    • Actions
      • Set harvest_townhall_index = (harvest_townhall_index + 1)
      • Set harvest_townhall[harvest_townhall_index] = (Constructed structure)
  • shipyard destroyed
    • Evénements
      • Unité - A unit Meurt
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Egal à Chantier naval des Elfes|nde la nuit (High Elf)
          • (Unit-type of (Dying unit)) Egal à Chantier naval des Gobelins
          • (Unit-type of (Dying unit)) Egal à Naval Shipyard (Dwarf)
          • (Unit-type of (Dying unit)) Egal à Naval Shipyard
          • (Unit-type of (Dying unit)) Egal à Chantier naval des Trolls
          • (Unit-type of (Dying unit)) Egal à Demonic Shipyard
          • (Unit-type of (Dying unit)) Egal à Chantier naval des Morts-vivants
          • (Unit-type of (Dying unit)) Egal à Chantier naval des Elfes|nde la nuit
          • (Unit-type of (Dying unit)) Egal à Dark Elves Shipyard
          • (Unit-type of (Dying unit)) Egal à Chantier naval des Orcs
    • Actions
      • For each (Integer A) from 1 to harvest_townhall_index, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Triggering unit) Egal à harvest_townhall[(Integer A)]
            • Alors - Actions
              • Groupe unité - Remove all units from harvest_group[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • (Integer A) Inférieur à harvest_townhall_index
                • Alors - Actions
                  • Set harvest_townhall[(Integer A)] = harvest_townhall[harvest_townhall_index]
                • Sinon - Actions
              • Set harvest_townhall_index = (harvest_townhall_index - 1)
              • Skip remaining actions
            • Sinon - Actions
  • harvest
    • Evénements
      • Unité - A unit Reçoit un ordre avec objet pour cible
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Ordered unit)) Egal à Navire des Elfes de la nuit
          • (Unit-type of (Ordered unit)) Egal à Navire des Morts-vivants
          • (Unit-type of (Ordered unit)) Egal à Transport Ship
          • (Unit-type of (Ordered unit)) Egal à Transport des Orcs
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Issued order) Egal à (Order(harvest))
        • Alors - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Unit-type of (Target unit of issued order)) Egal à Oil Platform
            • Alors - Actions
              • Groupe unité - Remove (Triggering unit) from harvest_lumberjacks
              • Groupe unité - Add (Triggering unit) to harvest_miners
            • Sinon - Actions
              • Groupe unité - Remove (Triggering unit) from harvest_miners
              • Groupe unité - Add (Triggering unit) to harvest_lumberjacks
          • For each (Integer A) from 1 to harvest_townhall_index, do (Actions)
            • Boucle - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_group[(Integer A)]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_group[(Integer A)]
                • Sinon - Actions
          • Skip remaining actions
        • Sinon - Actions
          • Set tempUnit = (Target unit of issued order)
          • For each (Integer A) from 1 to harvest_townhall_index, do (Actions)
            • Boucle - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Triggering unit) is in harvest_group[(Integer A)]) Egal à TRUE
                • Alors - Actions
                  • Groupe unité - Remove (Triggering unit) from harvest_group[(Integer A)]
                • Sinon - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • tempUnit Egal à harvest_townhall[(Integer A)]
                • Alors - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si - Conditions
                      • (Issued order) Egal à (Order(resumeharvesting))
                    • Alors - Actions
                      • Groupe unité - Add (Triggering unit) to harvest_group[(Integer A)]
                    • Sinon - Actions
                • Sinon - Actions
 

Attachments

  • Mini_Guerre_Mondiale_TEST_0.9C.w3x
    9.2 MB · Views: 43
  • ArcaneObservatory5.mdx
    229.9 KB · Views: 32
  • BlackCitadelStatue3.mdx
    14.1 KB · Views: 33
Last edited:
Status
Not open for further replies.
Top