I have used the on("change: event many times. I was always able to use the previous values (before the change) as well as the new values. I am now setting up a script that would be much more resource efficient if it could detect the difference between players re-arranging their cards and changing the cards they have. That is why I wanted to compare the hand they have now with the previous hand - but I always get the value of prev["_currentHand"] as undefined. is this a bug? am I doing something wrong? Here is my code, abridged. on("ready", function() {
"use strict";
on("change:hand", function(obj, prev) {
sendChat("CardsEquipment","/w gm Hand changed!");
var playerWithHand = findObjs({_type: "player", _id: obj.get("_parentid")})[0];
var charactersControlledByPlayer = findObjs({_type: "character", controlledby: obj.get("_parentid")});
[code hidden for forum post]
var currentHand = [];
var currentHandStringLeft = obj.get("_currentHand");
// prev["_currentHand"] is always undefined;
// log(currentHandStringLeft);
log(obj.get("_currentHand"));
log(prev["_currentHand"]); [rest of code hidden from froum post]