Jump to content

Sublime Text (possibly othere external editors) And Viewer Crash or Involuntary Logout


You are about to reply to a thread that has been inactive for 1525 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

I am using Sublime text to edit in-world scripts and notecards.

First, I have observed that unlike a notecard with gets a new UUID each time is is modified and saved it seems scripts always have the same UUID, is this observation correct?

Second, the issue: Assume I have made changes to a script in Sublime and not saved it to it's in-world version because the changes are such as to not allow a clean compile. Now the viewer crashes or I get logged out of SL from some reason (this happened last night due to some region difficulties). Now I can safe the version in Sublime (with the weird UUID-based filename to a weird temp place on disk. But, when I restart the viewer and log in and open the script in-world I cannot save the Sublime version to the in-world version, the connection appears to have have survived the viewer restart. AND, if I click 'Edit' on the in-world version it will overwrite all the changes in the Sublime version (which is dangerous behavior).

 

The only solution I have found so far is to copy the Sublime version,  paste it over the in-world, click 'Save' (which, although it does not compile still saves it), close the file in Subliime, and click 'Edit'

Any ideas on a cleaner workflow?

Anyone know Sublime well enough to suggest an option to keep the truth copy of the script on my system (MacOS) instead of in-world.

 

 

BTW, while writing this and doing some testing I discovered a workaround. If I save a script from Sublime that will not compile it does actually get saved in-world with all the errors. So, I'll keep saving often even when making non-compilable changes. The in-world version will then be mostly up-to-date if the viewer crashes or I get logged out.

I don't like this workaround cause I often forget to save (I use auto-save on all tools that support it).

Thanks,

G

 

Posted

All second life assets are immutable. Even scripts. Saving a script creates a new script.

The fact that you cannot save a local-file script after a logout is expected behavior. You'll find that the same thing happens if you simply close the inworld script editor and try opening it again. This is because the viewer stops looking for updates on the file if the editor is closed, until you click the button to open the script externally again.

1 hour ago, GManB said:

The only solution I have found so far is to copy the Sublime version,  paste it over the in-world, click 'Save' (which, although it does not compile still saves it), close the file in Subliime, and click 'Edit'

Any ideas on a cleaner workflow?

Only this: Copy the Sublime Text version, paste it into the inworld script editor, and immediately click the "open externally" button. The script will be saved automatically.

Posted
1 hour ago, Wulfie Reanimator said:

All second life assets are immutable. Even scripts. Saving a script creates a new script.

