- Posts: 849
- Thank you received: 170
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please read the above. I mean, really read it. It tells you the name of the parameters.void act(const char *str, int hide_invisible, struct char_data *ch,
struct obj_data *obj, const void *vict_obj, int type)
str: This is the basic string, a null terminated character array, including
control characters (see section 1.4 on ‘Control Characters’), to be sent to
characters designated by the targets.
hide_invisible: A TRUE or FALSE value indicating whether or not to hide the
entire output from any characters that cannot see the “performing character”.
ch: The “performing character”. This is the character that the output string
is associated with. The character is used to determine the room for the output
of the action in question.
obj: An object (an actual item – obj_data) used in the course of the action.
vict_obj: This can be either a character involved in the action, another
object, or even a predefined string of text.
type: One of TO_VICT, TO_CHAR, TO_NOTVICT, or TO_ROOM. This indicates who it
is to be targeted at.
1.3 The Parameters
Of the various parameters passed to the act() function, the str is the most
important, as it is the basis for the actual final output. If this parameter
is a null-pointer or points to a null-character, then the function returns
immediately. The next important parameter is the ch parameter. This, as
mentioned, points to the central character associated with the output string
and action.
obj is an object of type struct obj_data *that is passed to the function. If
there is no object to pass to the function, then a NULL or 0 should be passed
in this location.
The next parameter vict_objcan be a number of things ranging from a game object
(strcut obj_data *), through to a character (struct char_data *), and even a
null terminated character array (char *).
Do note, however, that obj and vict_obj are both ignored if there is no control
character reference (see section 1.4 ‘Control Characters’) to them and the type
is set to TO_ROOM or TO_CHAR. In these cases, NULL should be supplied as the
input to the function.
The hide_invisible flag dictates whether or not the action output should be
hidden from characters that cannot see ch. If the flag is set to TRUE
(non-zero), then this is the case.
The type determines who the output is to be sent to. There are four options for
this (all defined in comm.h) described below:
TO_ROOM: This sends the output to everybody in the room, except ch.
TO_VICT: This option sends the output to the character pointed to by vict_obj.
In this case, vict_obj must point at a character rather than an object.
TO_NOTVICT: In another case where vict_obj must point to a character. This
sends the output to everybody in the room except ch and vict_obj.
TO_CHAR: Finally, this option sends the output to the ch.
TO_SLEEP: This is a special option that must be combined with one of the above
options. It tells act() that the output is to be sent even to characters that
are sleeping. It is combined with a bitwise ‘or’. i.e. TO_VICT | TO_SLEEP.
When the string has been parsed, it is capitalized and a newline is added.
...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
tbaMUD © 2024