Reaper Grimm
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > SetCallback..?
 
Author
All times are GMT. The time now is 22:13. Post New Thread    Post A Reply
Mordeth
Administrator


Posts: 1704
Registered: 05-00


In Eternity's default start map, there's a function that allows for a "sliding door" trick:

code:
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?

Old Post 05-09-06 16:28 #
Mordeth is offline Profile || Blog || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00


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.

Old Post 05-09-06 20:32 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Mordeth
Administrator


Posts: 1704
Registered: 05-00



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.

Old Post 05-10-06 09:03 #
Mordeth is offline Profile || Blog || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00


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.

Old Post 05-10-06 15:00 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
All times are GMT. The time now is 22:13. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > SetCallback..?

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory