Messages

From Wormhole Sci-Fi MUD Homepage

Jump to: navigation, search

Part of the coding knowledge base, by Artoo.

The messages file in wormhole/lib/text contains sets of nine entries, to be displayed when a skill or power is used in combat. The number of the power precedes the entries, which each occupy one line, and the set is terminated with 'M'. For neatness, the entries should be given in the appropriate order.

Example follows:

 87
Your rimefang blasts at $N, through $M and leaves little.~
A giant icicle shoots at you, spreading your guts everywhere.~
A gigantic icicle blasts at $N, leaving little behind it.~
Your rimefang misses $N.~
An icicle shoots at you, but misses.~
An icicle from nowhere flies at $N, but missing $M.~
Your rimefang cuts into $N.~
An icicle hits you in the chest.~
An icicle shoots at $N, hitting $M hard.~
M

This wiki entry is for reference purposes, to help coders when adding new powers to the game. The nine entries in the messages file can be summarised thus:

1st: shown to caster, if the power does enough damage to kill the target.
2nd: shown to victim, if they are killed.
3rd: shown to others in the room, if the victim is killed.
4th: shown to caster, if the power fails for whatever reason.
5th: shown to victim, if the power fails to harm them.
6th: shown to others in the room, if the power fails.
7th: shown to caster, if they hurt (not kill) the target.
8th: shown to victim, if they are hurt but not killed.
9th: shown to others in the room, if the caster hurts the victim.

Note that the ARSS syntax is used in these messages, substituting strings such as names automatically, and you can also use {text^alternative text^another alternative} to give the messages a bit more variety.

Use the special substitution codes to personalise the messages, as follows:

  • $N for the name of the victim
  • $n for the name of the caster (lower case equivalents exist for all these, denoting the caster rather than the victim)
  • $M to display him/her/it instead of naming the victim (and to display himself/herself/itself you would put $Mself in the message)
  • $E for he/she/it
  • $S for his/her/its
  • $o for the short name of the object being used, for skills like backstabbing or throwing a weapon

The same messages file is also used for non-combat powers. For example, this is the entry for the 'instant wolf' power:

 65
$N has come to your call through a wisp of red smoke.~
You have been summoned.~
$N arrives in a puff of red smoke.~
You failed the summoning.~
~
~
~
~   
~
M

Note how a tilde is used to terminate each line, even if it is blank.

Personal tools