View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,993

Violet CLM has disabled reputation

Dec 12, 2015, 10:32 AM
Violet CLM is offline
Reply With Quote
Okay I created a 256-by-64 level with a start position in the top left corner and a piece of seeker ammo in the bottom right area, at position 252,60. Then I gave it this complete script:
Code:
void onLevelLoad() {
	jjObjectPresets[OBJECT::SEEKERAMMO3].behavior = MyObject;
	jjObjectPresets[OBJECT::SEEKERAMMO3].deactivates = false;
}

void onLevelBegin() {
	ActivateEventAt(252, 60);
}

void MyObject(jjOBJ@ obj) {
	jjAlert("I am active!");
}

jjOBJ@ ActivateEventAt(int xTile, int yTile) {
  if (jjParameterGet(xTile, yTile, -1, 1) == 1)
    return null;
  jjParameterSet(xTile, yTile, -1, 1, 1);
  return jjObjects[jjAddObject(jjEventGet(xTile, yTile), xTile * 32 + 15, yTile * 32 + 15, 0, CREATOR::LEVEL)];
}
I started seeing the "I am active!' alert constantly and it did not shut up, even when I went over to where the event was placed and then went away again. So whatever you're doing wrong is not in the function I gave you.

Are you hosting the level in MP? (Though if you were, I'm not sure why you'd be bothering with this, since the object would be activated anyway.) Boll platforms don't appear in MP servers unless they're set to MP-only....
__________________