Campbell wrote:Sorry, text replacements don't (yet) work with expressions.
NOW he tells me!
Campbell wrote:Sorry, text replacements don't (yet) work with expressions.
saabie wrote:Here is a quick demo I knocked up.
It has non-repeating random values - Go into the third room and keep pressing the button.
It has a sorted list of objects - Pick up a few things and check your inventory.
It does the check for valuable objects when you enter a room.
Examining an object will give its value (if it has one)
It has a featureless white cube that you can name - use "name cube fred"
Note: This was thrown together quite quickly, so don't expect it to be perfect
I am not saying that ADRIFT is easier or better than I7 when trying to do unusual things with it, I'm only saying that its possible.
Nor am I saying that ADRIFT could not be better, I have lots of outstanding enhancement requests for things I do think need improving.
The examples in my demo above could certainly be easier to do if ADRIFT had direct access to individual list elements, or if there were sorting functions, but it still only took 2 or 3 tasks to do each of the features that were asked for.
saabie wrote:But you can now write your own functions, including replacements for the general functions.ralphmerridew wrote: The code for ADRIFT's "OneOf" function is written in C#, and is stored in Runner. In order to be able to produce a similar function, a person has to be Campbell Wild. Games that require the new OneOf won't work on old versions of Runner
They do have some limitations yes, but you can always use an action to run another task if you need something more complicated.
saabie wrote:Which is the whole point. ADRIFT is not for programmers, its for interactive fiction writers.ralphmerridew wrote: The code for Inform 7's "say one of" is written in Inform, and is stored in the game file. Any capable programmer can write their own tweaks to it.
Its still by far the fastest system for quickly drawing a map of a game world and populating it with objects, and those objects can be doors or lockable containers or beds or chairs or lights that automatically illuminate a dark room when you enter it.
Quite complex interactions can be setup by spending no more than a few seconds ticking boxes on each objects property page.
But the biggest advantage of ADRIFT is that you don't have to stop and think HOW to do something.
In other IF systems you have to type out each function in full on the keyboard, which not only takes longer, but is more error prone.
In ADRIFT if you tick the boxes to make a container that a character can go inside of then you know it will always work first time.
If you need to type in several lines of commands to do the same thing, then it is much more likely that there will be a typo or you have written something the wrong way around, which means a lot more time in testing and debugging.
The more complex features of ADRIFT are not meant for the average user, they are there so that other people can write a library that they can then import into their game, adding more properties that they only need to tick or set to a value.
Other systems do the same thing, people write libraries that add extra features and other people use them, such as the code for Inform 7's "say one of" function.
I'm not sure why ralphmerridew used the I6 demo "Balances" as an example of what I7 can do, but here is the code for the featureless white boxes in that demo.
If "%Player%>Held.Count <= I" is rocket science then I think that makes the above 11-dimensional quantum mechanics
Instead of giving the hamburger to Frank:
say "Frank replies, 'Sorry, I[']m vegan.'";
Instead of giving the bill to Frank:
if Frank can see Joe:
say "Frank angrily shouts, 'How dare you try to bribe me?'";
remove the bill from play;
now Frank is happy;
say "Frank looks around to see if anybody's watching, then quickly slips the bill into his pocket. 'Anything you need, just ask.'";
I'm not arguing about anythingralphmerridew wrote:First, I'm not arguing about which is easier for the newbie.
I didn't know they were supposed toDo the cubes properly coalesce if you give multiple cubes the same name?
That could be duplicated exactly with two or three simple tasks (2 or 3 actions each), but would require enhancement request #18322 to store "current"ralphmerridew wrote:If I7 didn't include sorting functions, then any user could write them.
Straightforward selection sort:[code="inform"]
Let treasures be the list of valuable visible things;
if treasures is not empty:
Let sorted be a list of things;
while treasures is not empty:
let current be entry 1 in treasures;
repeat with tester running through treasures:
if the price of current > price of tester:
now current is tester;
add current to sorted;
remove current from treasures;
say "Your senses manually detect [sorted].";
As I wrote in an earlier post:ralphmerridew wrote:Your sorting code is somewhat brittle:
1) It requires all the objects be listed in restrictions, so it can't be placed into a module and used as-is. (The I7 can be placed in an extension, or just copy-pasted without modification.)
2) If the author adds another object later in the game, then a restriction must be added to the task. (The I7 code will work automatically with whatever objects are in the game.)
3) The order is rather rigid. (In my I7 example, if the price of an object is changed during the game, it will then sort based on the new price. If you use an alphabetical sort, and an object changes names, it'll sort based on the new name.)
There are many ways to do this, but you specifically asked:me wrote: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.
for the quick-and-dirty method, so thats what I put in the demo.ralphmerridew wrote:Call the printing task once for each object in the order you want to print them... How are you doing this?
Nope, as I said, they have their limitations. They are only really meant for simple text replacement such as for language conversions.User-defined functions don't seem that useful, compared to what you can do with custom functions in other languages, but, since you mentioned it:
Can you write a UDF that does the equivalent of OneOf?
The "featureless" can be put in the proper name instead of the descriptor so that it gets overwritten.1) There are four featureless white cubes scattered throughout the game.
2) The player has a magic burin, and can write words on the cubes.
3) If the player writes a word on the cube, then the player can refer to it by that word, and can't refer to it as "featureless".
4) If the player has multiple indistinguishable cube (all featureless or all having the same word), they are listed together (You are carrying ... two featureless white cubes ...); and won't raise disambiguation prompts if they aren't needed. (In other words, if the player has a featureless cube and a cube with a word, then "DROP CUBE" will ask which cube; if the player has two cubes with the same word, and types "DROP CUBE", no prompt will appear.
Why don't you write a little program that converts the XML into something more readable.ADRIFT code is a nuisance to read.
Exporting the game to a module doesn't help much, either.
I agree, so I will not be responding to any further posts to this subject.Lazzah wrote: Hey guys, isn't it about time we wound up all this nit-picking over which system is better than the other? You either like Adrift or you like Inform7...or Quest for that matter. In my opinion, it shouldn't matter WHICH system you use, the quality of the game is what I think is far more important!.
Lazzah wrote:Hey guys, isn't it about time we wound up all this nit-picking over which system is better than the other? You either like Adrift or you like Inform7...or Quest for that matter. In my opinion, it shouldn't matter WHICH system you use, the quality of the game is what I think is far more important!
Po. Prune wrote:Lazzah wrote:Hey guys, isn't it about time we wound up all this nit-picking over which system is better than the other? You either like Adrift or you like Inform7...or Quest for that matter. In my opinion, it shouldn't matter WHICH system you use, the quality of the game is what I think is far more important!
Although I, to a certain degree agree with you Lazzah, I don't think we should wInd up this "Nit-picking"
XSLT should make that pretty easy.saabie wrote:Why don't you write a little program that converts the XML into something more readable.
It should be quite easy to format it to look like TADS (and there may even be existing programs that reformat XML based on a template)
Campbell wrote:Lazzah wrote:As a non-programmer, I have to reluctantly admit that the Inform7 way of doing things looks much more user-friendly than the ADRIFT5 way.
(Sorry Campbell )
If you prefer that way, why not create a Text Override like so, and stick it in your library:
- adrift Code: Select all
Original text: [number of objects held by player]
Replacement text: %Player%.Held.Count
Once you've done that, you'll never have to type the function in again.
Lumin wrote:Not to open this ol' can of worms, but I've used an easier program...it was called ADRIFT 4.0.
Of course there's a lot 5 does that 4 couldn't, but if we're just talking about learning curve the latter wins hands down.
Users browsing this forum: No registered users and 1 guest