Home   Help Search Login Register  

Author Topic: What affects Score and Rank ? Can I use them as a sort of global variable ?  (Read 1238 times)

0 Members and 2 Guests are viewing this topic.

Offline Roni

  • Members
  • *
  • Play the Game !
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

PheliCan

  • Guest
Hmm..... I only read your novell quick and I must say I don't see what you want!

However... It might be useful to know that you can use addScore to increese a units score and MAYBE (think I have read it here somewhere) you can use negative numbers to decreese the value (i.e. player addScore -10)...

Did it help or am I totally out?

Offline Roni

  • Members
  • *
  • Play the Game !
Hi Phelican

Thanks for that but I solved the problem. :thumbsup:

I designed and tested a number of scenarios with new guys being called via an action and decided that it was simpler (and improved gameplay) if I just made it automatic.  Now any loon with the appropriate script simply adds one guy to the group (chosen from internal spawn table) every 60 seconds or so, again depending upon the group type.

What I was hoping to do was encourage players to hold off calling in reserves as long as possible by making "slow" reserves better than "quick" reserves.  In the end I discovered that players would call em as fast as they could no matter what !   :P

I now have a simple script that has its own internal parameters for up to five different unit types, their probabilities of arrival and the spawn delay.  Oh yeah, and some scripts spawn on the leader's point and some at a fixed point (gamelogic).

For example - spawnEBlackOps.sqs creates a new unit near the group leader every 20 seconds to a maximum group size of 4 men.  The units appearing are sniper (40%), Grenadier (30%), Spetsnaz (20%) and Engineer (10%).  Not perfect but it works pretty well in play.

If you'd like a copy of the script just em.

Cheers



RD