Full Version : How do I - Display messages
xmlspawner >>XMLSpawner - How do I? >>How do I - Display messages
<< Prev | Next >>
ArteGordon- 01-06-2006
Displaying messages
There are several keywords that allow you to display messages in various ways. These messages can be displayed over particular objects (MSG or SAY keywords), they can be sent to individual players (SENDMSG keyword), or they can be broadcast to the entire shard (BCAST keyword).
Using the MSG keyword to display messages over objects
The MSG keyword can be used to display messages over mobs or items when they are spawned.
The syntax is
MSG[,probability][,hue]/text
the ASCIIMSG keyword is like MSG but uses ascii instead of unicode and supports an optional hue and font argument.
ASCIIMSG[,probability][,hue][,font]/text
So, for example, to spawn a lich that occasionally taunted you, you could use the spawn entry
lich/MSG,.5/All hope is lost/MSG,0.2/you feeble mortal/MSG/hahahahaa
to give you random combinations of messages such as "All hope is lost hahahahaa", or "feeble mortal hahahaha", or just "hahahahaa".
Or the spawn entry
ham/MSG/a tasty morsel
would place the message "a tasty morsel" above the ham when it was spawned.
Note, that because the switch/lever objects also use the same syntax for specifying properties on target items, you can use this keyword in conjunction with those items.
So, for example, you could have a lever that opened a door, and also displayed a message over the door indicating it had opened using the target item property string "/locked/false/MSG/the door magically opens".
You can also use the MSG keyword together with the SET series of keywords such as SETONTRIGMOB, to display messages over specific target objects.
For example, to display a message over the head of a player that triggered a spawner you could use a spawn entry like
SETONTRIGMOB/MSG/You have set off the trap!
To display a message over an object that was already spawned you could use a spawn entry like
SETONSPAWN,1/MSG/Now I'm really angry...
that would display the message over all of the existing spawns in subgroup 1 of the spawner.
To display a message over a specific named item, you could use something like
SET,Mystic Sword,longsword/MSG/The sword begins to glow....
that would display the message over the longsword named "Mystic Sword"
or
SETONMOB,Mr Friendly,Balron/MSG/Ah, lunch is served...
that would display the message over the balron named "Mr Friendly"
Using the SAY keyword to display messages over creatures
The SAY keyword is very similar to the MSG keyword and can be used to display messages over mobs when they are spawned.
The syntax is
SAY[,probability]/text
The difference between the MSG and SAY keywords is that MSG displays ascii, while SAY displays unicode.
Using the SENDMSG keyword
The SENDMSG keyword sends a message to the triggering mob.
The syntax is
SENDASCIIMSG[,hue][,font]/text
This keyword can be used as a standalone keyword (it can be the first and only thing in a spawn entry)
the SENDASCIIMSG keyword that is like SENDMSG but uses ascii instead of unicode and supports an optional hue and font argument.
SENDASCIIMSG[,hue][,font]/text
The image below shows the msgspawner.xml example included in xmlextras.
Using the BCAST keyword
the BCAST keyword sends shardwide messages to all players. The syntax is
BCAST/message
This keyword can be used as a standalone keyword (it can be the first and only thing in a spawn entry)
Oberon- 03-28-2006
Hello all,
i have another (maybye stupid question).
I want spawn NPC wich will triggering a distance from players and when the players will a closer then 3 fields, the NPC will telling some text.
I tryed used all examples from this topic, bud they didnt work.
Have you anybody known solution to this problem yet?
Do you help me please?
(im sorry for my bad english, and i hope, that you wil understand me)
ArteGordon- 03-28-2006

QUOTE (Oberon @ March 28, 2006 09:39 am)
Hello all, i have another (maybye stupid question). I want spawn NPC wich will triggering a distance from players and when the players will a closer then 3 fields, the NPC will telling some text. I tryed used all examples from this topic, bud they didnt work.
Have you anybody known solution to this problem yet?
Do you help me please?
(im sorry for my bad english, and i hope, that you wil understand me)

Set the spawner for the npc with the ProximityRange set to the distance at which you want it to detect players before spawning.
Then you can have an XmlDialog attachment on the npc that handles the conversation set with a ProximityRange of 3 to detect players at a shorter distance.
So spawn the npc like
banker/ATTACH/xmldialog,yournpcfile
where the file named 'yournpcfile.npc' has the dialog that you want and the ProximityRange setting of 3.
You could also just do this with 2 spawners.
One would spawn the npc with a longer ProximityRange setting. Assign the npc to a subgroup.
The second spawner would have a shorter ProximityRange (like 3), and would spawn the entry
SETONSPAWN,npcspawnername,subgroup/SAY/Whatever you want them to say
where 'npcspawner' name would be the name of the spawner for the npc, and 'subgroup' would be the subgroup number that you assigned your npc to.
Oberon- 03-28-2006
Working absolutly perfect
Thank you werry much.