Wulfie, I am not seeing this for scripts.

  • create a new script, 'Test Script'
  • double click on it in Inventory to open in-world
  • click 'Edit' to open in Sublime Test (ST)
  • the file on disk is /private/var/folders/_v/vdj2_b7j51x295f8g0nrc2080000gn/T/sl_script_aa42bbcc13ecaf0cd475b5de99afb1a1.lsl
    • I assume that between '....script_' and '.lsl' is the UUID of this asset (the script, Test Script I just created.
  • Make some changes in SL and save Command-S
  • changes appear in the in-world window with Test Script in it.
  • close ST
  • close in-world window with Test Script
  • double-click on Test Script in Inventory to open it in-world
    • all changes are still there, which is normal
  • click 'Edit' to open in ST
  • the file on disk is /private/var/folders/_v/vdj2_b7j51x295f8g0nrc2080000gn/T/sl_script_aa42bbcc13ecaf0cd475b5de99afb1a1.lsl
    • same as before
  • if we make the assumption that the UUID of the asset is aa42bbcc13ecaf0cd475b5de99afb1a1, then it seems that the asset isn't immutable

This leads to two outcomes, either the asset is immutable as you say and aa42bbcc13ecaf0cd475b5de99afb1a1 is just some temp ID that SL uses for this file or aa42bbcc13ecaf0cd475b5de99afb1a1is the UUID and the asset is mutable.

 

I just thought of a way to test some of this..

  • closed everyting
  • renamed script
  • open in-world
  • Edit
  • name in ST still have aa42bbcc13ecaf0cd475b5de99afb1a1 in it.

So, if the script is immutable and new versions get new UUIDs then what is aa42bbcc13ecaf0cd475b5de99afb1a1? and what binds aa42bbcc13ecaf0cd475b5de99afb1a1 to the script? UUID changes and name changes yet aa42bbcc13ecaf0cd475b5de99afb1a1 sill remains in the name given to ST???

 

G

 

 

Posted (edited)
23 minutes ago, GManB said:
2 hours ago, Wulfie Reanimator said:

All second life assets are immutable. Even scripts. Saving a script creates a new script.

Wulfie, I am not seeing this for scripts.

This wiki page might explain things somewhat: http://wiki.secondlife.com/wiki/UUID

Here, run this script in-world:

keys(integer type)
{
    integer i = 0;
    while (i < llGetInventoryNumber(type))
    {
        string name = llGetInventoryName(type, i);
        llOwnerSay(llGetInventoryKey(name));
        ++i;
    }
}

default
{
    state_entry()
    {
        keys(INVENTORY_SCRIPT);
    }

    touch_start(integer total_number)
    {
        keys(INVENTORY_SCRIPT);
    }
}

Then restart it. Then restart it again. You'll get the same output every time.
Then save it. Then save it again. You'll get a different output every time.

23 minutes ago, GManB said:

So, if the script is immutable and new versions get new UUIDs then what is aa42bbcc13ecaf0cd475b5de99afb1a1? and what binds aa42bbcc13ecaf0cd475b5de99afb1a1 to the script? UUID changes and name changes yet aa42bbcc13ecaf0cd475b5de99afb1a1 sill remains in the name given to ST???

Dunno.

Edited by Wulfie Reanimator
Posted
58 minutes ago, GManB said:

I assume that between '....script_' and '.lsl' is the UUID of this asset (the script, Test Script I just created.

Not necessarily an SL UUID, Sublime might create UUID's of it's own for identifying assets it saves out to disk

Posted
43 minutes ago, Wulfie Reanimator said:

 

Then restart it. Then restart it again. You'll get the same output every time.
Then save it. Then save it again. You'll get a different output every time.

Things are getting interesting. If I:

  • rez a cube
  • click new script in contents
  • paste in your script
  • execute it
  • save it

I get, as you say, different output after each save

HOWEVER, if:

  • in the 'Scripts' direction in Inventory I right-click and choose, 'New Script'
  • open in in-world
  • paste in your script
  • save it
  • rez a cube
  • drag the script from Inventory into the Contents of the cube
  • execute it
  • make a change
  • save it
  • execute it
  • make another change
  • save it
  • execute it

I get the SAME output after each save. Please try it to make sure I am not nuts :)

So, if you can replicate my test results we can say that once a script is in Inventory AND (although this isn't tested so far) is in the Contents of and Object then it IS immutable, i.e., it's UUID stays the same through changes and saves.

G

Posted
10 minutes ago, Profaitchikenz Haiku said:

Not necessarily an SL UUID, Sublime might create UUID's of it's own for identifying assets it saves out to disk

Ah, interesting... could very well be... I wonder what 'name' SL/Firestorm is giving the external editor?

G

Posted (edited)
16 minutes ago, GManB said:

HOWEVER, if:

  • in the 'Scripts' direction in Inventory I right-click and choose, 'New Script'
  • open in in-world
  • paste in your script
  • save it
  • rez a cube
  • drag the script from Inventory into the Contents of the cube
  • execute it
  • make a change
  • save it
  • execute it
  • make another change
  • save it
  • execute it

I get the SAME output after each save. Please try it to make sure I am not nuts :)

Either I'm doing something wrong, or you are, because I'm still getting different keys after the script recompiles. (I'm using the LSL Preprocessor built into Firestorm, which gives me the "Recompile" button. It just forces the script to be saved even if no changes were made.)

16 minutes ago, GManB said:

So, if you can replicate my test results we can say that once a script is in Inventory AND (although this isn't tested so far) is in the Contents of and Object then it IS immutable, i.e., it's UUID stays the same through changes and saves.

An immutable asset is one that is unique and unchanging in any way. One asset ID, one set of data.

If the contents of an asset can change (for example, the script gets modified but it keeps its asset UUID), it would be mutable.

Edited by Wulfie Reanimator
Posted

Hmmm The changes I made were in '//' comments so a recompile would not technically be necessary on the save but how  would the system know that except to recompile. I will try again with substantive changes.

G

Posted

At first I got the same UUID even with substantive changes.

However, after I closed the script window and re-opened it I would get a new UUID after each save (substantive or not).

I read something in the UUID info page about modified assets not getting new UUIDs until they are derezzed or taken.

BTW, I tried launching the external editor from the SL viewer and see filenames of the same form.

 

G

You are about to reply to a thread that has been inactive for 1525 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...