• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Upgrade an Attachment

Status
Not open for further replies.
  • Iron Sword
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Iron Sword for Player 1 (Red)) Equal to 1
        • Then - Actions
          • Unit - Remove Attach1 from (YourUnit)
          • Unit - Add Attach1 to (YourUnit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Iron Sword for Player 1 (Red)) Equal to 2
            • Then - Actions
              • Unit - Remove Attach2 from (YourUnit)
              • Unit - Add Attach2 to (YourUnit)
            • Else - Actions
Maybe this works...
 
this is the trigger with every 0.25 seconds

  • Attachment1
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Iron Sword for Player 1 (Red)) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Peon) and do (Actions)
            • Loop - Actions
              • Unit - Remove Sword from (Picked unit)
              • Unit - Add Sword to (Picked unit)
        • Else - Actions
 
Level 11
Joined
Feb 16, 2009
Messages
760
Use a better method. Make 3 abilities based on human-spehere with your attachments. one has no techtree requirements, the other your research. Its in object data of the ability.
  • Example
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Iron Forged Swords
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Raider) and do (Unit - Remove Sphere from (Triggering unit))
 
Make this, and it should work properly, hope there aren't any faults
  • Attachment
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Peon) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Sword for Player 1 (Red)) Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Sword1 for (Picked unit)) Equal to 1
                • Then - Actions
                  • Do nothing // ignore this, don't add Do nothing
                • Else - Actions
                  • Unit - Add Sword1 to (Picked unit)
                  • Game - Display to (All players) the text: Attachment
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Sword for Player 1 (Red)) Equal to 2
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Sword2 for (Picked unit)) Equal to 1
                    • Then - Actions
                      • Do nothing
                    • Else - Actions
                      • Unit - Remove Sword1 from (Picked unit)
                      • Unit - Add Sword2 to (Picked unit)
                      • Game - Display to (All players) the text: Attachment
                • Else - Actions
//Edit: m4stah was faster, and with a smaller trigger, shame on me D:
 
Level 9
Joined
Apr 25, 2009
Messages
468
  • Your Trigger
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set PlayerGroup = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Player Group - Pick every player in PlayerGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of (Iron Sword) for (Picked player)) Equal to 1
            • Then - Actions
              • Set UnitGroup = (Units owned by (Picked player))
              • Unit Group - Pick every unit in UnitGroup and do (Actions)
                • Loop - Actions
                  • Unit - Remove Sword from (Picked Unit)
                  • Unit - Add Sword to (Picked Unit)
            • Else - Actions
      • Custom script: call DestroyForce(udg_PlayerGroup)
      • Custom script: call DestroyGroup(udg_UnitGroup)
 
Level 9
Joined
Apr 25, 2009
Messages
468
Good =] glad I could help a little ;)
Btw, ty for the +rep

EDIT

My bad! There was a error in the other playergroup, try this one:
  • Your trigger
    • Actions
      • Set PlayerGroup = (All players matching (((Matching player) is an enemy of (Owner of (Casting unit))) Equal to True))
      • -------- When you are done with all your Actions, do this --------
      • Custom script: call DestroyForce(udg_PlayerGroup)
(full trigger):
  • Your trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set PlayerGroup = (All players matching (((Matching player) is an enemy of (Owner of (Casting unit))) Equal to True))
      • Player Group - Pick every player in PlayerGroup and do (Actions)
        • Loop - Actions
          • Environment - Reset fog to default values
          • -------- Some other actions, such as timer --------
      • -------- When you are done with all your Actions, do this --------
      • Custom script: call DestroyForce(udg_PlayerGroup)
 
Status
Not open for further replies.
Top