Raised This Month: $51 Target: $400
 12% 

Getting the ModDir Path?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Imperio59
New Member
Join Date: Sep 2005
Old 09-27-2005 , 08:52   Getting the ModDir Path?
Reply With Quote #1

Hi,
I'm trying to get my plugin to log to a simple text file some data, the problem is that the work dir is where hl2.exe is, meaning for example if i open a file with the path "../MyFile.txt" it finds it's way in Steam\Steamapps\[email protected]\

Do i need to Hook into filesystem to get the Mod Path?
Imperio59 is offline
showdax
Senior Member
Join Date: Dec 2004
Old 09-27-2005 , 09:00  
Reply With Quote #2

There's "virtual bool GetCurrentDirectory(char* pDirectory, int maxlen)" in IFileSystem, so just get the interface and call that.
showdax is offline
Send a message via MSN to showdax
Imperio59
New Member
Join Date: Sep 2005
Old 09-27-2005 , 09:02  
Reply With Quote #3

Allright that sounds good, i'll try it thanks.

EDIT:Astonishingly enough i think I managed to to do. I amaze myself everyday, thanks again

EDIT: Well I'm testing my plugin on my own MOD, and the GetCurrentDir still returns the path of hl2.exe. *Looks more into FileSystem*

EDIT: Ok, well if you just use FileSystem Functions to write to files, it uses your mod dir as the base directory... So for example m_FileSystem->Open("addons/MyFile.txt","wt"); would place the file in ModDir/addons/
Imperio59 is offline
BAILOPAN
Join Date: Jan 2004
Old 09-27-2005 , 14:34  
Reply With Quote #4

We used GetGameDir(). You can chomp off the mod name from that to get to hl2.exe, probably.
__________________
egg
BAILOPAN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode