OLYMPIA: New command ideas From: morrow@gandalf.rutgers.edu (John Morrow) Date: Thu, 07 Jul 1994 01:42:14 +0000 I have a proposal for two additional commands for Olympia. In part, I want to know if this is too complicated. I'm also trying to avoid proposing a full-blown programming language here, making this as easy to implement as possible. If you like the IF idea but hate the SKIP idea, also let me know... John Morrow Note: While these are written up as Olympia commands, they are *NOT* implemented, so don't try to use them. --------------------------------------------------------------------------- IF <conditions> time: 0 days priority: 1 --------------------------------------------------------------------------- Perform the next command if any of the specified conditions are true. If none of the specified conditions are true, then skip the next command. The following conditions may be tested: day n True if the day of the month is n unit n True if the character and the specified unit are in the same location ship n True if the specified ship is in port loc n True if the character is in location n gold n True if the character has at least n gold item n q True if the character has at least quantity q of item n stack n True if the character and unit n are in the same stack. Position within the stack is not important; The condition is true whenever n and the character share a common stack leader. top True if the unit is the stack leader. flag f [n] True until character n, or a character belonging to player n, has signaled with flag f. n defaults to the player issuing the flag order. If n is zero, it is true if any character signals with flag f. See the FLAG command for more details. ferry <n> True if ship n has sounded its horn with the FERRY order. terr n True if the current location is is terrain type n. land n True if there is a non-ocean province in direction n. Example 1: If a1a is present. IF unit a1a MOVE east MOVE west 1: > if unit a1a 1: If successful: unit a1a is present 1: > move east 1: Travel to Plains [aa02] will take seven days. Example 2: If a1a is not present. IF unit a1a MOVE east MOVE west 1: > if unit a1a 1: If failed: no conditions are true 1: > move west 1: Travel to Forest [aa00] will take seven days. Note: The terr option is intended for use looking for appropriate terrain to perform an activity (e.g. looking for forests to harvest wood) and the land option is intended for use looking for islands or continents while sailing at sea. --------------------------------------------------------------------------- SKIP <number> time: 0 days priority: 1 --------------------------------------------------------------------------- Skip over the next number of commands. For example: SKIP 2 PAY a1a 15 PAY a1b 20 MOVE west 1: > skip 2 1: Skipping 2 commands. 1: > move west 1: Travel to Forest [aa00] will take seven days. This command is intended for use with the IF command to allow for more complicated decision making structures. See the IF command. For example: An example of an "if-else" type structure. IF terr forest SKIP 2 MOVE west SKIP 1 COLLECT 77 0 10 MOVE north If the unit's location is a forest, this sequence would execute as: 1: > if terr forest 1: If successful: local terrain is of type forest. 1: > skip 2 1: Skipping 2 commands. 1: > collect 77 0 10 1: Spending 10 days collecting wood [77]. ... 10: Collected 10 units of wood [77]. 11: > move north If the unit's location isn't a forest, this sequence would execute as: 1: > if terr forest 1: If failed: no conditions are true 1: > move west 1: Travel to Forest [aa00] will take seven days. 7: Arrival at Forest [aa00]. 8: > skip 1 8: Skipping 1 command. 8: > move north --------------------------------------------------------------------------- Referenced By Up