Raised This Month: $29 Target: $400
 7% 

Getting material/model paths easy way (Windows)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
boomix
Senior Member
Join Date: May 2015
Location: Latvia
Old 07-04-2017 , 20:29   Getting material/model paths easy way (Windows)
Reply With Quote #1

Hey!

Often when I add new models to my server I get pissed off to get all the paths for all the files I need and add to sm_downloader or anywhere else. I checked everywhere, buy couldnt fine anything usefull to make this job easier, so I needed to write my own script. Here is how it looks:



Soo, all you need to do, the new models/materials that you want to put in your server, you put in some kind of directory at your PC. Then just copy paths.bat file to that directory and open it - whoola, all the paths will open up in text editor. You just need to delete the first line and your ready to copy, paste.


Im not 100% this will work for you, because Im not an expert in batch script, but it should work.
Here is the code if anyone wants to create their own batch file

Code:
@ECHO OFF
SETLOCAL DisableDelayedExpansion
SET "r=%__CD__%"

for /r %%F in (*) do (
	SET "p=%%F"
	SETLOCAL EnableDelayedExpansion
	ECHO(!p:%r%=! >> paths.txt
	ENDLOCAL	
)
start notepad "paths.txt"

Or you can just download the 7z with the batch file over here
Attached Files
File Type: 7z paths.7z (286 Bytes, 121 views)
__________________

Last edited by boomix; 07-04-2017 at 20:31.
boomix is offline
Lannister
Veteran Member
Join Date: Apr 2015
Old 07-04-2017 , 20:32   Re: Getting material/model paths easy way (Windows)
Reply With Quote #2

✪ boomix: making alliedmods topic
✪ boomix: so everyone gets it
✪ boomix: https://forums.alliedmods.net/showthread.php?p=2533472
✪ boomix: post something good


Last edited by Lannister; 07-04-2017 at 20:34.
Lannister is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 07-04-2017 , 22:44   Re: Getting material/model paths easy way (Windows)
Reply With Quote #3

Nice, I don't need to run cmd.exe and use "dir" command anymore.
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't open their eyes and use their brain to find answers.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 07-05-2017 , 01:55   Re: Getting material/model paths easy way (Windows)
Reply With Quote #4

Quote:
Originally Posted by boomix View Post
Often when I add new models to my server I get pissed off to get all the paths for all the files I need and add to sm_downloader or anywhere else. I checked everywhere, buy couldnt fine anything usefull to make this job easier, so I needed to write my own script.
sm_downloader ?

Simply just add the folder names that contains content to be downloaded:

Code:
materials/models/player/slow
materials/models/player/techknow
models/player/slow
models/player/techknow
to downloads_simple.ini.

There's only 74 lines in one of my downloads_simple.ini files, which takes care of downloading 3672 files from the materials/models folders...

Can't be more "simple" than that...
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
boomix
Senior Member
Join Date: May 2015
Location: Latvia
Old 07-05-2017 , 04:24   Re: Getting material/model paths easy way (Windows)
Reply With Quote #5

Quote:
Originally Posted by arne1288 View Post
sm_downloader ?

Simply just add the folder names that contains content to be downloaded:

Code:
materials/models/player/slow
materials/models/player/techknow
models/player/slow
models/player/techknow
to downloads_simple.ini.

There's only 74 lines in one of my downloads_simple.ini files, which takes care of downloading 3672 files from the materials/models folders...

Can't be more "simple" than that...

Okey, maybe sm_downloader was not the best example, but this could be handy in more ways, even if I want to plugin to build into plugin automatic downloads for all the files.
__________________
boomix is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-05-2017 , 10:50   Re: Getting material/model paths easy way (Windows)
Reply With Quote #6

This helps too when writing your own plugins.
https://forums.alliedmods.net/showthread.php?t=206496
__________________
Peace-Maker is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 07-05-2017 , 21:07   Re: Getting material/model paths easy way (Windows)
Reply With Quote #7

Quote:
Originally Posted by arne1288 View Post
sm_downloader ?

Simply just add the folder names that contains content to be downloaded:

Code:
materials/models/player/slow
materials/models/player/techknow
models/player/slow
models/player/techknow
to downloads_simple.ini.

There's only 74 lines in one of my downloads_simple.ini files, which takes care of downloading 3672 files from the materials/models folders...

Can't be more "simple" than that...
any idea on how to edit the batch in the first post to give just directory? like your example?
8guawong is online now
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-06-2017 , 03:27   Re: Getting material/model paths easy way (Windows)
Reply With Quote #8

Quote:
Originally Posted by 8guawong View Post
any idea on how to edit the batch in the first post to give just directory? like your example?
Change the set to a dot.
Code:
for /r %%F in (.) do (
__________________
Peace-Maker is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 07-06-2017 , 09:37   Re: Getting material/model paths easy way (Windows)
Reply With Quote #9

Quote:
Originally Posted by Peace-Maker View Post
Change the set to a dot.
Code:
for /r %%F in (.) do (
thx Peace-Maker changing the set to a dot results in

Code:
. 
materials\. 
materials\models\. 
materials\models\player\. 
materials\models\player\custom_player\. 
materials\models\player\custom_player\kodua\. 
materials\models\player\custom_player\kodua\doom2016\. 
materials\models\player\custom_player\kodua\doom2016\hellknight\. 
models\. 
models\player\. 
models\player\custom_player\. 
models\player\custom_player\kodua\. 
models\player\custom_player\kodua\doom2016\.
is it possible to make it so it automatically turns into

Code:
models\player\custom_player\kodua\doom2016\
materials\models\player\custom_player\kodua\doom2016\hellknight\
8guawong is online now
Reply


Thread Tools
Display Modes

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 04:57.


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