AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Getting material/model paths easy way (Windows) (https://forums.alliedmods.net/showthread.php?t=299152)

boomix 07-04-2017 20:29

Getting material/model paths easy way (Windows)
 
1 Attachment(s)
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:

http://i.imgur.com/OaKb6qx.gif

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

Lannister 07-04-2017 20:32

Re: Getting material/model paths easy way (Windows)
 
✪ boomix: making alliedmods topic
✪ boomix: so everyone gets it
✪ boomix: https://forums.alliedmods.net/showthread.php?p=2533472
✪ boomix: post something good

http://papercrave.com/wp-content/upl...hing-good1.jpg

rogeraabbccdd 07-04-2017 22:44

Re: Getting material/model paths easy way (Windows)
 
Nice, I don't need to run cmd.exe and use "dir" command anymore.

DarkDeviL 07-05-2017 01:55

Re: Getting material/model paths easy way (Windows)
 
Quote:

Originally Posted by boomix (Post 2533472)
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...

boomix 07-05-2017 04:24

Re: Getting material/model paths easy way (Windows)
 
Quote:

Originally Posted by arne1288 (Post 2533490)
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.

Peace-Maker 07-05-2017 10:50

Re: Getting material/model paths easy way (Windows)
 
This helps too when writing your own plugins.
https://forums.alliedmods.net/showthread.php?t=206496

8guawong 07-05-2017 21:07

Re: Getting material/model paths easy way (Windows)
 
Quote:

Originally Posted by arne1288 (Post 2533490)
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?

Peace-Maker 07-06-2017 03:27

Re: Getting material/model paths easy way (Windows)
 
Quote:

Originally Posted by 8guawong (Post 2533653)
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 (

8guawong 07-06-2017 09:37

Re: Getting material/model paths easy way (Windows)
 
Quote:

Originally Posted by Peace-Maker (Post 2533673)
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\



All times are GMT -4. The time now is 19:14.

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