SRL Archive - Reflection (Archive)

May 4, 2011


pyroryan

2011-05-04 15:00:31

Switched to using a global var.
From: Harry

Set R_UpdateKill in script to kill when updated. A global var is much smarter than changing parms that almost no one would use and that breaks 100% of scripts.


From: Coh3n
Still call SetupReflection or SetupReflectionEx like your do now, just set R_UpdateKill before calling it:

begin
R_UpdateKill := True; // Terminates script if hooks are outdated
SetupReflection;
end.




Old:
Credits for this update goes to Coh3n.
As a result of adding the ability to not terminate scripts that have color backups when hooks are outdated:
SetupReflectionEx(Update: Boolean) was changed to: SetupReflectionEx(Update, terminate: Boolean).
Script authors will have to choose whether to allow the script to continue running if hooks are outdated. Thats the terminate boolean :).

To maintain old/original behavior: change this in the script (note: update boolean being true is assumed):
SetupReflectionEx(true);
to
SetupReflectionEx(true, true);

Any scripts that depend on this will have to be adjusted accordingly. Thanks :) and sorry for any inconvenience this may have caused.

BraK

2011-05-04 15:10:09

Nice Addittion good to see your still at it. :)

~BraK

pyroryan

2011-05-04 15:13:08

From: BraK
Nice Addittion good to see your still at it. :)

~BraK


Haha, I should have mentioned Coh3n made it.

Edit: There.

Harry

2011-05-04 15:29:41

WHY

WHY MAKE SUCH A HUGE CHANGE

DO YOU NOT BACKPORT STUFF

This is totally unneeded. Use a global var or something. I highly suggest reverting this change.

Coh3n

2011-05-04 15:33:17

From: Harry
WHY

WHY MAKE SUCH A HUGE CHANGE

DO YOU NOT BACKPORT STUFF

This is totally unneeded. Use a global var or something. I highly suggest reverting this change.

Lol I wouldn't consider this a huge change at all. This makes much more sense than having a global variable, especially when nothing was changed in SetupReflection, which, I assume, is the setup function that most scripts use (or should be using).

pyroryan

2011-05-04 15:34:43

Where is Java's deprecation functions? :D

Home

2011-05-04 15:38:26

From: Harry
WHY

WHY MAKE SUCH A HUGE CHANGE

DO YOU NOT BACKPORT STUFF

This is totally unneeded. Use a global var or something. I highly suggest reverting this change.


I agree totally with Harry.

Nothing else to say.

~Home

Harry

2011-05-04 15:40:55

From: Coh3n
Lol I wouldn't consider this a huge change at all. This makes much more sense than having a global variable, especially when nothing was changed in SetupReflection, which, I assume, is the setup function that most scripts use (or should be using).

Break 100% of scripts? Lol, ok.

I made a global var and hopefully it'll be commited. Set R_UpdateKill in script to kill when updated. A global var is much smarter than changing parms that almost no one would use and that breaks 100% of scripts.

pyroryan

2011-05-04 15:41:13

Reversed and switched to global var.

Coh3n

2011-05-04 15:42:59

From: Harry
Break 100% of scripts? Lol, ok.

I made a global var and hopefully it'll be commited. Set R_UpdateKill in script to kill when updated. A global var is much smarter than changing parms that almost no one would use and that breaks 100% of scripts.

How does it break 100% of scripts? If EVERY script uses SetupReflectionEx rather than SetupReflection, then my mistake, but you may as well get rid of SetupReflection then.

Harry

2011-05-04 15:45:51

From: Coh3n
How does it break 100% of scripts? If EVERY script uses SetupReflectionEx rather than SetupReflection, then my mistake, but you may as well get rid of SetupReflection then.

You know what I mean.

Changing any sort of parms for stuff (especially core items) should be avoided at all costs. I am sure you know this.

You could say I am biased because I don't want to have to update every single script I have, but also because it would make most public scripts using reflection fail to compile. Useless work.

Coh3n

2011-05-04 15:47:12

From: Harry
You know what I mean.

Changing any sort of parms for stuff (especially core items) should be avoided at all costs. I am sure you know this.

