6649023f70184

6649023f706c6
1 Guest is here.
 

6649023f70aeadp_flint

6649023f70b63
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.

6649023f70d50ZylonBane

6649023f70da8
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.
I might come across very disillusioned but I do crossword searches all night.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6649023f70eb2