Mordeth Posted May 9, 2006 In Eternity's default start map, there's a function that allows for a "sliding door" trick: public SDoorCB() { static tag = 15; SectorSetSpecial(2048, tag); FloorAction(false, PlaneUp, FLOORSPEED, FNoChg, tag, 0, FtoLnF); tag += 1; if(tag < 21) SetCallback("SDoorCB", WAIT_DELAY, 1); } Couple of questions about this... firstly, why the use of semi-colons? Thought these are optional for Small. More importantly, why use SetCallback and not eg. a "for" loop? 0 Share this post Link to post
Quasar Posted May 9, 2006 I am accustomed to using semicolons. I frequently use them in EDF also, but usually only with inline definitions because they look better that way. The SetCallback is *not* optional for this effect. If you used a for loop here, all of the sectors would move at once. Instead, they need to move one at a time, one gametic apart. This makes the door appear to slide open very quickly. Of course, with PolyObjects in place, this kind of hackery is now less useful. I will not, however, be updating the start map since it works well enough as-is. 0 Share this post Link to post
Mordeth Posted May 10, 2006 Quasar said: The SetCallback is *not* optional for this effect. If you used a for loop here, all of the sectors would move at once. Instead, they need to move one at a time, one gametic apart. This makes the door appear to slide open very quickly. Ah, because there's no "delay" type pointer, except for the one in that SetCallback function? Ok, I see. 0 Share this post Link to post
Quasar Posted May 10, 2006 Right. Small doesn't support pausing scripts at an arbitrary point (actually it is supposed to, but it is extremely buggy and I decided it was best not to mess with it). Instead, I have added scheduled callbacks, which can ultimately accomplish everything that delays can do, just in a different way. 0 Share this post Link to post