• 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.

item used as a weapon

Status
Not open for further replies.
Level 5
Joined
Feb 16, 2005
Messages
103
I was mapping and trying to make a weapon item. It could be picked up by a unit without an attack, and when picked up, the weapon would grant this unit a particular attack. I couldn't figure it out, so I was wondering how I would go about doing this?
 
Level 4
Joined
Apr 5, 2008
Messages
70
I thought in the trigger editor is anywere a function that turns an attack on or off.
So you have to give your unit before a attack and turn both off. Later ingame you can turn tham on or off.
 
Level 5
Joined
Feb 16, 2005
Messages
103
Well it was my hope that I could make many different weapons that many different weapon-less units could pick up and then gain a specific attack based on that weapon item. So, just to be sure, from what you guys are mostly saying the best way is that I should go with the dummy item route and just make multiple versions of the unit with and without the weapon?
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
Well it was my hope that I could make many different weapons that many different weapon-less units could pick up and then gain a specific attack based on that weapon item. So, just to be sure, from what you guys are mostly saying the best way is that I should go with the dummy item route and just make multiple versions of the unit with and without the weapon?

If you want multiple ranges I would say yes.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
not sure but this should work
configure attack 1 of your unit
and from attacks enabled disable all
give your item orb of fire ability and make orb of fire ability enable attack 1 instead of 2
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
not sure but this should work
configure attack 1 of your unit
and from attacks enabled disable all
give your item orb of fire ability and make orb of fire ability enable attack 1 instead of 2

We already suggested that, but he wants multiple ranges.
W8 I'll give the trigger you want.

  • Item Change
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Orb of Frost
    • Actions
      • Unit - Replace (Triggering unit) with a Footman using The old unit's relative life and mana
Anything like that will do. Just modify it, add conditions and variable to make it the way you want it.
But that trigger is basically what you are looking for.
 
Level 9
Joined
Jul 3, 2008
Messages
495
We already suggested that, but he wants multiple ranges.
W8 I'll give the trigger you want.

  • Item Change
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Orb of Frost
    • Actions
      • Unit - Replace (Triggering unit) with a Footman using The old unit's relative life and mana
Anything like that will do. Just modify it, add conditions and variable to make it the way you want it.
But that trigger is basically what you are looking for.

No that is not a good way doing it... Use the orc ability called chaos, to morph the unit into another... much better
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
No that is not a good way doing it... Use the orc ability called chaos, to morph the unit into another... much better

Object Editor way, Trigger way.
It hardly matters dude.
This way is easier. I don't like making to much of those orc abilities blabla. xD

And I don't think that ability works for heroes.
Ex. If you want to keep same xp etc, in triggers you can store it into a variable.
 
Level 5
Joined
Feb 16, 2005
Messages
103
Well I used that exact same that Airandius posted (with another condition for it being a particular unit) before and it crashed. Now I used it exactly as he posted it, and it still crashed. I thought it might've had something to do with the custom model of a weaponless marine that I was using, but even without using that model it still crashes. I don't get what's wrong lol

As for using the chaos ability as suggested by MeKC, I thought about that, but I also want to make it possible to drop this weapon item and pickup a different one to get a different attack, and I'm not sure how that would work with that ability...
 
Level 5
Joined
Feb 16, 2005
Messages
103
Maybe I should further describe what my intentions are. What I am envisioning is having about 8-10 different weapon items, and my soldiers are without an attack. When my soldier picks up a particular weapon item, the soldier will then be granted that particular weapon's attack damage, range, effects, etc. But, each weapon is different. A weapon can be dropped to make the soldier weaponless again (until of course he picks up a new weapon item).

I would also like to make it possible eventually to make it so that multiple weapons can be stored in inventory, but only the weapon item in slot 1 can be used for attacks, the other(s) would just be stored.

Another thing I'd like to eventually do would be to develop a different ammo system for each weapon.

I wasn't going to start messing around with these last 2 things until I could get the basic weapon items to work first. Hopefully, that clears up what I mean...

Addressing MeKC, will the chaos idea work if I set it up like I have said above; that is, will i be able to start out weaponless, pick up my weapon item and chaos into a unit with an attack, then drop the item and chaos back into a weaponless soldier?

EDIT:
I think I'm getting close...I've gotten the chaos ability to work for me when I pickup my weapon, but I can't make it chaos back to the weaponless soldier when I drop the item. What happens is when I drop the weapon item, the unit doesn't chaos back to its weaponless form, it just remains with its attack. I tried this using 2 different custom chaos abilities/upgrades, and obviously the 2nd didn't work.

Then I tried to make 1 custom chaos ability with multiple levels, but that didn't work at all. Any suggestions? Would it help if I posted my map that I'm playing around with this on?

Another problem I'm having is that I want to have multiple soldiers and the problem is when 1 soldier picks up a particular weapon, then another weaponless soldier who doesn't even have a weapon item is also granted the attack, which isn't how I wanted it to work at all...
 
