Log in

View Full Version : OpenBank(WhichBank: variant; ChangeCompass, ChangeAngle: Boolean): Boolean;



NickMystre
02-16-2012, 01:10 PM
Could someone help me with understanding what these two arguments in the OpenBank function are for ...

1) ChangeCompass
2) ChangeAngle

They are both booleans.

I been staring at bank.simba for too long now, and to be honest - I'm just a little bit annoyed that I can't figure this out.

Put me out of my misery - please ? :)

Kyle Undefined
02-16-2012, 01:36 PM
ChangeCompass will change the direction the compass is facing if you set it to True. ChangeAngle will move the angle up and down if you set it to True.

NickMystre
02-16-2012, 01:46 PM
Thank you Kyle Undefined!

I feel even more challenged now. Looking at ChangeAngle I can now easily see what it does, as SetAngle(SRL_ANGLE_HIGH); is no mystery. :duh:

Does the ChangeCompass boolean introduce some randomness of camera orientation, or is it more to do with the way the referenced bank counters are aligned, and thus make for a more convenient perspective / viewing aspect ?

EDIT: I wish I hadn't asked now, as I feel I've lost a little kudos here. :( So there is such a thing as a dumb question. :)

Kyle Undefined
02-16-2012, 01:52 PM
The way OpenBank works is by looping through all 4 of the bank opening functions until one works or none of them work. ChangeCompass is only used in OpenBankGlass and this is how it changes the compass:


if ChangeCompass then
begin
c := Random(2);
case WhichBank of
'feb', 'fwb', 'veb', 'ctb', 'clt', 'nab': if c = 0 then MakeCompass('N') else MakeCompass('S');
'akb', 'db', 'eb', 'vwb', 'sab', 'ynb', 'sgb', 'wgb', 'fgb': if c = 0 then MakeCompass('E') else MakeCompass('W');
'ngb': if c = 0 then MakeCompass(45) else MakeCompass(225);
end;
end;


So, depending on the bank that is passed in and the c variable that is randomized, it makes the compass angle optimized for that bank.

NickMystre
02-16-2012, 02:13 PM
Again, much appreciated Kyle. Pouring over source code is pretty exhausting to begin with.

Already some things are not as daunting as at first - but it will take a while to be completely comfortable.

One step at a time!