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

Changing Attack Range

Status
Not open for further replies.
Level 2
Joined
Jul 30, 2006
Messages
30
In a map that I'm making I've been trying to add in a weapons system that allows the players to pick up and wield different weapons, sort of like Marine Corps Survival. I don't want to have the units actually change, but I want their attack values, attack speeds, attack ranges, and movement speeds to change with the weapon. I figured out that I can change the attack values, attack speeds, and movement speeds using abilities and buffs, but I have no idea how I can change the attack range.
Does anyone know how to change a unit's attack range (if it is even possible...)? It doesn't matter to me whether it is done by trigger or by an ability/buff.
 
Level 3
Joined
Jun 17, 2007
Messages
62
I tired a similar system in my map (want to make a aura that increases range).
But It wont work.

Any idea ?
 
Level 2
Joined
Jul 30, 2006
Messages
30
First off, I see that this topic got moved (my posts have a habit of doing that :)). Ummm, moved to where lolz?

Anyways... I never thought of that acquisition range thing, but it makes sense. Ill try it, thx. Ill post again if it worked for me.
 
Level 2
Joined
Jul 30, 2006
Messages
30
Well I just tried it, but nothing happened. I set the attack range to 20000 (thats the max it let me), but when I tried to change the acquisition range using triggers it did nothing at all. I had the acquisition range initially set to 10, and then I even tried setting it to 20000. Anyone know why the trigger wont work?
 
Level 2
Joined
Jul 30, 2006
Messages
30
Ok ill post here everything that might help, along with the trigger.

