I6 Fake actions and object numbers

Just for curiosity’s sake, how does one create a fake action?

Less for curiosity, can one refer to object numbers in the source code? If so, how?

Fake actions are described in chapter 6 of the DM4. However, there’s generally no reason not to create a regular action instead (with an empty ActionSub routine).

Object numbers are just numbers. When you define an object, its name is a symbol that refers to its number.

But what is the name for that property? would it be obj.objnumber? Or what?

And I overlooked that part for creating a fake action. sorry.

Every time you refer to an object, you are referring to the object number.

As an example:

Object redball "Red Ball"; [ main; print (number) redball; new_line; ];

This will print the object number (probably 5). redball == 5, and can be treated in every way as a number.

As another example of this:

Object redball "Red Ball"; [ main x; x = redball - 1; print (name) x; new_line; ];

This will print the name of the object before redball in the object table.

Ohhh… I get it now. Thanks.

And the object number of the ball would be twenty five. here is a complete list of all library generated objects:[rant=Library Objects]one Class
two Object
three Routine
four String
five CompassDirection
six compass
seven north
eight south
nine east
ten west
eleven northeast
twelve northwest
thirteen southeast
fourteen southwest
fifteen up above
sixteen ground
seventeen inside
eighteen outside
nineteen Darkness
twenty yourself
twenty-one (Inform Parser)
twenty-two (Inform Library)
twenty-three (Library Extensions)
twenty-four (LibraryMessages)[/rant]