Home   Help Search Login Register  

Author Topic: Higher Score for Higher Rank  (Read 1349 times)

0 Members and 1 Guest are viewing this topic.

Franksie86

  • Guest
Higher Score for Higher Rank
« on: 14 Jun 2005, 15:34:50 »
Ok this is what I want to do...

I've made a sniper misson using the new Lib 1941 pack and I want to make the player's score higher according to what rank the officer was that he killed.

Eg. A Lieutenant - 100 points
      A Major - 300 points
     A colonel - 500 points etc.

How do i do this?

Offline Blanco

  • Former Staff
  • ****
Re:Higher Score for Higher Rank
« Reply #1 on: 15 Jun 2005, 00:22:57 »
There is no command that returns a unit rank, The only thing you can do is to name every enemyunit and put them in an array, like

_majors = [m1,m2,m3,m4]
_colonels = [c1,c2,c3,c4]
etc...

Then give each of them a killed EH and check the arrays :

Code: [Select]
_killer = _this select 0
_casualty = _this select 1

_killer = _casualty : exit
?_casualty in _majors : _killer addrating 300
?_casualty in _colonels : _killer addrating 500

exit

Not tested.
« Last Edit: 15 Jun 2005, 10:30:05 by Blanco »
Search or search or search before you ask.

UNN

  • Guest
Re:Higher Score for Higher Rank
« Reply #2 on: 15 Jun 2005, 00:56:21 »
HateR_Kint came up with this method:

GetRank.sqf:

Code: [Select]
private ["_unit","_rank","_result"];

_Unit=_This Select 0;

_Rank=Rating _Unit;
_Result="PRIVATE";

If (_Rank>=7500) Then
   {
   _Result="COLONEL";
   }
   Else
   {
   If (_Rank>=5000) Then
      {
      _Result="MAJOR";
      }
      Else
      {
      If (_Rank>=3500) Then
         {
         _Result="CAPTAIN";
         }
         Else
         {
         If (_Rank>=2500) Then
            {
            _Result="LIEUTENANT";
            }
            Else
            {
            If (_Rank>=1500) Then
               {
               _Result="SERGEANT";
               }
               Else
               {
               If (_Rank>=500) Then
                  {
                  _Result="CORPORAL";
                  }
                  Else
                  {
                  If (_Rank>=0) Then
                     {
                     _Result="PRIVATE";
                     };
                  };
               };
            };
         };
      };
   };


_Result

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Higher Score for Higher Rank
« Reply #3 on: 15 Jun 2005, 08:30:34 »
::)
Ah yes, that old bugger...

Of course, do note that it will give faulty rank if the unit has done some killing since the rating goes up with the kills performed...

Oh, and the usage would be:

init.sqs
Code: [Select]
getRank=preprocessFile "getRank.sqf"And in some trigger or in a script
Code: [Select]
[unit] call getRank
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Grendel

  • Guest
Re:Higher Score for Higher Rank
« Reply #4 on: 16 Jun 2005, 01:49:27 »
Or you could combine Blanco and HateR_Kint's methods!

Use the .sqf to assign the units to an array either on init or as they are spawned.

That way, if their rating goes up it doesn't matter as they are already assigned a 'rank'.  

-Grendel

UNN

  • Guest
Re:Higher Score for Higher Rank
« Reply #5 on: 16 Jun 2005, 02:29:55 »
Quote
Of course, do note that it will give faulty rank if the unit has done some killing since the rating goes

I did not think that would be a problem? After all if you do take out an effective AI, you deserve a reward just for finding one :)

Offline Blanco

  • Former Staff
  • ****
Re:Higher Score for Higher Rank
« Reply #6 on: 16 Jun 2005, 04:46:27 »
Yeah...Only one thing I'm not sure about...
Will the unit still be in the array when it got killed?
Is the unit removed from array when it got killed?


 


 
« Last Edit: 16 Jun 2005, 04:48:31 by Blanco »
Search or search or search before you ask.

Dubieman

  • Guest
Re:Higher Score for Higher Rank
« Reply #7 on: 17 Jun 2005, 04:36:04 »
Depending on how many officers are in your mission, why don't you just assign values to each of the ones that are going to be shot. Like have a trigger or something for each so when he dies the player recieves  x amount of points. And then when he kills a big wig he gets y amount of points via trigger/code. I don't see why you need the rank thing unless you have a lot of officers.  :P

edit: oh, by points I meant addrating... ::) :)
« Last Edit: 17 Jun 2005, 04:36:34 by GuiltyRoachKillar »

qqqqqq

  • Guest
Re:Higher Score for Higher Rank
« Reply #8 on: 18 Jun 2005, 01:41:24 »
How will the player be able to tell the rank of his target?   (If he can't tell, it's a bit pointless - the score will effectively be random as far as he is concerned.)

Also, this is OFP not an arcade game.   Does anybody actually care about score?   If they (or you) do, good for them, but be aware that a lot of people don't.

Dubieman

  • Guest
Re:Higher Score for Higher Rank
« Reply #9 on: 19 Jun 2005, 03:33:31 »
I agree with qqqqqq regaurding points in the end. I never pay attention to them much, I'm more concerned with my expierence in the mission and whether we succeeded or not.

My 2 cents....
Well 1 cent stolen from qqqqqq so
My 1 cent.

 ;)