• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team
    • jhxp

      Multi Theft Auto: San Andreas 1.5.4 is out!   21/04/17

      Click the link in the announcement for more details.  
Sign in to follow this  
Followers 0
Iaan

Import all files in meta

12 posts in this topic

Hello everyone

Today I was thinking of a pro idea in the "meta.xml" file.

<file src = "images/*" />

The "*" represents all archives. (Loop)

 

When I do this, everything in the resource, in the folder "images" will be imported automatically, avoiding to write each file.

10 people like this

Share this post


Link to post

Good idea, this would save a lot of time. If it can be done.

Share this post


Link to post

Posted (edited)

Same could be done with any other files (scripts, maps), to be honest, not just file...files.

At the moment we can do this but it will require a separate watch script to implement the functionality.

Edited by myonlake

Share this post


Link to post

Posted (edited)

Good idea, but I would do asterisk substitute for any characters also. For example:

*.txd - all files with txt extension

file_*.txd - file_1, file_2, file_3, etc

Edited by Dante383
1 person likes this

Share this post


Link to post
7 minutes ago, Dante383 said:

Good idea, but I would do asterisk substitute for any characters also. For example:

*.txd - all files with txt extension

file_*.txd - file_1, file_2, file_3, etc

Of course, this is another nice example.

Share this post


Link to post

It would be useful. But in the meantime you could use this simple shell script (if running linux):

for name in *.png #will go through all pngs, use * for all files.
do
echo "<file src=\"/images/$name\" type=\"client\" />" #$name will get replaced with file names
done

Just put it in the same directory as the files and then run simply like: ./test.sh > list.txt

Then just copy it from list.txt to meta.xml.

Hopefully someone can find it useful if they're not familiar with shell scripting.

Share this post


Link to post

It need to be . That saves a lot of time. But not "*" simple, if I just want some files like txd. "*.txd" or dff "*.dff".
Good idea anyway.

Share this post


Link to post

Sick idea tho. I agree with this suggestion

Share this post


Link to post

I don't think it's really required since it can be done with any other programming languages. Just google it, there are already a few of examples.

Share this post


Link to post
On 21/04/2017 at 07:29, ozulus said:

I don't think it's really required since it can be done with any other programming languages. Just google it, there are already a few of examples.

I know it, but, why not implement this ? It's something simple and very productive.

I use a script similiar: 

On 04/03/2017 at 23:10, MIKI785 said:

It would be useful. But in the meantime you could use this simple shell script (if running linux):


for name in *.png #will go through all pngs, use * for all files.
do
echo "<file src=\"/images/$name\" type=\"client\" />" #$name will get replaced with file names
done

Just put it in the same directory as the files and then run simply like: ./test.sh > list.txt

Then just copy it from list.txt to meta.xml.

Hopefully someone can find it useful if they're not familiar with shell scripting.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.