I have asked this before tho,but the ammo was gold
maybe this help:
Tested and it works
- attack
- Events
- Unit - A unit Is attacked
- Conditions
- Actions
- Player - Add -1 to (Owner of (Attacking unit)) Current lumber
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Owner of (Attacking unit)) Current lumber) Equal to 0
- Then - Actions
- Unit - Order (Attacking unit) to Stop
- Else - Actions
You point it at your targer
You press the trigger
Gun expends ammo
Projectile flies
Projectile hits
Target is damaged
You have a gun
You point it at your targer == Unit - A unit Is attacked >> Trigger runs
Gun expends ammo
You press the trigger
Projectile flies
Projectile hits
Target is damaged
You have a gun
You point gun
You lower gun
You have a gun
You point gun >> Trigger runs
Gun expends ammo
You lower gun
You have to ask yourself: Are my units that have this lumber ammo able to fire a second arrow before the first one hits it's target?
Or are the "arrows" actually bullets from a gun and fire with such high velocity that the gunner has no chance to ever fire 2 bullets?
hmm... it looks like you didnt understood it correctly.
Lets explain again:
When I want to attack you, I have to string up my bow (is that correct english?)
Then I start drawing my arrow to the bow, I am attacking you.
Then I loose my arrow, the lumber is removed from your resources.
Then the arrow hits you, I am damaging you.
What you do is slightly different.
When I want to attack you, I have to string up my bow (is that correct english?)
Then I start drawing my arrow to the bow, I am attacking you, the lumber is removed from your resources.
Then I loose my arrow.
Then the arrow hits you, I am damaging you.
What if I start drawing my bow and then put it back? In that case the lumber is lost but I still have my arrow in my hand.
That is why your method doesn't work.
We call that "Abuse of stop order" even though every interrupt and other order has the same effect.
When you use a DDS, you can remove the lumber when the arrow hits it's target.
When I want to attack you, I have to string up my bow (is that correct english?)
Then I start drawing my arrow to the bow, I am attacking you.
Then I loose my arrow.
Then the arrow hits you, I am damaging you, the lumber is removed from your resources.
That is also not what you want and has a similar bug:
I have 1 arrow (lumber).
I draw my bow.
I loose the arrow.
I draw a new arrow.
The first arrow hits its target and I lose an arrow (lumber)... uhm... but I am now actually aiming my next arrow even though I haven´t got an arrow with me.
If it is possible that I can start shooting the next arrow before the first one hit it´s target, then you require to remove ranged attacks and invoke their projectiles with a missile system instead.
This will require you to edit all ranged units data fields and save their (ranged) attack type.
It will be a lot of work but is the only actual way to do it.
Then at least use the second method.
The one with the DDS.
That one has not got the stop abuse but has the ghost ammo.
A DDS is not very hard to implement and will work very good in this situation.
I recommend this one by looking_for_help as I know that it can split basic attacks and spell damage apart.
All you have to do is change the event in your trigger.
Hmm.. Yea i think i see the problem. Thx for pointing that outOk imagine the folowing situation:
You have a gun
Code:You point it at your targer You press the trigger Gun expends ammo Projectile flies Projectile hits Target is damaged
This is what we want right ?
The above trigger with this event
Does NOT work like this.
- Unit - A unit Is attacked
The above trigger works like this:
Code:You have a gun You point it at your targer == Unit - A unit Is attacked >> Trigger runs Gun expends ammo You press the trigger Projectile flies Projectile hits Target is damaged
So if I do
Code:You have a gun You point gun You lower gun
You will actualy get
Code:You have a gun You point gun >> Trigger runs Gun expends ammo You lower gun
Did you shoot ? No. Did the gun expend ammo ? Yes. Do you see the problem now ?
If you implement a DDS you can detect when damage is dealt. If damage was dealt that means that all of the previous "events" have occured but if a gun is pointed it does not mean that it was fired !
Edit// Sorry for weird fonts/styling.