Difference between revisions of "Message Spam"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Wrye
m (Avoiding Message Spam moved to Message Spam: Shorter, more generic title.)
imported>Wrye
(→‎OBSE Commands: Other commands.)
Line 17: Line 17:


===OBSE Commands===
===OBSE Commands===
As of version 0.15, [[:Category:Oblivion Script Extender|OBSE]] has commands for adding/removing objects that do not generate spam.
OBSE 0015 now provides spam free versions of functions that don't generate messages.
*[[AddItemNS]]
*[[RemoveItemNS]]
*[[EquipItemNS]]
*[[UnequipItemNS]]
*[[AddSpellNS]]
*[[RemoveSpellNS]]


See: [[AddItemNS]], [[RemoveItemNS]]
'''Con:''' Requires that user have OBSE v0.15 or higher installed.


===Temp Container===
===Temp Container===

Revision as of 18:26, 31 May 2008

Tes4 displays messages to the player whenever: 1) spells are added to, 2) items are added to or removed from the player. For some scripts such messages are very undesirable (e.g. for an alchemical sorters which adds/removes many items). Hence, message "spam". There are several techniques for avoiding this spam.

Message Queue Overloading

Simplest technique is to overload the message queue by sending the exact same message twice in a row. I.e.

;--No messages.
message " "
message " "

;--OR... Covering message...
message "[You've been pickpocketed!]"
message "[You've been pickpocketed!]"

There's no obvious reason why this does or should work, but it does. :shrug: The message that is sent (including a blank message) will still display for the usual time, but messages that would ordinarily appear after it seem to be discarded -- i.e. they never enter the queue.

Con: The downside of this approach is that it may block more messages than you want to block. It basically nukes the queue for several frames -- any message sent by any script or action during that period will be lost.

OBSE Commands

OBSE 0015 now provides spam free versions of functions that don't generate messages.

Con: Requires that user have OBSE v0.15 or higher installed.

Temp Container

When adding items to the player, spam can be avoided by first adding the item to a container, and then removing the contents from the container to the player. This works because unlike addItem, RemoveAllItems is silent.

tempContainerRef.addItem deathDagger 1
tempContainerRef.removeAllItems player 1

If you're using Cobl, you can use cobGenXFerRef for the temporary container -- it's defined for just this sort of use.

Item Activate

When adding items whose "activate" action results in being added to inventory (e.g. armor, but not books), you can use activate in a script.

someItemRef.activate player

Pro/Con: Requires that you have a ref for the item. On the plus side,this means that if you want the player to pick up a specific pre-existing, placed item, you can do that.