Project Reality + Battlefield 2 on Steam

If you find a bug within PR:BF2 (including PRSP), please report it here.
HTG
Posts: 3
Joined: 2009-10-11 16:47

Re: Project Reality + Battlefield 2 on Steam

Post by HTG »

Encountering the same problem as described in the initial post.


When launching the pr.exe the only relevant processes displayed in my task manager is the "BF2.exe", steam .exe is running anyway. Somehow there isn't a pr.exe displayed.

the log reads:
C:\Program Files\Steam\SteamApps\common\battlefield 2
PR command line args sent to BF2: +modPath mods/pr +menu 1


Deleting news ticker directory: Deleted C:\Users\HTG\Documents/Battlefield 2/LogoCache/www.gloryhoundz.com

Error in MovingSplashScreen: --> System.IO.FileNotFoundException: Die Datei "C:\Program Files\Steam\SteamApps\common\battlefield 2\00000000.256" konnte nicht gefunden werden.
Dateiname: "C:\Program Files\Steam\SteamApps\common\battlefield 2\00000000.256"
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
bei System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)
bei System.IO.FileInfo.CopyTo(String destFileName)
bei FileMover.CopySplashScreen()
bei Launcher.Run(String[] args)

Copy PR Splash screen 00000000.256 to main BF2 directory

Launching BF2
BF2 Exiting

PR Splash screen stored at C:\Program Files\Steam\SteamApps\common\battlefield 2/mods/pr/00000000.256 , moved copy deleted

Error in ReturningPRSplashScreen: --> System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)
bei System.IO.FileInfo.CopyTo(String destFileName)
bei FileMover.ReturnSplashScreen()
bei Launcher.Run(String[] args)

gloryhoundz.com directory not found, deletion confirmed

Hope that helps!
Cheers
HTG
Posts: 3
Joined: 2009-10-11 16:47

Re: Project Reality + Battlefield 2 on Steam

Post by HTG »

I just realized that if you create a shortcut for BF2 on your desktop via steam the two command lines read like that:

target:
"C:\Program Files\Steam\Steam.exe" -applaunch 24860
sart in:
"C:\Program Files\Steam"

any relevance? :o ops:
AMT
Posts: 35
Joined: 2007-02-09 00:10

Re: Project Reality + Battlefield 2 on Steam

Post by AMT »

This is what happens for me:

pr.exe starts.
pr.exe closes.
bf2.exe starts.
You try to login and you get the "please launch via pr.exe" error.
bf2.exe closes.
A signature would go here if I had one.
chilean
Posts: 124
Joined: 2009-10-02 00:54

Re: Project Reality + Battlefield 2 on Steam

Post by chilean »

Steam sucks i really dont like it , Lags your comp, at least me.
I only use it for America Army 3
VBNight
Posts: 3
Joined: 2009-10-13 02:43

Re: Project Reality + Battlefield 2 on Steam

Post by VBNight »

I have built a workaround to allow Steam players to get Project Reality to launch correctly. The problem is BF2.exe from Steam quits when you 1st launch it to perform some sort of Steam authentication. Steam relaunches BF2 after the authentication. This script launches PR.exe, waits for it to close when BF2 closes, then waits for BF2 to be restarted, then relaunches PR.exe so it is running with BF2. This has the side effect of PR.exe starting BF2 again which try to start but it will exit because the existing BF2 process is running.

The PR developers should be able to update the PR.exe to detect steam and wait for BF2 to relaunch instead of exiting but this will let you run the game until they do.

Please post any questions or problems here.



AUTOHOTKEY REQUIRED - FREE

You will need to have Autohotkey installed on your system to use this script.

Download Autohotkey: http://www.autohotkey.com

AUTOHOTKEY REQUIRED - FREE




To Use Script:



Copy & Paste Method
  • Paste the following code into a blank notepad.
  • Save the text file on your desktop as "LaunchPR.ahk"
  • Double click LaunchPR.ahk to start Project Reality.
Download Method
  • Download attached LaunchPR.txt file.
  • Open file in notepad and verify text matches script above. (Optional)
  • Rename file to LaunchPR.ahk
  • Double click LaunchPR.ahk to start Project Reality.