Last edited by a moderator:
Level 7
Joined
Jul 20, 2008
Messages
377
Object Editor way, Trigger way.
It hardly matters dude.
This way is easier. I don't like making to much of those orc abilities blabla. xD

And I don't think that ability works for heroes.
Ex. If you want to keep same xp etc, in triggers you can store it into a variable.

It's not just easier. It's also less convenient for the players. What about hotkeys? If you replace the unit, you lose the hotkey. That's just no fun.

Chaos would fix that.
 
Level 5
Joined
Feb 16, 2005
Messages
103
Well I've continued playing with it and I got the original trigger proposed by Airandius to work without crashing, however, there's a new problem now. The problem now is that whenever I replace my weaponless hero soldier with an armed hero soldier, he keeps the level and experience of the old soldier, but the name changes! Any ideas here? I'm so close to getting this working perfectly how I want it! Thanks in advance guys
 
Level 5
Joined
Feb 16, 2005
Messages
103
I hope so too lol. Does anybody know how to do this so I can retain the names? If it's not possible I guess I'll have to adjust and scale things back and make all my soldiers regular units instead of heroes :(
 
Last edited:
Level 36
Joined
Feb 5, 2009
Messages
4,630
Um... why don't you have a look at what Orb effects do. Basically, they allow a hero to switch to an attack type (1 or 2). So, why don't you simply make it that the hero has both attacks disabled, and then the weapon enables atk 1 or 2 depending on whether the weapon allows for ranged or melee attacks? It just makes sense to me to do that, rather than all that trigger crap. Sounds like there's a lot of ppl who try and help but don't really know what to do :p
 
Level 5
Joined
Feb 16, 2005
Messages
103
Well that would be the best way to do it Wazzz, but what I'm actually looking for would employ more than just 2 different weapons. I have more like 10-12 weapons in mind, and since, there's only 2 attack types per unit, then the other 8-10 weapons would be out of luck. That's the only reason why I'm using triggers instead of orb effects, and believe me it's a bummer.

I've gotten everything to work thus far, I just still have the problem of the proper name of my hero changing every time he picks up/drops a new weapon :( It's looking like I'm going to have to alter my tactics and make my soldiers regular units instead of heroes now--because my main reason for making them heroes in the first place was for them to have names, and if the names change all the time, what's the point lol? If anybody knows how to combat this issue, I'm still quite interested in hearing your ideas...
 
Level 36
Joined
Feb 5, 2009
Messages
4,630
Well, all you really have to do is sort out what weapons are ranged and what are melee. Attack 1 could be for the melee weapons, and attack 2 for the ranged. Then, to alter the attack damage of units, you can just add the bonus as necessary until you have the effect you desire.

As for the proper name of the hero changing every time, it sounds like your trigger is creating a new hero each time. Sounds somewhat confusing, but I cannot think of any suggestions as of yet...

Alternatively, and this idea is WAY out there, you could possibly give the weapons a Bear Form style ability (carrying multiple weapons would cause the ability to bug out, but you could prevent this by putting the ability [naming it 'Equip' or something] or just making it you cannot carry more than 1 weapon at any given time) that creates the illusion of equipping the weapon. However, the problem with the proper name would still occur, so this idea probably wouldn't help you to move forward... :(
 
Level 5
Joined
Feb 16, 2005
Messages
103
Alright, then my new question is, if I were to go with orb method of doing this, and give my soldiers a melee and ranged attacks with my weapon items enabling one or the other, would I be able to grant different attack types, attack damages, different ranges, and give some splash damage and others not, based on which of the 10 of so weapons that soldier picks up?
 
Level 8
Joined
Nov 9, 2008
Messages
502
Then name changing is very weird. I'm actualy trying to implement a similar system to my map and from reading this thread I'm choosing the chaos option as it lets changed unit keep all stats and exp.

Instead of adding chaos ability when items is used, I'm using an ability to target an item to equip but the principle is still there and there's no name changing going on.

When I've tested it my heroes name does not change. Maybe check that the original unit and the unit your changing into have the same choices of names EXACTLY. I'm not sure but maybe a slight difference could cause warcraft to reselect a name for your hero when he changes.

I've added my simple test map for equipping a sword to an unarmed hero. There are also tomes so you can test that he keeps his exp and his NAME.

EDIT:
A little more testing names and I can see that name selection isn't random. Creating 1 hero of a type gives the same name every time. Only if there are more units of the same type will another name be used so MAYBE if your hero is changing name there is another unit on map with the same name? If so, make more choices of names.
EDIT:
Another test of names: even if I create 6 heroes of same type and they have only 5 names to choose from, the sixth will be unique. Say, selection of sames is 'fred,george,jim,terry,bob' the sixth will be created as 'bob II'. Still, this doesn't effect name changing when I use chaos ability.
 

Attachments

  • equiping a weapon.w3x
    14.3 KB · Views: 29
Status
Not open for further replies.
Top