Jump to content

A simple Bourne Again Shell Script to install custom Maps


Recommended Posts

I have written a simple BASH script for GNU Linux to install maps that users make for 0ad.

Please review and improve. Use as you would like.

See readme.

This was originaly made for SwampGremlin's map.

EDIT by Sanderd17:

Removed the script as we cannot accept scripts that require to be run as root, unless really necessary.

Edited by sanderd17
Link to comment
Share on other sites

Yes, it seems easy enough. But when in game i noticed that apparantly it isn't for allot of people. Also, the install dir varies with platform and install method.

Also this script of for linux, not windows. Also when installing on nix the /usr/share is not owned by the user group.

Edited by glassPen
Link to comment
Share on other sites

Assuming mappers/modders provide a zip file containing maps/{scenarios,skirmish}/* and the ui folder with the preview image (can't remember that path), you can just drop that file into the user mod (see GameDataPaths on the wiki). (No compression or DEFLATE for the zip only.)

That's the best way as is now, I agree. Still not very comfortable IMO.

(E.g. the mappreview should be searched for in the path the map is in also)

Edited by FeXoR
Link to comment
Share on other sites

I'm sorry, read your script, and I had to remove it.

There's really no way we can accept that script to be ran as root.

As other comments mentioned, moving it to the user mod (i.e. ~/.local/share/0ad/mods/user on Linux) will also install the map. This does not require root privileges, and allows the map to stay available when updating the game.

Next to being dangerous (although your code seemed to have enough quotes on first sight), it's also a bad habit to run scripts as root. We've got a lot of error reports about users trying to build the SVN, just because they build it as root. They did it out of habit, and it messed up paths and file permissions. As such, we now explicitly stop the execution of both the compilation script and the pyrogenesis executable when it's run as root. This should also be done in your script if you want to publish it again.

Link to comment
Share on other sites

Assuming mappers/modders provide a zip file containing maps/{scenarios,skirmish}/* and the ui folder with the preview image (can't remember that path), you can just drop that file into the user mod (see GameDataPaths on the wiki). (No compression or DEFLATE for the zip only.)

If the mod contained those folders, wouldn't it mess things up for those who already had them? Even if the game would read multiple maps folders, it would be messy.

Edited by greenknight32
  • Like 1
Link to comment
Share on other sites

If the mod contained those folders, wouldn't it mess things up for those who already had them? Even if the game would read multiple maps folders, it would be messy.

No it would not. It just puts all those files in one (virtual) folder that is read by the game.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...