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

a little idea about weapon choice and hero replacement

Status
Not open for further replies.
Level 19
Joined
Apr 21, 2013
Messages
1,194
Hey guys, i'm working on a map where the player chooses a weapon to fight with. The choices include axe, sword, spear, mage staff and bow.

It's not a big problem to manage the melee weapons on units. But when the unit gets a ranged weapon, the problems start for me.

The starting hero is a melee unit, which makes it problematic to get ranged weapons. I used replacing the hero with another one with same appearance but with ranged attack it works well.

My question is, is there a way for me to just change the range of the first unit without replacing it?
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
You can change it by giving it an ability or upgrade that gives additional or bonus attack range such as the Rifle upgrade of the Rifleman but indeed, it is much better if you are to replace the unit.

For the upgrade, when you acquire a range weapon, give the unit an upgrade of the Rifleman then make another ability of the Rifleman but with negative values to decrease it then. You will use this ability if you are to change on melee weapon again.

But as I've said, replacing units are a much better alternative than this if you are to ask me.
 
Level 9
Joined
Apr 4, 2013
Messages
373
There is also the option of making the unit's range longer than the acquisition range. Then, you can increase the range with triggers.

Example: The unit is melee with a 125 acquisition range and a maximum 300attack range. The trigger to get his range increased after picking up an item would be:
  • Change Range
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Your Item
    • Actions
      • Unit - Set (Triggering unit) acquisition range to 300.00
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
it didnt work :S

  • Unit - A unit Starts the effect of an ability
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Ability being cast) Equal to Wear Weapon Gearr
      • (Item-type of (Item carried by (Triggering unit) of type Bow Gear)) Equal to Bow Gear
    • Then - Actions
      • Unit - Remove (Ability being cast) from (Triggering unit)
      • Hero - Drop (Item carried by (Triggering unit) of type Bow Gear) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • Hero - Create Wooden Bow and give it to (Triggering unit)
      • Unit - Set (Triggering unit) acquisition range to 600.00
      • Unit - Order (Triggering unit) to research Long Rifles Bow(+1)
      • Unit - Order (Triggering unit) to Level Up
      • Unit - Order (Triggering unit) to research Long Rifles Bow(+1)
      • Set ambushReportInt = (ambushReportInt + 1)
    • Else - Actions
Neither the upgrade nor the acqusition change via triggers is working :S
 
Level 9
Joined
Apr 4, 2013
Messages
373
For this Part:
  • Unit - Set (Triggering unit) acquisition range to 600.00
Did you make the range of your unit equal or greater than 600?

Not sure what this part is for:
  • Unit - Order (Triggering unit) to research Long Rifles Bow(+1)
  • Unit - Order (Triggering unit) to Level Up
  • Unit - Order (Triggering unit) to research Long Rifles Bow(+1)
  • Set ambushReportInt = (ambushReportInt + 1)
Could you explain why you need to research upgrades and make the hero level up? You could instead add an item ability to the unit (ex. Item Attack +3) to simulate added damage after equipping it.
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
i tried to do with these numbers also:

unit has 600 range, i changed the acqusition to 605 still didnt work

and oh dont mind the other ones :D

level up was just for testing if the conditions were working.

the longrifle bow upgrade is the sniper's range increment upgrade still didnt work :(

ambushReportInt is an integer for another trigger doesnt concern us with the range issue.
 
Level 10
Joined
Aug 30, 2007
Messages
270
correct me if I'm wrong but doesn't every unit have 2 attacks in the editor (in most cases one is deactivated). Couldn't you just make a trigges (researches needed here i think) which deactivates the meele one (e.g. attack 1) and activetes the ranged one (attack 2) changing range for a already ranged attack sould not be as problematic as making a melee attack ranged.
I'm sorry if this is what you already tried, i only looked at the triggers you posted fast and the last time a really was into triggering was long ago...
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
Just a little reminder. Upgrades cannot be unlearned. So if you're going to allow players to change weapon ingame, it might be more advisable to just replace the unit.

replacing seems less problematic here bcz i couldnt find a way to change the range :S

correct me if I'm wrong but doesn't every unit have 2 attacks in the editor (in most cases one is deactivated). Couldn't you just make a trigges (researches needed here i think) which deactivates the meele one (e.g. attack 1) and activetes the ranged one (attack 2) changing range for a already ranged attack sould not be as problematic as making a melee attack ranged.
I'm sorry if this is what you already tried, i only looked at the triggers you posted fast and the last time a really was into triggering was long ago...

and yeah thats what im looking for. Only if i could disable attack 1 and enable 2 somehow :S i tried using orb of fire but it still attacked with attack1.

Any more ideas ?
 
Level 10
Joined
Aug 30, 2007
Messages
270
you can make researches activate attack 1 or attack 2 or both, now the only thing is the unlearning of researches....
 
Level 10
Joined
Aug 30, 2007
Messages
270
ok, unless you want to make it possible to change weapons in mid fight, you could also use a permanent and hidden transformation spell (e.g. metamorphosis) which is disable on startup but is enabled and used with trigges (via orders) and then disabled again. The two forms would be meele and ranged (like DH) and then you could change the range once the unit is ranged
 
Status
Not open for further replies.
Top