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

How to make items attack?

Status
Not open for further replies.
Level 4
Joined
Feb 7, 2007
Messages
61
If anyone have played BattleShips/BattleTanks/NavalCombat, i was wondering if someone could tell me how the items can attack like that automatically.Can someone help me?
 
Level 5
Joined
Jan 27, 2007
Messages
154
That's pretty simple, they used the skill phoenix fire.

Create a modified phoenix fire and add it to the skill of your item, change the missle art and it's done.
 
Level 4
Joined
Feb 7, 2007
Messages
61
well anyways...just like in battletanks and so...how do i put it where they can change vehicles and it auto sells there current vehicle and then gives them the one they bought and it spawns where they bought it from?
 
Last edited:
Level 5
Joined
Jan 27, 2007
Messages
154
This one involves trigger.

  • Events :
  • A unit acquires an item
  • Conditions :
  • (Item-class of (Item being manipulated)) equal to ******
  • Actions :
  • Unit - Replace (Hero manipulating item) with a ****** using the ol'd unit's relative life and mana.
 
Level 4
Joined
Feb 7, 2007
Messages
61
what kind of item should it be? and will it be removed when the hero does get the item? will the items that the hero have still be there when it changes vehicles? because i dont understand this trigger
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
Im not one to useally discourage people from learning, but maybe you are strecthing bit too far in here Lafeet. It's a pretty simple trigger, and your questions are basic. Maybe you should first explore the editor on your own, try to create something and get a better feeling how triggers work before attemting something like this.

Thewandmirro: lol :)
 
Level 27
Joined
Sep 24, 2006
Messages
4,981
Im not one to useally discourage people from learning, but maybe you are strecthing bit too far in here Lafeet. It's a pretty simple trigger, and your questions are basic. Maybe you should first explore the editor on your own, try to create something and get a better feeling how triggers work before attemting something like this.

Thewandmirro: lol :)

Yeah ok lol .. very stupid question >.< .. but anyway i've never heard of 'Phoenix fire' ..
 
Level 4
Joined
Feb 7, 2007
Messages
61
Im not one to useally discourage people from learning, but maybe you are strecthing bit too far in here Lafeet. It's a pretty simple trigger, and your questions are basic. Maybe you should first explore the editor on your own, try to create something and get a better feeling how triggers work before attemting something like this.

Perhaps if u would just tell me i would learn right?
 
Level 6
Joined
Oct 23, 2006
Messages
223
Replacing units in editor, you would have to first check if the item he got is the correct one, like TankX then replace his older unit with a new one by using "Unit - Replace (Hero manipulating item) with a TankX using the old unit's relative life and mana."

The items will be removed because you switched units, the type of item that triggers the switching of vehicles can be any kind of item.
 
Level 5
Joined
Jan 27, 2007
Messages
154
Phoenix fire? i've never heard of that .. the phoenix uses the skill? for what?

Yes it does use that skill. It's functions are auto attacking.

Just change the missle art of phoenix and u'll notice the difference between phoenx fire and normal attack.
 
Level 4
Joined
Feb 7, 2007
Messages
61
I want it where when a human player purchases a hero, it removes the current hero that the player has then replace it with the hero the the player has just purchased having the same item and the new hero that the player purchased will spawn in front of the shop of where they bought it from.
 
Level 7
Joined
Dec 30, 2006
Messages
252
Phoenix Fire is the skill where the unit shoots fire automatically (Does not appear in inventory / spell inventory, looks like a red ribbon / laser.)
 
Transferring items between units.

If you want to transfer the items between a hero to its replacement, you'll have to set all of the items to variables via triggering (use an array). Then you'll have to drop them from the hero, replace the hero, and give them back.

If you want to see exactly how the entirety of the trigger would be done, I will create a template map for you.
 
No, you dont have to do that. Do this:
  • Events
    • Unit - A aquires an item
  • Conditions
    • (Item being manipulated) equal to Hero Morph Item
  • Actions
    • Unit - Replace (Triggering unit) with a Morphed Hero using The old unit's relative life and mana
    • Selection - Select (Last replaced unit) for (Owner of (Triggering unit))
    • Hero - Give (Item carried by (Triggering unit) in slot 1) to (Last replaced unit)
    • Hero - Give (Item carried by (Triggering unit) in slot 2) to (Last replaced unit)
    • Hero - Give (Item carried by (Triggering unit) in slot 3) to (Last replaced unit)
    • Hero - Give (Item carried by (Triggering unit) in slot 4) to (Last replaced unit)
    • Hero - Give (Item carried by (Triggering unit) in slot 5) to (Last replaced unit)
    • Hero - Give (Item carried by (Triggering unit) in slot 6) to (Last replaced unit)
 
