ArferBrick Posted March 13, 2016 Report Share Posted March 13, 2016 Hello, not sure if this is the right place to ask this question so please delete/move it if needed. I simply want to be able to build walls and/or towers completely freely, anywhere on the map - ie totally disregarding the territory owner/terrain/range rules. There must be a file somewhere that I can modify to simply disable checking, but I can't even find the game files! I've read through a lot of tutorial pages and they all seem to mention a public folder but I can't find the right one (there's one in ~/.local/share/0ad/mods/public, and one in /usr/share/games/0ad/mods/ - but no files!). If someone could kindly point me in the right direction I would be eternally grateful :). Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 13, 2016 Report Share Posted March 13, 2016 You don't see the big one zip name as public? The tutorial is more for SVN version. But inside you get the same files. if you want modify the game, try to use that version. @wowgetoffyourcellphone you enable free placement in your mod, you can help here? I haven't experience at that level. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted March 13, 2016 Report Share Posted March 13, 2016 (edited) Just modify the templates. <BuildRestrictions> <Territory>own neutral ally</Territory> </BuildRestrictions> Then add these to the template to stop the structures from losing loyalty and from casting a territory effect: <TerritoryDecay disable=""/> <TerritoryInfluence disable=""/> If you want to do some moddding, I suggest you download svn version of game. It is developer version and all files are moddable. From there we can help you make a mod folder where you can put your new files into without worrying about mess up core game files. Edited March 13, 2016 by wowgetoffyourcellphone 4 Quote Link to comment Share on other sites More sharing options...
ArferBrick Posted March 13, 2016 Author Report Share Posted March 13, 2016 Thanks for the swift replies :). A few more questions if I may - 1) All the game files are contained in /usr/share/games/0ad/mods/public/public.zip, correct? 2) Can I extract that entire zip file and run the game with it unzipped, or must I edit the files then re-zip it each time? 3) Which template file(s) do I edit? I found some possible candidates in public.zip/simulation/components/ - BuildRestrictions.js, and WallPiece.js and WallSet.js - are they the correct files? Sorry if they are stupid questions, but I'm not a programmer . Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 13, 2016 Report Share Posted March 13, 2016 2- no isn't necessary reziped. 3- templates are those files are main files example the Civic Cente, or houses those buildings are common by all this includes the wall templates. Quote Link to comment Share on other sites More sharing options...
niektb Posted March 13, 2016 Report Share Posted March 13, 2016 3) No, these are the gameplay scripts. The templates you need to edit are in simulation/templates Quote Link to comment Share on other sites More sharing options...
ArferBrick Posted March 13, 2016 Author Report Share Posted March 13, 2016 (edited) Thanks a million for the info all Here's what I did (in order to help other newbies save some time) - I extracted the contents of /usr/share/games/0ad/mods/public/public.zip, then renamed the zip file to disable it. Then I made a backup copy of /usr/share/games/0ad/mods/public/simulation/templates/template_structure_defense_wall.xml & template_structure_defense_wall_tower.xml & changed the following in each file: Original - <BuildRestrictions> <PlacementType>land-shore</PlacementType> <Category>Wall</Category> </BuildRestrictions> To - <BuildRestrictions> <Territory>own neutral ally enemy</Territory> <PlacementType>land-shore</PlacementType> <Category>Wall</Category> </BuildRestrictions> ..and added - <TerritoryDecay disable=""/> <TerritoryInfluence disable=""/> ..at the end of each file, just before - </Entity> and saved the files. It works, b̶u̶t̶ ̶I̶ ̶s̶t̶i̶l̶l̶ ̶c̶a̶n̶'̶t̶ ̶b̶u̶i̶l̶d̶ ̶i̶n̶ ̶e̶n̶e̶m̶y̶ ̶t̶e̶r̶r̶i̶t̶o̶r̶y̶ and rabbits and trees still get in the way -but that's a story for another day when I've got some time to waste. All in all very happy with the result and many thanks for the help you all gave me. Eventually I'll try to learn how to get the "git" version and play around with that, but for now my weekend is almost over and I just want to sit back and have fun with 0AD :D. Cheers EDIT: Oh yes, and I just found out that I can add "enemy" to the list of territory restrictions, a̶n̶d̶ ̶t̶h̶a̶t̶ ̶y̶o̶u̶ ̶c̶a̶n̶ ̶m̶o̶d̶i̶f̶y̶ ̶t̶h̶e̶ ̶f̶i̶l̶e̶s̶ ̶o̶n̶ ̶t̶h̶e̶ ̶f̶l̶y̶ ̶-̶ ̶n̶o̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶q̶u̶i̶t̶ ̶t̶h̶e̶ ̶g̶a̶m̶e̶ ̶a̶n̶d̶ ̶r̶e̶s̶t̶a̶r̶t̶ ̶a̶f̶t̶e̶r̶ ̶e̶a̶c̶h̶ ̶e̶d̶i̶t̶. This game just gets better and better :D. Edited March 13, 2016 by ArferBrick added more info 2 Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted March 13, 2016 Report Share Posted March 13, 2016 ArferBrick, it's better to create a simple mod than to modify the public.zip. A mod can overwrite any file in the public.zip by its own version, you only need to place a file with the same name and path in your mod. The advantage of making a mod is that it's clearly split from our code, and you can enable and disable it through the game. The only thing you need to make a mod is a mod-description file (like public.json, but with altered parameters, take a look at some active mods to see the json file), and the files you want to overwrite. Doing it like you do now is also possible, but will cause more problems when upgrading (an upgrade will replace the public.zip), and it will also not allow you to play multiplayer (you'll have a different version of the game, and will immediately get an out-of-sync error). 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.