Material extraction no longer works?

Hans Ronne hronne@comhem.se
Sat Dec 6 17:39:00 GMT 2003


>I was just working on a new module (actually a test module), and noticed
>that the code for extracting materials from independent units no longer
>seems to work.  In ancient-days.g, for example, if I select a villager,
>then click on an adjacent unit that produces some material (e.g. a berry
>bush), nothing happens.  Until recently, the selected unit would extract
>whatever materials it could from the unit I clicked on, then would
>unload them at the nearest supply point (in ancient-days.g, a village).
>
>bolodd2.g also uses the extraction code, but only when the centipede (a
>level 5 unit) collects scrap metal from wrecks.  Since that game tends
>to run a while before reaching that level, I have not yet been able to
>see if it still works there.
>
>
>Could this have something to do with the recent changes to the supply
>code?

Indeed. This is something I did on purpose. From check_extract_action:

    /* Then look for extraction from independent unit provided that there
    is no independent side that owns these units. This breaks the one game
    that uses explicit extraction, ancient-days, but prevents the absurd
    case where a unit is using units belonging to another side (indepside)
    to resupply itself. Possible fix for ancient-days: let berry bushes etc.
    be independent, set no-indepside-ingame to true, and let live animals
    belong to a third side. */
    if (g_no_indepside_ingame()) {
	    for_all_stack(x, y, stack_unit) {
		if (in_play(stack_unit)
		    && indep(stack_unit)
		    && stack_unit->supply[m] > 0) {
    			found += stack_unit->supply[m];
		}
	    }
    }

Perhaps you could try the solution I had in mind for the ancient-days game,
i.e. to let your berry bushes (or whatever) be independent, set
no-indepside-ingame to true, and let a third side run other independent
units, if necessary.

Hans




More information about the Xconq7 mailing list