Im using the Marine model from the Konstruct Pack, along with the weapon attachments from it (if you have no idea what Im talking about, its a marine with no weapon. The attachments can be used with items to give a weapon). Im using this model with the marine included in warcraft, so it is normally a ranged unit anyways. Ill list some unit attributes:
Acquisition Range: 20000
Combat - Attack 1 - Range: 20000
Combat - Attack 1 - Range Motion Buffer: 250 (I dont even know what this does lolz - it's at default)
Combat - Attack 1 - Targets: Debris, Ground, Item, Structure (I didnt include Air because there are no air units for them to attack that they should be able to attack)
I don't know if changing the attack 2 values does anything to affect what Im trying to do. They are default right now.
Combat - Attacks Enabled: Attack 1 Only

And now for the trigger. Ill mark out where I tried to change the acquisition range. Ill also but the part where I tried to change it below the trigger.


  • ChangeWeapon
  • Events
  • Unit - A unit Uses an item
  • Conditions:
  • Actions:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Assault Rifle
          • (Item-type of (Item being manipulated)) Equal to Minigun
          • (Item-type of (Item being manipulated)) Equal to Shotgun
          • (Item-type of (Item being manipulated)) Equal to Sniper Rifle
          • (Item-type of (Item being manipulated)) Equal to Submachinegun
    • Then - Actions
      • -------- Check all item slots for an equipped weapon and disable that weapon --------
      • For each (Integer counter) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item carried by (Hero manipulating item) in slot counter)) Equal to Assault Rifle - Equipped
                  • (Item-type of (Item carried by (Hero manipulating item) in slot counter)) Equal to Minigun - Equipped
                  • (Item-type of (Item carried by (Hero manipulating item) in slot counter)) Equal to Shotgun - Equipped
                  • (Item-type of (Item carried by (Hero manipulating item) in slot counter)) Equal to Sniper Rifle - Equipped
                  • (Item-type of (Item carried by (Hero manipulating item) in slot counter)) Equal to Submachinegun - Equipped
            • Then - Actions
              • Set weaponCharges = (Charges remaining in (Item carried by (Hero manipulating item) in slot counter))
              • Set weaponType = (Item-type of (Item carried by (Hero manipulating item) in slot counter))
              • Item - Remove (Item carried by (Hero manipulating item) in slot counter)
            • Else - Actions
          • If (weaponType Equal to Assault Rifle - Equipped) then do (Hero - Create Assault Rifle and give it to (Hero manipulating item)) else do (Do nothing)
          • If (weaponType Equal to Minigun - Equipped) then do (Hero - Create Minigun and give it to (Hero manipulating item)) else do (Do nothing)
          • If (weaponType Equal to Shotgun - Equipped) then do (Hero - Create Shotgun and give it to (Hero manipulating item)) else do (Do nothing)
          • If (weaponType Equal to Sniper Rifle - Equipped) then do (Hero - Create Sniper Rifle and give it to (Hero manipulating item)) else do (Do nothing)
          • If (weaponType Equal to Submachinegun - Equipped) then do (Hero - Create Submachinegun and give it to (Hero manipulating item)) else do (Do nothing)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • weaponType Equal to Assault Rifle - Equipped
                  • weaponType Equal to Minigun - Equipped
                  • weaponType Equal to Shotgun - Equipped
                  • weaponType Equal to Sniper Rifle - Equipped
                  • weaponType Equal to Submachinegun - Equipped
            • Then - Actions
              • Item - Set charges remaining in (Last created item) to weaponCharges
            • Else - Actions
          • Set weaponType = Assault Rifle
      • Set weaponCharges = ((Charges remaining in (Item being manipulated)) + 1)
      • Set weaponType = (Item-type of (Item being manipulated))
      • Item - Remove (Item being manipulated)
      • -------- Choose the weapon to be equipped --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • weaponType Equal to Assault Rifle
        • Then - Actions
          • Hero - Create Assault Rifle - Equipped and give it to (Hero manipulating item)
          • Unit - Set (Hero manipulating item) acquisition range to 800.00
        • Else - Actions
      • If (weaponType Equal to Minigun) then do (Hero - Create Minigun - Equipped and give it to (Hero manipulating item)) else do (Do nothing)
      • If (weaponType Equal to Shotgun) then do (Hero - Create Shotgun - Equipped and give it to (Hero manipulating item)) else do (Do nothing)
      • If (weaponType Equal to Sniper Rifle) then do (Hero - Create Sniper Rifle - Equipped and give it to (Hero manipulating item)) else do (Do nothing)
      • If (weaponType Equal to Submachinegun) then do (Hero - Create Submachinegun - Equipped and give it to (Hero manipulating item)) else do (Do nothing)
      • Item - Set charges remaining in (Last created item) to weaponCharges
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated)) Equal to Assault Rifle - Equipped
    • Then - Actions
      • Set weaponCharges = ((Charges remaining in (Item being manipulated)) + 1)
      • Item - Remove (Item being manipulated)
      • Hero - Create Assault Rifle and give it to (Hero manipulating item)
      • Item - Set charges remaining in (Last created item) to weaponCharges
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated)) Equal to Minigun - Equipped
    • Then - Actions
      • Set weaponCharges = ((Charges remaining in (Item being manipulated)) + 1)
      • Item - Remove (Item being manipulated)
      • Hero - Create Minigun and give it to (Hero manipulating item)
      • Item - Set charges remaining in (Last created item) to weaponCharges
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated)) Equal to Shotgun - Equipped
    • Then - Actions
      • Set weaponCharges = ((Charges remaining in (Item being manipulated)) + 1)
      • Item - Remove (Item being manipulated)
      • Hero - Create Shotgun and give it to (Hero manipulating item)
      • Item - Set charges remaining in (Last created item) to weaponCharges
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated)) Equal to Sniper Rifle - Equipped
    • Then - Actions
      • Set weaponCharges = ((Charges remaining in (Item being manipulated)) + 1)
      • Item - Remove (Item being manipulated)
      • Hero - Create Sniper Rifle and give it to (Hero manipulating item)
      • Item - Set charges remaining in (Last created item) to weaponCharges
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated)) Equal to Submachinegun - Equipped
    • Then - Actions
      • Set weaponCharges = ((Charges remaining in (Item being manipulated)) + 1)
      • Item - Remove (Item being manipulated)
      • Hero - Create Submachinegun and give it to (Hero manipulating item)
      • Item - Set charges remaining in (Last created item) to weaponCharges
    • Else - Actions
Here's where I tried to change the range again:

  • If - Conditions
    • weaponType Equal to Assault Rifle
    • Then - Actions
      • Hero - Create Assault Rifle - Equipped and give it to (Hero manipulating item)
      • Unit - Set (Hero manipulating item) acquisition range to 800.00
    • Else - Actions
weaponType is a variable determining what type of item has been used. I didn't add in the change for range to the other weapons yet; Im testing it on the assault rifle.
Each weapon has two items attached to it. The first is the one you pick up (ex/ Assault Rifle) and the second is the Equipped version (ex/ Assault Rifle - Equipped). The Equipped type is undroppable.
The "(Hero manipulating item)" is the marine. The marine is NOT a hero, but has the Abilities "Hero" and "Inventory (Hero)".

Does this help you to help me? lolz
 
Last edited:
Level 10
Joined
Jan 21, 2007
Messages
576
Can you actualy USE those items? If you want it to change when you get the item use the event "Unit aquires an item", btw use trigger tags.
 
Level 2
Joined
Jul 30, 2006
Messages
30
I have my reasons for Uses Item instead of Acquires. And the only thing about my trigger that dosnt work is the changing of the acquisition range. I perfected my trigger b4 trying this part, so yes it does work.
And as for 'trigger tags', I havnt the slightest idea what you are talking about.
 
Status
Not open for further replies.
Top