Jump to content

How to modify 0 A.D.?


Nescio
 Share

Recommended Posts

1 hour ago, fatherbushido said:

Is there a summary of the requests with the according numbers? (It would save the time of going through the whole topic).

Not as far as I know. Feel free to compile one. It's possible I occassionally misnumbered questions, though.

Link to comment
Share on other sites

  • 2 weeks later...

67. Starting entities are defined in the {civ}.json files. They're useful for units, but not really for structures, because entities spawn at close proximity to the centre. Now what I'd like to have on random random maps is to have players start with six outposts (i.e. at 60° intervals) at a distance of 120 from their centre, rotated properly (so the ladders face towards the centre). Any suggestions on how to do that?

68. Relatedly, a map setting defining starting entities:

  • nomad
  • default
  • default + outposts
  • default + palisade
  • default + palisade + outposts

With the palisade also circular, like this: 0ad_palisades_circle.thumb.png.c07d55a0015ee3e9d20db3cfc394ae55.png

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
On 12/29/2019 at 12:50 PM, Nescio said:

66. An option to deconstruct structures, which returns some resources but takes some time.

One could try replacing a structure (by "upgrade") with some kind of ruin, which has a recource supply?

Or an uglier solution, which I use in my mod, is to convert the structure to GAIA and let units break it down by attacking ^^

Link to comment
Share on other sites

  • 4 weeks later...
On 9/7/2017 at 7:59 PM, bb_ said:

don't know if the path you added is correct it should be the path to where you putted the arcanist files anyway getting a diff with arc is done by


arc diff --preview

then (after pressing "y") a link to a webpage should pop up, from there you can make a new revision with the webgui.

Today I updated arc; apparently the libphutil is deprecated and merged into the arcanist repository. To my surprise, however, `arc diff --preview` no longer works; I get:

[0ad]$ arc diff --preview
Usage Exception: Unknown argument 'preview'. Try 'arc help'.

I don't understand why. After a quick search I found an alternative, `arc diff --only`. What's the difference?

Link to comment
Share on other sites

  • 2 weeks later...
On 10/11/2017 at 2:39 PM, Nescio said:

40. If you use an ally's dropsite, you tribute 10% of the resources (and obtain the remaing 90%), and if an ally uses yours, you receive 10% of the resources.

In SVN now, you can use the following snippet in "CommitResources" in ResourceGatherer.js. I know you use A23b, but you can look at the changes from rP23733 to try and adapt it to your mod.

	let cmpPlayerTarget = QueryOwnerInterface(target);
	let changed = false;
	for (let type in this.carrying)
		if (cmpResourceDropsite.AcceptsType(type))
		{
			if (cmpPlayerTarget && cmpPlayerTarget != cmpPlayer)
			{
				cmpPlayer.AddResource(type, this.carrying[type] * 0.9);
				cmpPlayerTarget.AddResource(type, this.carrying[type] * 0.1);
			}
			else
				cmpPlayer.AddResource(type, this.carrying[type]);
			delete this.carrying[type];
			changed = true;
		}

You can make the 0.9/0.1 a template value of some kind.

Edited by Freagarach
Link to comment
Share on other sites

  • 3 years later...

 

when i config a 0ad local game i use for exit it
this source in the mod

  if (Engine.HasXmppClient())
    {
        Engine.LobbySetPlayerPresence("available")
  }
  Engine.SwitchGuiPage("page_pregame.xml")

to quit and jump main page.

if  i try to start a local game again i get this error:

GUI page 'page_gamesetup_mp.xml': Failed to call init() function

any idea how fix it?

 

Link to comment
Share on other sites

  • 1 month later...

BTW
it is not possible to reload in 0ad javascript. Anyway, I haven't managed to do that (yet). But this workaround works.

Maybe interesting for you:

start 0ad in a infinite loop. So you never need to resart it manually when you change use TogglCommunityMod - Command or simply when changing the mode via mod-profiler. It allows for fast restart. For exit you then need to exit the calling app (typically a terminal).

Example when you use fish-shell:

That's a fish-style endless loop; very useful with TogglComunityMod - Command or simly when changing the mode via mod-profiler. It allows for fast restart :

alias 6game026start 'while true; cd ~/game/0ad/026/; ./0ad-0.0.26-alpha-2210110407-x86_64_0cdfe6000a403313b99d6ea006a92d81.AppImage; sleep 1; end; '
 

The command sets up an alias in the fish-shell. An alias is a way to create a shorthand or shortcut for a longer command.

  • alias: This is the command to define an alias.
  • 6game026: This is the name of the alias. It is the shorthand you want to use to refer to the longer command.
  • 'while true; ... end; ':
  • The longer command inside the single quotes is a loop that runs indefinitely (while true) and performs the following actions:
  1. cd ~/game/0ad/026/ : Change the current directory to ~/game/0ad/026/ . The ~/ notation represents the user's home directory.
  2. ./0ad-0.0.26-alpha-2210110407-x86_64_0cdfe6000a403313b99d6ea006a92d81.AppImage : Execute the 0ad AppImage

The purpose of this alias is to provide a shortcut command (6game026) that allows for easy and infinite execution of the game. To stop the game, you will need to terminate the terminal session.

useful with TogglComunityMod - Command or simly when changing the mode via mod-profiler.

Bash-Style enless loops ( not tested ):

alias 6game026='while true; do cd ~/game/0ad/026/ && ./0ad-0.0.26-alpha-2210110407-x86_64_0cdfe6000a403313b99d6ea006a92d81.AppImage; sleep 1; done'
 

for windows users ( not tested !!! ):

@echo off
:loop
cd /d C:\path\to\game\0ad\026
start "" 0ad-0.0.26-alpha-2210110407-x86_64_0cdfe6000a403313b99d6ea006a92d81.AppImage
timeout /t 1 >nul
goto loop
Link to comment
Share on other sites

  • 4 weeks later...

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...