WELCOME TO THE NIGHT WATCH MILITIA FORUMS

AIX 2.0 Maps and NWM maps
Home Page Play games in the arcade * * Home Page Home Page Home Page
  Register
Login 
View unanswered posts View active topics

Delete all board cookies


Contact Us | All times are UTC - 5 hours [ DST ]



Welcome
Welcome to nightwatchilitia

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!


Home Page Home Page  [ 1 post ] 
  Print view
Previous topic | First unread post | Next topic 
Author Message
Offline 
 Post subject: [sharing] changing SP commander to normal scoring
Unread postPosted: Wed Apr 27, 2016 8:05 am 

Joined: Wed Mar 30, 2016 11:51 am
Posts: 8
Has thanked: 0 time
Have thanks: 2 time
Playing as 'commander' can be fun, but it will also make your own scoring not count, and not being shown in statistic. That can be changed

Folders :
\Battlefield 2\mods\bf2\python\game

DO MAKE COPY OF FILES BEFORE EDITING!!

In a real code-editor NOT a text-editor! -Open the file

scoringCommon.py

I will change quite a lot but you do not have to understand why, just copy paste the sections into your editor.

The first block is at line 73

Code:
   # commander doesnt get score for regular actions, only for pure commander tasks. he also gets punishing points.
   
   if not player.isCommander() or subScore == CMND or points < 0:
      player.score.score += points
      if subPoints == -1:
         subPoints = points

change to
Code:
   # commander doesnt get score for regular actions, only for pure commander tasks. he also gets punishing points.

   #if not player.isCommander() or subScore == CMND or points < 0:
      player.score.score += points
      if subPoints == -1:
         subPoints = points


in line 88
Code:
   # commander score
   commander = bf2.playerManager.getCommander(player.getTeam())
   if commander != None and commander.isValid() and subScore != CMND and player != commander and points > 0:
   preScore = commander.score.score
      numPlayers = bf2.playerManager.getNumberOfAlivePlayersInTeam(commander.getTeam())
      if numPlayers > 0:
         commander.score.score += float(points) / numPlayers
         scoreGotten = commander.score.score - preScore
         if scoreGotten > 0:
            commander.score.cmdScore += scoreGotten

we need to omit a whole bloc
Change to
Code:
   # commander score

   #commander = bf2.playerManager.getCommander(player.getTeam())
   #if commander != None and commander.isValid() and subScore != CMND and player != commander and points > 0:
   #   preScore = commander.score.score
   #   numPlayers = bf2.playerManager.getNumberOfAlivePlayersInTeam(commander.getTeam())
   #   if numPlayers > 0:
   #      commander.score.score += float(points) / numPlayers
   #      scoreGotten = commander.score.score - preScore
   #      if scoreGotten > 0:
   #         commander.score.cmdScore += scoreGotten


I also dont want wrecks to kill me when i jump them
In line 146
Code:
      # no suicides from own wreck

      if killedByEmptyVehicle and object.getIsWreck():
         return


change to
Code:
      # no suicides from own wreck
      if killedByEmptyVehicle: # and object.getIsWreck():
         return


You should now have a commander that is scored as a player, and you should not be killed when you jump from a wreck
mapbear has been thanked by:


Top
 Profile E-mail  
 
Search for:
Display posts from previous:  Sort by  
Home Page Home Page  [ 1 post ] 

Contact Us | All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cron
suspicion-preferred