Or if that doesnt work. You can use Replace - when replacing heros with heros it transfers the inventory. Or do:

Unit: Set collision size for triggering unit off (or turn collision off or something like that)
Unit: create one Hero(morph) at position of triggering unit
Wait 0.1 seconds

then do the thing with the inventory, and then remove it.
 
Level 4
Joined
Feb 7, 2007
Messages
61
O wait nvm, when i try to do this it crashes the wc3 , i did change up the triggers a little, but can u tell whats wrong?

  • Buying Hero3
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Type-4G2 BattleSuit
    • Actions
      • Unit - Replace (Triggering unit) with a Type-4G2 BattleSuit using The old unit's relative life and mana
      • Selection - Select (Last replaced unit) for (Owner of (Triggering unit))
      • Hero - Give (Item carried by (Triggering unit) in slot 1) to (Last replaced unit)
      • Hero - Give (Item carried by (Triggering unit) in slot 2) to (Last replaced unit)
      • Hero - Give (Item carried by (Triggering unit) in slot 3) to (Last replaced unit)
      • Hero - Give (Item carried by (Triggering unit) in slot 4) to (Last replaced unit)
      • Hero - Give (Item carried by (Triggering unit) in slot 5) to (Last replaced unit)
      • Hero - Give (Item carried by (Triggering unit) in slot 6) to (Last replaced unit)
 
Setting to a Variable...

Its like I said before.
The triggering unit has been removed/replaced, and when thats done, its no longer usable as a variable. Plus, the items the triggering unit was holding no longer exist.

You should create a temporary variable like "TempItem" with an array of at least 6, and try this:
  • Buying Hero 3
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Type-4G2 BattleSuit
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set TempItem[(Integer A)] = (Item carried by (Triggering unit) in slot (Integer A))
          • Hero - Drop TempItem[(Integer A)] from (Triggering unit)
        • Loop - End
      • Unit - Replace (Triggering unit) with a Type-4G2 BattleSuit using The old unit's relative life and mana
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give TempItem[(Integer A)] to (Last replaced unit)
          • Unit - Order (Last replaced unit) to move TempItem[(Integer A)] to inventory slot (Integer A)
        • Loop - End
Its really not that much harder and it provides more grounds for other functions.
 
Level 5
Joined
Apr 6, 2006
Messages
98
well as a member of 13sG(battleship gods) and a mapmaker myself i can try and help, there are 2 ways for items to attack auto, one which is pheonix fire and another is to use dummy units should u want the items to slow,deal splash or stun or w/e.

-Pheonix fire is self explanatory from previous posts

-For dummy lets say u want a slowing poison weap with a 3 sec cd
1)look up the "factory" spell(not pocket factory),its a passive spell that spawns a unit/dummy every few secs(time is changeable)
2)create ur dummy with magic attack if u want inital damage and set the range to w/e ur weaps range is
3)give the dummy a poison skill(slow poison,envenomed weaps etc) and set the damage and slow to ur choice
4)set the aquisition range to the weap range and set the ms to 10(as long its slow cuz u dont want the dummy to run somewhere)
5)give locust to dummy
6)set units spawned by factory=dummy
7)set the cd of factory to 3 secs
8)give the item factory skill
There voila u have a slowing weap(note that this will not attack random targets and i have still been trying to make it do that with GUI)

I will post the triggering that transfers the item from one hero to another tmr bcuz atm im very busy...
 
Level 3
Joined
Jan 1, 2006
Messages
15
As I found out ages ago... you can do a buff compare (periodic event), the only problem is that the unit group leaks (ie Pick Every Unit ==> picked unit has buff then do stuff). Now if you wanna assign that group to a local variable, then you could probably get away with doing it, just as long as you destroy that group. GL HF and may the best triggered weapon win.
 
Status
Not open for further replies.
Top