the Phrozen Forums
  General Mod Making
  -direct -txt mode the start in function in the shourtcut and dlls

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   -direct -txt mode the start in function in the shourtcut and dlls
mandzo
Moderator

Posts: 658
From: Bulgaria,Sofia
Registered: Aug 2001

posted 15 December 2001 13:46     Click Here to See the Profile for mandzo   Click Here to Email mandzo        Reply w/Quote   Visit mandzo's Homepage!
just wondering is the start in function working with work with dlls too cos it works with my data folder

------------------
Read or DIE
Muahahahaha

the next beta is coming and its beter then ever

IP Logged

NefariusDX
Honorary Warlord

Posts: 1392
From: The Hadal Abyss of Eternal Oblivion
Registered: Jun 2001

posted 15 December 2001 14:45     Click Here to See the Profile for NefariusDX   Click Here to Email NefariusDX        Reply w/Quote   Visit NefariusDX's Homepage!
i didnt try to use any ****ed .dlls with it but it should work? if you make a sub directory for it to operate in.

------------------
-------------------------
Your Soul is MINE!
------------------
Nefarius daemonicum dominantum inimicus est
-------------------------
XyRAXv21.00B Comming SoOn
-------------------------
:D:D:D

IP Logged

Kobu
Lord

Posts: 105
From: Tokyo
Registered: Dec 2001

posted 15 December 2001 16:41     Click Here to See the Profile for Kobu   Click Here to Email Kobu        Reply w/Quote   
I tried it and it didn't work...

IP Logged

FoxBat
Moderator

Posts: 1618
From: PA, USA
Registered: Feb 2001

posted 15 December 2001 18:01     Click Here to See the Profile for FoxBat   Click Here to Email FoxBat        Reply w/Quote   
This script will modify the registry save location so that if you have a folder called save in your base mod directory, it will use that as the save folder. If it finds a d2game and/or d2client .dll, it will rename the d2game/d2client in the DiabloII directory to end with .bak. Then it starts Diablo II with -direct -txt. Now D2 will look for the DLLs in the D2 directory first: and when it doesen't find them (because we renamed it to .bak) D2 then looks in your base mod folder, and finds the modified DLLs. When D2 terminates, the script will return everything to normal.

Take the below text, copy and paste it into notepad, and save it as runmod.vbs. Put this into your base mod folder. Put your modified d2client and/or d2game there as well. Create a save folder in the base mod folder if you want a seperate save folder. Then double-click on runmod.vbs.


'Create a shell object
Set Shell = WScript.CreateObject("WScript.Shell")
'Get path to Diablo II EXE from registry
D2Path = Shell.RegRead("HKCU\Software\Blizzard Entertainment\Diablo II\Program")
n = InStrRev(D2Path, "\")
D2Path = Left(D2Path, n) 'Strip to just path
'Create a file system object
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
'Get the current directory folder object
Set Folder = FSO.GetFolder(".")
'Get full pathname of current directory and append save dir name
Dir = Folder.Path & "\Save\"
'Get file object for D2Client.dll in Diablo directory
Set ClientDLL = FSO.GetFile(D2Path & "D2Client.dll")
Set GameDLL = FSO.GetFile(D2Path & "D2Game.dll")
'If Diablo path is not the current directory run MOD otherwise just fix up
If Folder.Path & "\" <> D2Path Then
'Check if a D2Client.dll exists in the current directory
If FSO.FileExists(Folder.Path & "\D2Client.dll") Then
'Rename DLL in Diablo directory
ClientDLL.Move (D2Path & "D2Client.bak")
End If
'Check if a D2Game.dll exists in the current directory
If FSO.FileExists(Folder.Path & "\D2Game.dll") Then
'Rename DLL in Diablo directory
GameDLL.Move (D2Path & "D2Game.bak")
End If
'Get current save folder
SaveDir = Shell.RegRead("HKCU\Software\Blizzard Entertainment\Diablo II\Save Path")
'Write our new save directory in the registry
Shell.RegWrite "HKCU\Software\Blizzard Entertainment\Diablo II\Save Path", Dir, "REG_SZ"
'Ensure script gets to clean up if launching Diablo II fails
on error resume next
'Launch Diablo II with -direct option and wait for it to finish
Result = Shell.Run(chr(34) & D2Path & "Game.exe" & chr(34) & " -direct -txt", 1, TRUE)
End If
If ClientDLL.Name = "D2Client.bak" Then
ClientDLL.Move (D2Path & "D2Client.dll")
End If
If GameDLL.Name = "D2Game.bak" Then
GameDLL.Move (D2Path & "D2Game.dll")
End If
'Restore previous save directory setting in registry
Shell.RegWrite "HKCU\Software\Blizzard Entertainment\Diablo II\Save Path", SaveDir, "REG_SZ"

IP Logged

Kobu
Lord

Posts: 105
From: Tokyo
Registered: Dec 2001

posted 15 December 2001 23:09     Click Here to See the Profile for Kobu   Click Here to Email Kobu        Reply w/Quote   
Thanks very much Foxbat. This is much better than the bat files I was using.

IP Logged

All times are Central Standard Time

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | The PhrozenKeep

© PhrozenKeep.com . all buttons made by the Evilenglishman . swords and shields by DigiBO.


Ultimate Bulletin Board 5.47c