Hello All
I am writing a set of scripts that will allow players to play a form of (near) endless deathmatch. Each player starts as a single man (officer, sniper or vehicle commander), each in his own group and each with a script that executes from their int field called "options.sqs".
In fact there are a number of variants of "options.sqs" - one for each unit type and one for each side. For instance - "optionsESniper.sqs" runs on all East Sniper units, "optionsWVehicle.sqs" runs on West vehicle commanders and so on.
What the script does is work out who the leader of the player's group is (pretty hard, huh ?) then gives that unit a number of exta actions that I have written, such as Jump, Dig In, Build Camp and Call in Backup.
Call in Backup just adds new units to the players group, varying depending upon the unit's type. Sniper players get black ops guys and more snipers, vehicle guys get APCs, AFVs etc and so on.
Combined with a Group respawn I can generate near endless battles - so long as you can keep one guy in your group alive the "options" script will grant your new Leader the magic power to add new units and rebuild your squad. Near endless fun - just don't let yourself get wiped out !
So far I have everything working pretty fine. I've learned heaps about respawning, scipt processes (when they run, on which machines they run, what happens when the caller dies (nothing! - except the caller's Group details change !)) and lots more.
And here's the problem (you knew it had to be here somewhere !). The Call in Backup script is run as an addaction so the player can call it as fast as he can select it and click on it. I'm trying to do two things - force a delay between calls and create some sort of "Reserves" counter for each player that goes up over time but goes down each time that they call in back up so that if they build up their reserves they can get better troops.
I thought about setting up global variables for each player (ReservesE1, ReservesE2 etc)and incrementing them in a separate script, but how can I check that total in the Call in Back up script ?
I have created multiple difficulties for myself - multiplayer, with the one "options" script called by more than one person and of course the fact that the "Player" changes every time that he dies and comes back to life (invariably as a unit that didn't exist when the mission began). My poor options script doesn't know which Reserves variable to check !
I was thinking about using the Score or Rank variables as a form of player specific global variables that I could use to suit my purposes, but I need to know what makes them go up and down, and by how much. Should killing enemy add to a players "Reserves" total (neat, but maybe not what i wanted). If I call in too many reserves should everyone want to kill me (see Rank in the command ref!)
The command ref is very terse on these two commands and doesn't answer those last two questions and I couldn't find anyhting in these forums.
Please help.
Roni