• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

[Trigger] Need help to edit this trigger

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
Hi.
A month ago, a friendly person on this site helped me with this trigger. But now I need help to edit it and I dont want to bother him further. I wonder if anyone here can help me instead.

On my map I have replaced the resource lumber with a new resource called Knowledge. Every race has a "Library" they can construct. Every Library adds 1 lumber (1 Knowledge) to a players storage. This trigger creates units called "1 Knowledge" ,"2 Knowledge" and so on up to "4 Knowledge" when the equal number of lumber (Knowledge) is reached. Knowledge works as a requirement for units. A Riflemen requires "2 Knowledge" in order to be able to be built. The unit "2 Knowledge" is created as a dummy when the player has 2 Lumber. Hence when 2 Libraries are constructed.

The second trigger removes the lumber (Knowledge) when the libraries are destroyed. This system is an important feature on my map and it makes the players able to attack and destroy each other libraries to prevent them from getting to high up in the techtree.

I wonder, is this system able to maintain without useing the resource lumber?


  • Add Knowledge
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Constructed structure)) Equal to Library
          • (Unit-type of (Constructed structure)) Equal to Library
          • (Unit-type of (Constructed structure)) Equal to Library
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Current lumber) Equal to 0
        • Then - Actions
          • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) + 1)
          • Unit - Create 1 knowledge1_dummy for (Owner of (Triggering unit)) at ((Center of (Playable map area)) offset by (-4500.00, -4500.00)) facing Default building facing degrees
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) Current lumber) Equal to 1
            • Then - Actions
              • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) + 1)
              • Unit - Create 1 knowledge2_dummy for (Owner of (Triggering unit)) at ((Center of (Playable map area)) offset by (-4500.00, -4500.00)) facing Default building facing degrees
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Triggering unit)) Current lumber) Equal to 2
                • Then - Actions
                  • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) + 1)
                  • Unit - Create 1 knowledge3_dummy for (Owner of (Triggering unit)) at ((Center of (Playable map area)) offset by (-4500.00, -4500.00)) facing Default building facing degrees
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of (Triggering unit)) Current lumber) Equal to 3
                    • Then - Actions
                      • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) + 1)
                      • Unit - Create 1 knowledge4_dummy for (Owner of (Triggering unit)) at ((Center of (Playable map area)) offset by (-4500.00, -4500.00)) facing Default building facing degrees
                    • Else - Actions


  • Remove Knowledge
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Library
          • (Unit-type of (Triggering unit)) Equal to Library
          • (Unit-type of (Triggering unit)) Equal to Library
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Current lumber) Equal to 4
        • Then - Actions
          • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 1)
          • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type knowledge4_dummy) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) Current lumber) Equal to 3
            • Then - Actions
              • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 1)
              • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type knowledge3_dummy) and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Triggering unit)) Current lumber) Equal to 2
                • Then - Actions
                  • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 1)
                  • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type knowledge2_dummy) and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of (Triggering unit)) Current lumber) Equal to 1
                    • Then - Actions
                      • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 1)
                      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type knowledge1_dummy) and do (Actions)
                        • Loop - Actions
                          • Unit - Remove (Picked unit) from the game
                    • Else - Actions
 
Level 8
Joined
Feb 20, 2007
Messages
338
You will want to create variables (integer variables) for each team that plays.

You will need additional 'if/then/else' functions within this trigger - you will need one for each team/a variable for each team calling upon the condition of which/what player is triggering the event.

However it may be easier for you to make one trigger for one team (say team red), making an integer variable for Team_Red_Knowledge cobble together a working trigger for Team Red - then copy and paste that for each additional team you have, changing the functions to reflect Blue Player, Teal Player, blah making an individual variable for each team: Team_Blue_Knowledge, Team_Teal_Knowledge, etc.

If you already have a multiboard and you wish to show this knowledge data, then you would modify that to reflect this new data. If you don't have a multiboard then you may want to make one. But I assume the player can count their own libraries and figure out how much knowledge they have. (???)

For an integer based system you would want to change 'set player property' to 'set variable' calling upon that variable.

  • Set Team_Red_Knowledge = (Team_Red_Knowledge + 1.00)
and change all of those places you have 'owner of triggering unit' to the players, example:

  • Unit - Create 1 knowledge2_dummy for (Player 1 (Red)) at ((Center of (Playable map area)) offset by (-4500.00, -4500.00)) facing Default building facing degrees
 
Level 10
Joined
Nov 5, 2008
Messages
536
This is the one of few triggers on my map and it is the largest and most important one. I am not good at triggering, I can only make simple triggers. I would be very glad if I someone could help me to edit this trigger cause this is to difficult for me to do.

If I upload the map here, anyone has the time to help me out?
 
Last edited:
Level 4
Joined
Jan 24, 2009
Messages
124
Ok then just do
Create a 2nd Peasant (IN THE OB EDITOR) and create a LibrariLV2(No changes just the name) and edit the 2nd peasants build units and replace library to LibrariLV2
then if a peasant creates a library then replace the peasant with a 2nd Peasant
and then if the 2nd Peasant creates a LibrariLV2 then do the knowledge....
 
Status
Not open for further replies.
Top