What value is returned from GetActorCeilingZ(0)?
Are you sure that GetActorCeilingZ is what doesn't work, and that it isn't spawning an actor with the returned value that fails?
I think the Z in Spawn places the lowest point on the actor you're spawning, meaning that you need some room above it if it cannot spawn just anywhere. If it can spawn just anywhere, use [wiki]SpawnForced[/wiki]. Otherwise, subtract the height of the spawned actor, or (height + 1).
Assuming the actor is 10 "units" tall:
Code: Select all
script 985 (void){
MarkX=GetActorX(0);
MarkY=GetActorY(0);
MarkZ=GetActorZ(0);
MarkZCeiling=GetActorCeilingZ(0);
Delay(35*5);
// Then one of the following:
Spawn("AmmoBox_Drop",MarkX,MarkY,MarkZCeiling - 10.0,0); // Option A
Spawn("AmmoBox_Drop",MarkX,MarkY,MarkZCeiling - 11.0,0); // Option B
SpawnForced("AmmoBox_Drop",MarkX,MarkY,MarkZCeiling,0); // Option C
Spawn("AmmoBox_Drop",MarkX,MarkY,MarkZCeiling - (1+ 10.0),0); // Option D, slightly convoluted
}