665c02368b795

665c02368c136
1 Guest is here.
 

665c02368c5dfdp_flint

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

665c02368c7e9ZylonBane

665c02368c83a
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.
What's this?! Gloria is lying very still upon the gazebo floor.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
665c02368d646