665abbbb85605

665abbbb86038
1 Guest is here.
 

665abbbb86586dp_flint

665abbbb8660b
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.

665abbbb868caZylonBane

665abbbb86925
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.
There's a city in my mind.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
665abbbb879ad