HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Items as ammo

02-13-2004, 09:17 PM#1
Starsunder
i have been trying to get a feature for a map i am making to work. What im trying to do is create items that serve as weapons, i have three linked to abilities, icon selected, mana cost set to zero and everything else that i needed to do. HOWEVER: since these are ranged weapons to be used by marines, i wish for them to have limited ammo. I tried doing this by setting each ite as a charged item and set the charges to the ammo count i wanted, but cant get it set so that the charge goes down by one with each attack.

:bangH: Here is how i have say the assault rifle set up: i used the orb of frost as the base item, attached my assault rifle ability to it, with damage, range cooldown, etc. etc. and set its charges to the 100 count represting 100 rounds in that weapon. But when i tested it, it either wouldn't activate an attack or the item (i solved that small bit), it wouldn't "fire" the ammo when the unit attacked. or he wouldn't attack and youn would have to use the item actively, which with the way the map is planned will cause broken fingers. :bangH: any help would be appreciated and helpers will be acknowleged in the credits if they so wish.
02-13-2004, 09:22 PM#2
BBDino
A work around could be to give the item a spell abilty which has no spell art and use triggers to get it to use the abilty on the attacked unit every time a unit is attacked.
02-14-2004, 02:16 AM#3
Starsunder
I coulnd't get the triggers to work... i set it so that it when a target came within range, it would use the item on the target and drain the charges, but couldn't get either function to work
02-14-2004, 03:26 AM#4
SirSalute
is it possible to do this(following)

Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has an item of type Ammo) Equal to True
Actions
Hero - Order (Attacking unit) to use (Item carried by (Attacking unit) of type Ammo)


give cooldowns of the item = to the attack cooldown of the unit
make it perishable = true
make unit attack demage 0, dice 1, side 1
give the attack bonus to 'ammo item'
dropped when carrier dies = true(allowing ammo to be collected, =P)

this way, the unit will attack and use the item, reducing the charge, while dealing demage only if he has ammo.

maybe you add a new trigger to order it to stop whenever it start to attack without having any ammo.

you may also want to make the ammo stackable, you can get the script from (Aiursrage2k)a great guy, he's script should be at the respository

GOOD LUCK, look forward to the release of your map. +D
02-14-2004, 07:42 PM#5
Starsunder
I've been working on this since 3:00 Am and still haven't gotten it right.

Estoy muy enfadado! :cuss:

I still cant get the item to activate on its own, althuogh it did once but not twice in the same game... which confused me.would i have to set it to a looping trigger maybe???


Pertinent Info on trigger and weapon:


Trigger: Assault Rifle Counter
Events
[
Unit- USMC Marine 0001 <gen> Is isued an order targeting an object.
]
Conditions
[
Boolean- USMC Marine 0001 <gen> has an item of type assault rifle equal to true
]
Actions
[
Hero - Order USMC Marine 0001 <gen> to use (Item carried by USMC Marine 0001 <gen> of

type Assault Rifle
]

Assault Rifle:
Actively Used: false
Dropped when Carrier Dies: True
Charges: 100
Perishable: True
02-14-2004, 08:39 PM#6
BattleBotv8.2
Could you make it so once the unit attacks it reduces an interger by one and set the item charges as XInterger? I have not tried it but its a thought.
02-15-2004, 11:07 AM#7
SirSalute
the integer will need jass, or you can use custom value for the item.
I'm not certain how it will work though.

for you trigger i think once the event occurs, it won't be checking until the unit it refers to finish all the action at the trigger.
Or the unit is actually ordered once, and it will continues to attack as not new order is given, so the trigger only activates once.

You can try put a 0.00 sec wait at the beginning of the action. see if that works or not.Or add two more commands, order it to stop, then order it to attack, it might make the trigger activate again, causing it to use the item.

Or else, try using Units under attacked event as i stated earlier, it isn't that much to do either since you had already made that item.

If all can't works, I'm sorry that i can help anymore, I'm equally stumped, maybe Other better triggerers than I can help.

Good luck.
02-15-2004, 06:51 PM#8
Shiik
This can only work if you don't need to worry about one of these: food, wood, or gold. This is the simplest way to do it. Make sure you change the icon of whatever it is you want to use into a bullet or something. (In this example I'm using lumber)
(Ammo1 is an item variable)
First, make this variable:
Events:Unit - Marine Acuires an Item
Conditions: (Item-type of (item being manipulated)) equal to Ammo
Actions: Set Ammo1 = (Item being manipulated)
Player- Add # to player 1 current lumber

Events: A unit is attacked
Conditions: Attacking Unit Equal to Marine
Actions: Player - Add -1 to Player 1(Red) Current Lumber

And then when yer out of wood:
Event: Player - Player 1(Red)'s current lumber becomes equal to 0.
Action: Item - Remove ammo1

And make sure the unit has an attack of 0 and the item gives him an attack.
And if you use food, make sure to add 1 food whenever one of that player's units dies. And make a trigger decreasing the lumber if he drops the ammo. Now if you need gold and lumber and food, or if you're using more than 1 unit per player, that wont work. You could do it with a leaderboard too, but i've never been able to get a leaderboard running. And if it's multiplayer yer gonna have a lot of copying and pasting to do.
Ok, so, that should work. :D
02-15-2004, 08:26 PM#9
BattleBotv8.2
I got a way w/o needing wood, gold, food ^_^

Look down for update.
02-16-2004, 02:09 AM#10
Starsunder
yhow would i export the trigs. i am very knew to the W3E
02-16-2004, 08:57 AM#11
Lu Baihu
Happy sobs :D :ggani: *bows down and reveres BattleBotv8.2*

I needed this for my own map!

(The idea being that the Marine would have either a "cooldown" reloading period between infinite magazines, or they'd be regulated by items; another unit would have the ability to [can he produce Items? and] drop Ammo Clips onto the battlefield for others to use ...)
02-16-2004, 02:41 PM#12
BattleBotv8.2
Bow down before me mortals! Nah, I just am good at intergers (I love them, as much as my night elves).

Anywho, I fixed a bug, but I cannot remember which (Because of Lyme Disiese and 2 other infections in my body...).

Here it is, I uploaded the wrong file. And to export/import triggers go into the trigger section and go into the file part, there are Export and Import. Its creates a file, so name it what ever you want, go into your map and do import (Note: It will replaces ALL of your current triggers, so if your far into a map you will need to manualy do it).
02-16-2004, 02:41 PM#13
BattleBotv8.2
Here it is, I uploaded the wrong file. And to export/import triggers go into the trigger section and go into the file part, there are Export and Import. Its creates a file, so name it what ever you want, go into your map and do import (Note: It will replaces ALL of your current triggers, so if your far into a map you will need to manualy do it).
02-17-2004, 03:17 AM#14
Starsunder
I got the trigger adjusted so that it stops at zero ammo, and adapted it to my map, but cant seem to get the item ability to trigger and cant think of a way, beyond perhaps variables which i would need a tutorial on( ne suggest) and was wondering if ne 1 could point me in the right direction.
02-17-2004, 03:21 AM#15
BattleBotv8.2
Yeah, I know how to stop it, I ALWAYS forget a SINGLE thing...

Also, you cannot get the item to deal damage? Just add Item Damage Bonus to the Rifle's item ability. I did +20 and +15