• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Item Attack?

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2008
Messages
35
I have been playing Afterlife and wanted to make a hero game with pick up and drop weapons that would give you diffrent attacks. Im not sure how it works i searched up and down item abbilitys but couldnt find anything like change attack type, damage, speed, ect. I know there is an upgrade that enables a preset secondary attack, but it doesnt help my problem. Is it something more complacated then just an abbilty? Also Id like to know how they made the ammo for the weapons as well. However i know that one is a trigger I played with it a while but im not sure how it works eather.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
To change the attack type:
1) Copy/paste your hero and give him another attack type.
2) When a weapon is picked up, switch the hero with the copy/pasted hero with the correct attack type.

Upgrades cannot be reversed, there's no such thing in the triggers.


For damage/speed, you can just use the item abilities that are available. They can change the attack speed/damage of the hero.


Ammo can be done in a few ways:
1) Item stacks: Items can be stacked, so if you make the weapons stackable, then you could subtract 1 stack per shot fired and add stacks when ammo is picked up.

2) You could use lumber/gold/food for ammo. Whenever a unit fires, give the shooting player -1 of that resource. When ammo is picked up, give him some.
 
Level 9
Joined
Aug 7, 2009
Messages
380
If you do like above, you may not able to acquire 2 or more weapons in ur inventory, or it'll cause error, the best way i think is using an dummy spell (could base on some spell is instant cast like Thunder Clap,...) and when you use item or cast the spell, replace the triggering hero with the hero of the weapon type you wanted (like M4A1 change to AK 47 need 2 different hero :D)
About ammo, i'm not very sure but it use a stack-able items like ap0calypse said but when using "Unit - A unit is attacked" could give you some -ammo when the bullets didn't come out from your unit but it's the best way now except blizzard fix it (i think it is an bad thing :|)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Well, it won't give an error when carrying two weapons (my system), it will just only give 1 attack type (e.g.: you pick up a shotgun and get "Chaos" damage, then you pick up an assault gun and would get "Piercing damage").
Edit: wait, it CAN give an error if you don't create the trigger correctly: the trigger should be turned off when switching heroes (the reason being that if you switch heroes, you need to give all items to the switched hero. When doing this, the trigger activates itself again and you're in an infinite loop --> crash. Just using "Trigger - Turn off (This trigger)" solves it though).
But since when can someone wield a shotgun and an assault rifle at the same time? :p

You're completely correct about the ammo-bug though... (to elaborate: when your hero is attacking someone and you order him to do something else right before he could attack, the order will still be given - thus he will lose ammo - yet he will never really shoot).
Could be solved with damage detection, but that makes things unnecessarily complicated.
 
Status
Not open for further replies.
Top