665c31f12d4de

665c31f12e026
1 Guest is here.
 

665c31f12e482dp_flint

665c31f12e4e7
Hello everyone, I have question about Squirrel script. Where can I look for a full list of functions like OnTurnOn, OnFrobInvEnd and etc.? I checked "API reference messages", but it seems that there are not all examples of these functions. I'm looking for a function which works with inventory items dragging, if such a function exists.

For more details, I want to make a class for some items which makes a sound when you grab an item in inventory by left mouse clicking.

665c31f12e68aZylonBane

665c31f12e6dd
Those look like functions, but under the hood they're actually message listeners. There's no comprehensive list of them because messages can be literally anything. To see all the messages an object is receiving, load NVScript and then put the NVSpy script on it.

The message objects receive when they move in and out of an inventory slot is "Contained". This is documented in API-reference_messages.txt:
Code: [Select]
// Messages: "Contained"
class sContainedScrMsg extends sScrMsg
{
   const eContainsEvent event;
   const ObjID container;
}
Sample script:
Code: [Select]
class inInv extends SqRootScript {
function OnContained() {
print(message().container);
}
}
Acknowledged by: dp_flint
1 Guest is here.
Not everything is known and explained.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
665c31f12e7ec