Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2521) general effects framework
Home

[Freeciv-Dev] Re: (PR#2521) general effects framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2521) general effects framework
From: "rwetmore@xxxxxxxxxxxx via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 11 Dec 2002 19:47:13 -0800
Reply-to: rt@xxxxxxxxxxxxxx

The Civ Fantastic Worlds scenario editor had things like triggers
and a simple scripting language for effects.

For purposes of argument, one might set up duration and event 
classes like

1)  Time Duration: 
    once, every p-turns for n-turns, always for n-turns
2)  Event Triggered:
    on <event>, until <event>, after <event>
3)  Condition Triggered:
    on <cond>, until <cond>, after <cond>

Examples of on <cond> might be the standard 3-wishes, with condition
<cond> being (--wishcount > 0) or after (apollo_is_built()). You have
a number below.

A full system might have a simple data structure like
  { typeID, *args[], *triggerfn, *executefn }
with a few basic canned typeID trigger and execute cases and possibly
a generic set for simple AND/OR rule based composition. The example
of a time limited Shakespeare, maybe.
  SET args {TURNCOUNT=3, UNTIL=Electronics, EFT_MAKE_HAPPY}
  IF (*trigger1)(args) AND (*trigger2)(args)) THEN execute(args)

Note, I'm not suggesting this occur in this round, but if you
structure your current effects in a way that makes such general
scripting or pseudo code effects descriptions easy, it would help a 
lot for a future round.

You may be able to do most of this sort of thing with the current
code, but a pseudo code example of a scenario like the above and
the rough code flow, and/or ruleset data to carry it out would be
a useful tutorial guide at this point.

This sort of stuff is probably part of the current implementation
vocabulary but how does it work and how can it be extended to some 
of the above, maybe?

-;   .range       = range of effect; one of:
-;                    "None", "Building", "City", "Island", "Player", "World"
-;   .amount      = integral AMOUNT parameter for many effects
-;                  (must be in the range -32767 to 32767)
-;   .survives    = 1 if effect survives destruction (wonders only)
-;                  (if unspecified, 0 (doesn't survive) is assumed)
-;   .cond_bldg   = must have this building in same city for effect
-;                  (if unspecified, effect not conditional on building)
-;   .cond_gov    = must be in this government for effect
-;                  (if unspecified, effect not conditional on government)
-;   .cond_adv    = must know this advance for effect
-;                  (if unspecified, effect not conditional on advance)
-;   .cond_eff    = must be affected by this effect for effect
-;                  (if unspecified, effect not conditional on other effect)
-;   .aff_unit    = affects only those units of this class; one of:
-;                    "Air", "Helicopter", "Land", "Missile", "Nuclear", "Sea"
-;                  (if unspecified, may affect units of all classes)
-;   .aff_terr    = affects only those squares of this terrain type
-;                  (if unspecified, may affect all squares; if "None",
-;                   affects no squares (unless aff_spec allows it to))
-;   .aff_spec    = affects only those squares with this special type
-;                  (if unspecified, may affect all squares; if "None",

Cheers,
RossW
=====




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