arelim wrote: ... a simple situation where you want the actions output to pick between blue, green, or red and you want it to pick one randomly each time the task is executed but not pick the same one twice in a row ... this could probably be done in adrift but it would be A LOT easier to do and learn how to do in inform. In inform its just [one of]blue[or]green[or]red[at random] ... with adrift I can't even think of how this might be done.
That would be OneOf("blue", "green", "red") in ADRIFT.
Note the underlined words. ADRIFT is as likely to do "red, red, red" as it is to do "red, blue, green". The Inform expression is guaranteed not to show "red, red, red".
Inform can pick from a list "at random" (as above, no repeats), "purely at random" (what ADRIFT does), "in random order" (don't show any a second time until all have been shown at least once, don't show any a third time until all have been shown twice, and so on.), and more. If what is listed doesn't quite fill your needs, an author can define similar rules. (Though defining new "say one of" rules does require dropping down to I6.)
ralphmerridew wrote:Maybe you want to affect which objects are listed in some circumstances (the player character will simply filter out less important objects), or you want to have objects listed in a particular order. These sorts of things are easy enough to do in Inform, but rather difficult in ADRIFT. (You could do them with lots of text substitution rules, but that's very error-prone, and scales poorly.)
Filtering objects in ADRIFT is dead easy, for example %objects%.Drinkable will filter a list of objects so that only the ones that you can drink are printed.
- adrift Code: Select all
Every object has a number called price. The price of an object is usually 0.
Definition: an object is valuable if the price of it is greater than 0.
Every turn: if the player can see a valuable thing, say "You notice [list of valuable visible things]."
(You'll also have to add some objects and define their prices.)
The listing in a specific order can be done lots of ways, the simplest would be to use actions to call the printing task once for each possible object (in the order you want to print them) and use a restriction to check if its in the list you want to print.
A more generic method would be to give each object an ID number as a property, then call a task (with list of objects as parameter) which calls another task (again passing the full list of objects), and use a counter variable to keep track of which object to print next.
Call the printing task once for each object in the order you want to print them... How are you doing this?
- adrift Code: Select all
if the player can see a valuable thing:
Let treasures be the list of valuable visible things;
sort treasures in price order;
say "Your senses detect [treasures]."
ralphmerridew wrote:When ADRIFT doesn't quite do what you want, you may be out of luck.
Lazzah: The I7 manual has 400+ examples. How many of them could you do in ADRIFT? How well would things scale? (No need to do all 400. Maybe look at every 20th example.)
I am actively developing several libraries for ADRIFT, everything from vehicles that drive along roads, multi-floor elevators and currency systems to a full layered clothing system.[/quote]
Nice to hear, but most of those would be incidental in I7. I remember seeing an extension to do a currency system for Inform 5; I put a two-floor elevator into my Automap example just to demonstrate a room that can be moved on the automap. The layered clothing system would require effort, but there's one done as an example in http://inform7.com/learn/man/Rex426.html#e426u
(Layered clothing has a lot of potential subtleties, depending on how accurate of a simulation the author wants.)
I have yet to find something that I can't do.
Try porting Balances ( http://ifdb.tads.org/viewgame?id=x6ne0bbd2oqm6h3a
), in particular the little white cubes. (Inform 6 source available at http://ifarchive.org/if-archive/games/s ... lances.inf
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier