Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Rocco on February 28, 2006, 04:24:31 PM

Title: Special event?
Post by: Rocco on February 28, 2006, 04:24:31 PM
i have an region entity, and in the script for this entity something like:
cup.script

Code: [Select]
on "Use"
{
  phantom.Talk("/ROOM1030/Der ist schon ganz verstaubt, ich lass ihn lieber da stehen.");
}

on "LookAt"
{
  phantom.Talk("/ROOM1031/Ein Reservebecher, falls ich Besuch bekomme.");

}

this is a 'blind' entity - has no relevance for the game.
if i try to combine an item with this, i have a standard comment like - "cannot combine these items"
but i want an standard message only for this special entity for the player trying to combine an item with this entity.
like:

Code: [Select]
on "Use"
{
  phantom.Talk("/ROOM1030/Der ist schon ganz verstaubt, ich lass ihn lieber da stehen.");
}

on "LookAt"
{
  phantom.Talk("/ROOM1031/Ein Reservebecher, falls ich Besuch bekomme.");

}
on "AnyItem"
{
       phantom.Talk("/ROOM1033/This cup is empty and cannot carry this item
}


what can i do here?
Title: Re: Special event?
Post by: odnorf on February 28, 2006, 04:48:48 PM
Actually you got it accidentaly right  ;D

If the "NAME" for the object in the items.items file is "AnyItem" then your example is valid.  ;)
Title: Re: Special event?
Post by: Rocco on February 28, 2006, 09:10:14 PM
its karneval today  ;D

AnyItem means not a specific one, but rather all items the player carry in this situation
Title: Re: Special event?
Post by: Mnemonic on February 28, 2006, 09:46:03 PM
If you are using the default scripts from WME demo/templates, you can use the "default-use" event handler for this purpose. The default game.script uses this event whenever the object cannot handle a specific item.
Title: Re: Special event?
Post by: Rocco on February 28, 2006, 09:58:06 PM
thanks mnemonic, this works for me  ::rock