Of course, but I didn't think SetupReflectionEx was used as much as it actually is I guess. I just assumed everyone used SetupReflection.

Rich

2011-05-04 15:53:33

This is the same as what I posted in the other thread isn't it?

Coh3n

2011-05-04 15:54:27

From: Rich
This is the same as what I posted in the other thread isn't it?

Basically, yeah.

Gu3st...

2011-05-04 16:18:54

I disagree with Harry, so what if the scripts using SetupReflectionEx break? SetupReflectionEx was made so that changes to the reflection setup function wouldn't break every script using reflection… If you use SetupReflectionEx then you should be aware of possible changes made to it.

Why don't we make a SetupReflectionExEx procedure?
procedure SetupReflectionExEx(Update, Terminate : Boolean);
begin
...
end;

procedure SetupReflectionEx(Update : Boolean);
begin
SetupReflectionExEx(Update, True);
end;

procedure SetupReflection;
begin
SetupReflectionEx(True);
end;
(I'm being sarcastic now, for those that might miss it)

Yago

2011-05-04 16:23:09

What is this exactly? What does it fix/break?

Coh3n

2011-05-04 16:23:42

From: Yago
What is this exactly? What does it fix/break?

It allows scripters to choose whether they want the script to terminate if the hooks are outdated.

Yago

2011-05-04 16:30:07

From: Coh3n
It allows scripters to choose whether they want the script to terminate if the hooks are outdated.


OK. So instead of using SetupReflectionEx which does it automatically, use R_UpdateKill to choose?

Coh3n

2011-05-04 16:32:13

From: Yago
OK. So instead of using SetupReflectionEx which does it automatically, use R_UpdateKill to choose?

Still call SetupReflection or SetupReflectionEx like your do now, just set R_UpdateKill before calling it:

begin
R_UpdateKill := True; // Terminates script if hooks are outdated
SetupReflection;
end.

Yago

2011-05-04 16:34:18

From: Coh3n
Still call SetupReflection or SetupReflectionEx like your do now, just set R_UpdateKill before calling it:

begin
R_UpdateKill := True; // Terminates script if hooks are outdated
SetupReflection;
end.


Alright thanks. Got it.

Rich

2011-05-04 16:49:48

If the user doesn't set it, then the default would be false, running on outdated hooks, which is the opposite the default now. You should add R_UpdateKill:= True; in SetupReflectionEx so the default is the same. If the user is to set it, in their own scripts, they should set it after SetupReflection is called.

Harry

2011-05-04 17:13:40

From: Rich
If the user doesn't set it, then the default would be false, running on outdated hooks, which is the opposite the default now. You should add R_UpdateKill:= True; in SetupReflectionEx so the default is the same. If the user is to set it, in their own scripts, they should set it after SetupReflection is called.

Yeah you're right, sorta. R_UpdateKill ==> R_UpdateContinue or something like that would work? Yeah I failed at the logic there.

Rich

2011-05-04 17:19:02

From: Harry
Yeah you're right, sorta. R_UpdateKill ==> R_UpdateContinue or something like that would work? Yeah I failed at the logic there.
Yeh. Change the coding or change the var name.

Sex

2011-05-04 18:18:34

From: Zyt3x
I disagree with Harry, so what if the scripts using SetupReflectionEx break? SetupReflectionEx was made so that changes to the reflection setup function wouldn't break every script using reflection… If you use SetupReflectionEx then you should be aware of possible changes made to it.

Why don't we make a SetupReflectionExEx procedure?
Simba Code:
[LEFT]procedure SetupReflectionExEx(Update, Terminate : Boolean);
begin
…
end;

procedure SetupReflectionEx(Update : Boolean);
begin
SetupReflectionExEx(Update, True);
end;

procedure SetupReflection;
begin
SetupReflectionEx(True);
end;
[/LEFT]

(I'm being sarcastic now, for those that might miss it)
I must say I completely agree with that suggestion!

footballjds

2011-05-05 14:53:09

From: Harry
Yeah you're right, sorta. R_UpdateKill ==> R_UpdateContinue or something like that would work? Yeah I failed at the logic there.


it'd be nice to keep the logic the same.
imo r_updateKill is set to false but the default before was it would kill on an update fial.