6655c30e8ae09

6655c30e8b3f5
1 Guest is here.
 

6655c30e8b8fddp_flint

6655c30e8b962
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.

6655c30e8bb16ZylonBane

6655c30e8bb6b
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.
...but I’m sure you know best
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6655c30e8bc6b