I have no idea why this isn't working!!
If someone could help me with this that would be great!!
I'd like to have this trigger all in one, so I don't have to copy this 8 times for each players reload.
Oh, the 2 variables AttackTrue and AttackInProgress just remove the attack ability for the unit reloading on a separate trigger.
Events
Unit - Any Unit is attacked
Local Variables
Conditions
Actions
Player Group - Pick each player in (All players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
MagazineAmmo[(Picked player)] > 0
AttackTrue[(Picked player)] == false
Then
Variable - Set MagazineAmmo[(Picked player)] = (MagazineAmmo[(Picked player)] - 1)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
ClipsAmmo[(Picked player)] > 0
Then
Variable - Set AttackInProgress[(Picked player)] = true
UI - Display "Reloading..." for (Player group((Picked player))) to Subtitle area
Unit - Disable the Attack ability for AmmoUnit[(Picked player)]
Well, first of all "this isn't working!!" isn't exactly the problem description we'd wish for. You will get replays faster and more often if you actually hell us what exactly isn't working right..
EventsUnit-AnyUnitisattackedLocalVariable:Integerlv_player=GetOwnerof(triggeringunit)ActionsIfMagazineAmmo[lv_player]>0andAttackTrue[lv_player]==falseThenVariable-SetMagazineAmmo[lv_player]=(MagazineAmmo[lv_player]-1)ElseIfClipsAmmo[(Pickedplayer)]>0ThenVariable-SetAttackInProgress[lv_player]=trueUI-Display"Reloading..."for(Player(lv_player))toSubtitleareaUnit-DisabletheAttackabilityforAmmoUnit[lv_player]General-Wait2.0GameTimesecondsVariable-ModifyMagazineAmmo[lv_player]:+100Variable-ModifyClipsAmmo[lv_player]:-1Unit-EnabletheAttackabilityforAmmoUnit[lv_player]UI-Display"Reloaded!!"for(Player(lv_player))toSubtitleareaElseVariable-SetAttackTrue[lv_player]=trueVariable-SetAttackInProgress[lv_player]=falseUI-Display"OUT OF AMMO!!!"for(Player(lv_player))toSubtitlearea
I thought that would work, but it didn't. ...And sorry, I don't know why I didn't explain, anyway...
The problem is I'm trying to make this all work in 1 trigger instead of trying to make 7 copies.
But the problem is I can't get the picked player to work, since all the integers are in arrays of 15.
So I'm trying to make array 1 = player 1
Okay, it works for 2 players, but there is one problem left!
When the unit starts reloading, it waits 2 seconds before it gives the unit it's attack back.
But... the problem is if players 2 unit starts reloading first then .4 seconds later players 1 unit reloads the attack doesn't enable again, how do I make this multi instanceable in 1 trigger?
I have no idea why this isn't working!! If someone could help me with this that would be great!! I'd like to have this trigger all in one, so I don't have to copy this 8 times for each players reload.
Oh, the 2 variables AttackTrue and AttackInProgress just remove the attack ability for the unit reloading on a separate trigger.
Events
Unit - Any Unit is attacked
Local Variables
Conditions
Actions
Player Group - Pick each player in (All players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
MagazineAmmo[(Picked player)] > 0
AttackTrue[(Picked player)] == false
Then
Variable - Set MagazineAmmo[(Picked player)] = (MagazineAmmo[(Picked player)] - 1)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
ClipsAmmo[(Picked player)] > 0
Then
Variable - Set AttackInProgress[(Picked player)] = true
UI - Display "Reloading..." for (Player group((Picked player))) to Subtitle area
Unit - Disable the Attack ability for AmmoUnit[(Picked player)]
General - Wait 2.0 Game Time seconds
Variable - Modify MagazineAmmo[(Picked player)]: + 100
Variable - Modify ClipsAmmo[(Picked player)]: - 1
Unit - Enable the Attack ability for AmmoUnit[(Picked player)]
UI - Display "Reloaded!!" for (Player group((Picked player))) to Subtitle area
Trigger - Stop all instances of RemoveBullet
Else
Variable - Set AttackTrue[(Picked player)] = true
Variable - Set AttackInProgress[(Picked player)] = false
UI - Display "OUT OF AMMO!!!" for (Player group((Picked player))) to Subtitle area
I still haven't figured this out, can somebody help?
Well, first of all "this isn't working!!" isn't exactly the problem description we'd wish for. You will get replays faster and more often if you actually hell us what exactly isn't working right..
This might be more like the right thing.
I thought that would work, but it didn't. ...And sorry, I don't know why I didn't explain, anyway...
The problem is I'm trying to make this all work in 1 trigger instead of trying to make 7 copies. But the problem is I can't get the picked player to work, since all the integers are in arrays of 15. So I'm trying to make array 1 = player 1
@Raeymunn: Go
WOW! I made a mistake in my variables, but since that correction and what you said, this might work. Now let me test it for multiple units!!
THANKS!
@Raeymunn: Go
Okay, it works for 2 players, but there is one problem left!
When the unit starts reloading, it waits 2 seconds before it gives the unit it's attack back. But... the problem is if players 2 unit starts reloading first then .4 seconds later players 1 unit reloads the attack doesn't enable again, how do I make this multi instanceable in 1 trigger?
Never mind, I fixed it!!