Talk:RLV Viewer Titler

From Second Life Wiki
Revision as of 07:26, 13 November 2012 by Jenna Felton (talk | contribs) (Removed typos)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

First, thank you again Kireji for taking time to change my script in means of improving it. Ok, this time the part of changes seems to be reasonable, so i left that par of code and not reverted completely like in the Script Vitality plug-in.

As i told in the discussion page to the vitality plugin, placing the '{' char in the new line breaks my hand writing and readability to me, so i reverted this. Also i do not understand why replacing 0.0 by (float)FALSE and 1.0 by (float)TRUE makes sense. The timer and text alpha expect a float, casting a boolean to float is rather irritating. Reverted this, too.

The order of event handler i changed back. The state_entry() event handler is definitely called as first when the script state load, hence i moved the state_entry back to beginning. Anyway, the order or using states in compiled code has no relevance for the compiled code and the VM.

I left the function and tagged it by your name, so the reader knows what you added. Outsourcing code into a function is generally a nice idea, but the script is not final, the user may want to remove the events, than the function may become called from a single place, than it increases the used code. However, i left the function because it is called three times in this concrete script version.

And i made some testing. I ran the original code (March 2012) in the Object called "Original" and the modified code (October 2012) in the object "Modified". Additionally the Viewer (RLV-able) was set to debug RLV messages. Here is the output:

Initializing the code (script saved in the prim)

[13:23]  Original: init::UsedMem = 12308
[13:23]  Original: detecting viewer...
[13:23]  Original executes: @version=1055378
[13:23]  Original: listen::UsedMem = 12766

[13:24]  Modified: init::UsedMem = 12336
[13:24]  Modified: detecting viewer...
[13:24]  Modified executes: @version=1097007
[13:24]  Modified: listen::UsedMem = 12766

Prim taken in inventory and rezzed again.

[13:25]  Original: onrez::UsedMem = 12392
[13:25]  Original: detecting viewer...
[13:25]  Original executes: @version=1094945
[13:25]  Original: listen::UsedMem = 12846

[13:25]  Modified: onrez::UsedMem = 12416
[13:25]  Modified: detecting viewer...
[13:25]  Modified executes: @version=1086894
[13:25]  Modified: listen::UsedMem = 12846

I do not see the memory being saved. In opposite, using a function seems to increase the memory usage a bit. Anyway, i left the function in the code. However, changing other's authors scripts is ok, but not without commenting what was changed and by whom. The history subpage is not a grant the reader will read it.