Help with DX: Revision

Dedicated to the discussion of OTP and Deus Ex in general.

Moderators: Master_Kale, TNM Team

User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Help with DX: Revision

Post by Jonas »

bjorn98009_91 wrote:But can't I write super(missionscript).timer(); also? And cut out the middleman in that function aswell?
You can.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: Help with DX: Revision

Post by bjorn98009_91 »

Still is it super(missionscript) or super(revisionmissionscript06)?
Producer and Quality Assurance Manager for Deus Ex: Revision.
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Help with DX: Revision

Post by DDL »

Super(revisionmissionscript06) would be bad: you'd be calling a function from within itself == infinite loop.

Essentially, super.whatever() just calls function whatever() in whichever class your class (the child) is directly extended from (the parent), so you'll then get everything in whatever() in the parent class (which often itself has super.whatever() statements so it propagates up the class heirarchy), and also everything in your own whatever().

If, however, you had duplicated stuff in the parent's whatever() (for example, taking the entire function, and changing some stuff in the middle), then you might not want to directly super.whatever, as then you'd be doing stuff twice per call.

So super(missionscript).whatever() tells the code to skip straight to function whatever() in missionscript, avoiding any code in mission06's whatever().

And you can do this all the way up to actor (and sometimes even object), if you wanted to (but you shouldn't, coz here it would break stuff).

Erm..does that make any sense?
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: Help with DX: Revision

Post by bjorn98009_91 »

Oh, I see. :) And the original Mission06 called its parent firstframe, ie. Mission06 called firstframe in missionscript.

Now, if I do super.firstframe() I'll be calling Mission06 which in turn will be calling Missionscript.

I now know what you are getting at.

Thanks for all the help! :P
Producer and Quality Assurance Manager for Deus Ex: Revision.
Post Reply