Project Reality Launcher - Steam Helper

Code: Select all

; Project Reality Launcher - Steam Helper
;
; This workaround helps launch Project Reality for users who purchased BF2 on Steam.
;
; Run this script to start Project Reality
;
; Launches PR.exe and waits for it to exit when BF2 performs Steam authentication.
; Relaunches PR.exe after Steam restarts BF2.exe after authentication.
;
; WARNING: The 2nd launch of PR.exe attempts to start BF2 again which will try start then quit.

#NoTrayIcon 
#SingleInstance force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

; Get Path To Project Reality PR.EXE
EnvGet ProgramFilesX86, ProgramFiles(x86)
PREXE := ProgramFilesX86 . "\Steam\steamapps\common\battlefield 2\mods\pr\pr.exe"
BF2 := ProgramFilesX86 . "\Steam\steamapps\common\battlefield 2\"

; Verify Path Correct
IfNotExist %PREXE%
{
	EnvGet ProgramFilesFolder, ProgramFiles
	PREXE := ProgramFilesFolder . "\Steam\steamapps\common\battlefield 2\mods\pr\pr.exe"

	IfNotExist %PREXE%
	{
		Msgbox PR.EXE (%PREXE%) NOT FOUND, PROJECT REALITY LAUNCHER FAILED
		ExitApp 1
	}
}

; Launch PR, Wait For It To Exit
RunWait, %PREXE%, %BF2%, UseErrorLevel

; Wait For BF2 Relaunch (20 Sec Timeout)
Process, Wait, BF2.exe, 20

; Check Timeout Error
if (ErrorLevel == 0)
{
	Msgbox TIMEOUT WAITING FOR BF2 RELAUNCH, PROJECT REALITY LAUNCHER FAILED
	ExitApp
}

; Relaunch PR.EXE Again
Run, %PREXE%, %BF2%, UseErrorLevel

; Exit (Finished)
ExitApp 0

Please post any questions or problems here.
You do not have the required permissions to view the files attached to this post.
Last edited by VBNight on 2009-10-13 18:11, edited 2 times in total.
Reason: Update Script For 32Bit
HTG
Posts: 3
Joined: 2009-10-11 16:47

Re: Project Reality + Battlefield 2 on Steam

Post by HTG »

Excellent!!
It seems it works perfect.
I currently don't have the time to actually play as I have to work, however the error does not occur and I can access the server list etc.!
I will give more feedback this evening!
Many thanks.... :razz:
Andrea h2o
Posts: 2
Joined: 2009-10-13 08:05

Re: Project Reality + Battlefield 2 on Steam

Post by Andrea h2o »

doesn't work for me.. with autohotkey i got this error

Image
R3M
Posts: 1
Joined: 2009-10-12 19:28

Re: Project Reality + Battlefield 2 on Steam

Post by R3M »

@VBNight

Great that did the trick for me, thanks.

@Andrea h2o

I had the same problem like you, because my game is not installed in the ProgramFiles folder. Just edit this script and remove/change:
PREXE := ProgramFilesX86 . "\Steam\steamapps\common\battlefield 2\mods\pr\pr.exe"
BF2 := ProgramFilesX86 . "\Steam\steamapps\common\battlefield 2\"
to
PREXE := "\Steam\steamapps\common\battlefield 2\mods\pr\pr.exe"
BF2 := "\Steam\steamapps\common\battlefield 2\"
and
; Verify Path Correct
IfNotExist %PREXE%
{
EnvGet ProgramFiles, ProgramFiles
PREXE := ProgramFiles . "\Steam\steamapps\common\battlefield 2\mods\pr\pr.exe"

IfNotExist %PREXE%
{
Msgbox PR.EXE (%PREXE%) NOT FOUND, PROJECT REALITY LAUNCHER FAILED
ExitApp 1
}
}
to
; Verify Path Correct
IfNotExist %PREXE%
{
PREXE := "\Steam\steamapps\common\battlefield 2\mods\pr\pr.exe"

IfNotExist %PREXE%
{
Msgbox PR.EXE (%PREXE%) NOT FOUND, PROJECT REALITY LAUNCHER FAILED
ExitApp 1
}
}
PLODDITHANLEY
Posts: 3608
Joined: 2009-05-02 19:44

Re: Project Reality + Battlefield 2 on Steam

Post by PLODDITHANLEY »

I hate DL'ed games - disc or nothing for me (when a disc exists not in the case or PR). Seems to bring extra problems.
Andrea h2o
Posts: 2
Joined: 2009-10-13 08:05

Re: Project Reality + Battlefield 2 on Steam

Post by Andrea h2o »

mmmm i edited but doesn't work...

C:\Program Files\Steam\steamapps\common\battlefield 2\mods\pr
C:\Program Files\Steam\steamapps\common\battlefield 2

here where are located my files, hope to get some help :P

edit: it's work now something was wrong on editing :P
VBNight
Posts: 3
Joined: 2009-10-13 02:43

Re: Project Reality + Battlefield 2 on Steam

Post by VBNight »

@Andrea h2o

Thanks for the error message, I fixed the script to work correctly when checking the Program Files folder for PR.

You should not have to edit the script now if Steam is installed in its default location Program Files\Steam or Program Files (x86)\Steam.

If not installed in the default location follow R3M advice above to update the path to your installed location.
memme
Posts: 13
Joined: 2008-01-02 15:00

Re: Project Reality + Battlefield 2 on Steam

Post by memme »

hey,
i tried ur script - but get the "TIMEOUT WAITING FOR BF2 RELAUNCH, PROJECT REALITY LAUNCHER FAILED" Error Message. : (

(am using XP Pro)
VBNight
Posts: 3
Joined: 2009-10-13 02:43

Re: Project Reality + Battlefield 2 on Steam

Post by VBNight »

Does BF2 and PR launch or does it never start?

If it is taking longer then 20 seconds for BF2 to launch you can increase the timeout value.

Change the 20 in this line of the script to the number of seconds to wait for BF2.exe to start.
Process, Wait, BF2.exe, 20
memme
Posts: 13
Joined: 2008-01-02 15:00

Re: Project Reality + Battlefield 2 on Steam

Post by memme »

well i works now ^^, was my fault - did not set "pr.exe", just the folder it is inside and wondered why it opens a folder and not pr XD .. damn

thx for the script!
memme
Posts: 13
Joined: 2008-01-02 15:00

Re: Project Reality + Battlefield 2 on Steam

Post by memme »

ok got a new problem.. starting PR with the script works fine, but when i try to join a game "invalid cd key" err message arrives -.-. am i the only one with this problem ?

joining vanilla bf2 servers is no problem.. shitty steam >.<
Radukus
Posts: 1
Joined: 2009-10-18 17:59

Re: Project Reality + Battlefield 2 on Steam

Post by Radukus »

This is the path for my pr folder : F:\Program Files\Steam\steamapps\common\battlefield 2\mods\pr

Could anyone please tell me how i should modify the script in order to get pr to work?
Thank you for your help!
memme
Posts: 13
Joined: 2008-01-02 15:00

Re: Project Reality + Battlefield 2 on Steam

Post by memme »

like this:

PREXE := "F:\Program Files\Steam\steamapps\common\battlefield 2\mods\pr\pr.exe"
BF2 := "F:\Program Files\Steam\steamapps\common\battlefield 2"

but the path u have looks like the standard path, perhaps u dont have to change it.
memme
Posts: 13
Joined: 2008-01-02 15:00

Re: Project Reality + Battlefield 2 on Steam

Post by memme »

ok its strange, realy strange, but after i played a round vanilla bf2 and after that startet PR again.. the "no valid cd key" err never showed up again XD


Edit: so yes, i can join PR games now. great stuff XD
Turbulence391
Posts: 2
Joined: 2009-10-09 00:15

Re: Project Reality + Battlefield 2 on Steam

Post by Turbulence391 »

Yeah well I hope I can play pr it's just rahter getting the pr.exe to be set up right.
andregabriotti
Posts: 1
Joined: 2009-10-26 01:09

Re: Project Reality + Battlefield 2 on Steam

Post by andregabriotti »

@VBNight script working here!!!

Thanks a lot!!!
Locked

Return to “PR:BF2 Bugs”