Right, so I'm working on a script for snipers. I'm doing it so that it can be implemented easily, as easily as possible, as a matter of fact. I want the end-user interaction with it to consist of him placing the needed units, one trigger, then passing the correct arguments to the script.
Right, so the story behind it is this:
I have a friendly group, an enemy sniper, and a trigger.
Whenever the friendly group enters the trigger (it's MP, so they are the only west soldiers in the area) enters the trigger, I want to launch the script, and have the sniper go active.
Arguments I'm passing to the script:
Groupname (name of friendly group)
Snipername (name of sniper)
Now, I'm going to implement this:
- Target AI before human players (it's a coop)
- If leader is AI, then target him first of all
- Select target at random
- Slow down shooting speed (they get off five rounds pretty quick with that Mosin Nagant, and I don't want the squad eliminated right away, just keep them on their toes)
Right, so I want this dynamic. As dynamic as can be. My goal is no mission-maker interaction with the script file itself.
So, what I'm thinking so far is:
- create two lists, one with human players, one with AI soldiers.
- if there are troops in the AI list, the sniper targets those.
- if not, target the human players.
- use a delay or somesuch to slow down firing speed.
Now, has anyone got any ideas on this?
What I want is dynamics, so can I use:
_numGuys = Count _listName
_randomNum = Random _numGuys
To select a number at random, based on the number of guys (say it's 12, say it's 10, or even 5) being the maximum?
(_listName of course contains all the guys already, and I'm using the
mod command to produce whole integers)
I've been trying to get this to work all afternoon, and now I'm fed up with it ;D
Can I use an evenHandler to detect when the sniper fires, and then use some sort of delay function to stop him from firing again for X number of seconds?
Help me out guys, 'cause this will help you out. I'm gonna fix this, and submit it to the ed depot for everyone's benefit