View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,993

Violet CLM has disabled reputation

Dec 11, 2015, 09:19 AM
Violet CLM is offline
Reply With Quote
Seems to me the simplest way would be to place the object somewhere around X tile 32, but have it reposition itself immediately upon creation. Alternatively, I haven't tested this but it looks plausible:
Code:
jjOBJ@ ActivateEventAt(int xTile, int yTile) {
  if (jjParameterGet(xTile, yTile, -1, 1) == 1) //event already activated
    return null;
  jjParameterSet(xTile, yTile, -1, 1, 1); //bit meaning that this event is active
  return jjObjects[jjAddObject(jjEventGet(xTile, yTile), xTile * 32 + 15, yTile * 32 + 15, 0, CREATOR::LEVEL)]; //or it might be + 16 for the position offsets if you want to get it exactly right... I don't remember offhand
}
Either way, you'll want to make sure its jjOBJ::deactivates is false.
__________________