Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
Re: [Freeciv-Dev] Scripting language
Home

Re: [Freeciv-Dev] Scripting language

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: abies@xxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Scripting language
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Mon, 9 Aug 1999 13:18:12 +1000 (EST)

Artur Biesiadowski wrote:

> See my post on building rulesets. For now ruleset for building would
> look like
> 
> [hydro_plant]

Actually to match new ruleset styles this would be more like:
  [building_hydro_plant]
and non-number values would be as strings.

> name="Hydro Plant"
> cost=240
> ..
> need_building=none
> special_condition=RIVER_OR_MOUNTAIN_NEAR_CITY

Why not 
    required_terrain = "River", "Mountains"

(implied OR) and then you also should be able to handle 
coastal buildings (Harbour etc) simply by:

    required_terrain = "Ocean"

Here the strings would be matched to terrain/special names 
from the terrain ruleset.  (Need specials to cover S_RIVER 
as well as T_RIVER...(?))

> With scripting language we could do something like
> 
> condition RIVER_OR_MOUNTAIN_NEAR_CITY
> {
>       return city_has_terrain_near(city,RIVER) ||
>               city_has_terrain_near(city,MOUNTAIN);
> }
> 
> With scripting language possibilities are a lot greater - effects of
> building could be scripted - so citywall would have
> 
> {
>       modify_defence(city, 50);
> }

But then you still need to have something which implements
city_has_terrain_near() and modify_defence() ?
I think we can get reasonably general, and easier to
implement, just by having a largish number of fields
and flags.

Regards,
-- David

[Prev in Thread] Current Thread [Next in Thread]