Basically I'm looking for a way to trigger a unit to attack something once, and then stop. I'm making a pseudo FPS map, similar to the simple flash FPS games out there, so obviously want to be able to have attack once per click, as opposed to continually attacking after a single click.
The unit's (Rifleman 0001) attack speed it 0.25 seconds, and I've got two triggers at the moment, the first;
To simply allow the player to click to shoot, and the second;
To attempt to stop after a single attack.
I tried toying around with the delay, but increasing it leads to often attacking several times per click, and decreasing it leads to often not attacking at all. Being example 0.25 seconds works to an extent, though sometimes leads to either of the previous scenarios. I've tried a few other ways of getting around it with the GUI, but couldn't find anything that worked. I'm unfamiliar with JASS.
Anyone able to suggest a way around it?
The unit's (Rifleman 0001) attack speed it 0.25 seconds, and I've got two triggers at the moment, the first;
Code:
Event: Time - Every 0.01 seconds of game time
Condition: None
Action: Game - Force Player 1 (Red) to press the key A
To simply allow the player to click to shoot, and the second;
Code:
Event: Rifleman 0001 <gen> Is issued an order targeting an object
Condition: None
Action: Wait 0.25 seconds
[B][/B] [B][/B] [B][/B] [B][/B] [B][/B] [B][/B] [B][/B] Unit - Order Rifleman 0001 <gen> to Stop
To attempt to stop after a single attack.
I tried toying around with the delay, but increasing it leads to often attacking several times per click, and decreasing it leads to often not attacking at all. Being example 0.25 seconds works to an extent, though sometimes leads to either of the previous scenarios. I've tried a few other ways of getting around it with the GUI, but couldn't find anything that worked. I'm unfamiliar with JASS.
Anyone able to suggest a way around it?