Multiple Layer scripts stored in the scripts folder...

Discuss ideas for new features with other users. To submit feature requests to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Multiple Layer scripts stored in the scripts folder...

Post by heyvern »

Multiple Layer Scripts for one layer

A new folder in the scripts folder called "Layer" or "Layer Scripts". This folder will behave like the tool, utility or menu scripts folder allowing multiple layer scripts to be accessed by an AS file. (Could just use the existing "Utility' script folder as well)

In the AS file there will be the option to type in or select a reference to a layer script inside the Layer Scripts folder.

Steps:

1. Click the layer options button

2. At the bottom along with the "Embedded Script File" check box there would be a text entry box or field. Type in the name or names of any layer script that has been placed in the Layer Script folder inside the scripts folder of the AS application directory. Names of scripts in the layer options layer script text entry field would be separated by a comma or some other delimiter character.

The order of the listing of the layer scripts would determine when they "load" or activate on the layer so they perform actions or load variables in a specific order. For instance one layer script listed first would only contain numerous variables that OTHER layer scripts could use. Or a layer script could hold many common often repeated functions that several other layer scripts could call.

Optional
Or better yet, as an optional feature make the "field" a functioning script entry box. A small text field to enter lua code directly into the layer. This would be a HUGE bonus for testing out simple snippets of code during development.

-----
Optional
The layer script selection in the layer options window could be a menu or text field that lists all the scripts available in the layer scripts folder. This list would be "generated" when AS is launched just like tool and menu scripts. Multiple scripts would be selected in someway by multiple selection in a menu or in some kind of text field. There should be a way to change the order they are loaded when the script runs.

Optional
Global layer scripts. A group or bone layer would have a check box to make the layer script run on all sub layers as well as the parent layer.
-----

Now all functions and features of the scripts entered in the layer scripts field of the layer options will work the same as if an external script file were embedded in that layer.

This feature would make layer scripts behave the same as tool, menu or utility scripts. Instead of only one external linked script file for each layer, any number of scripts could be "linked" to a layer allowing for unlimited layer scripts and also a centralized storage system. All layer scripts would be in one location.

-vern
Last edited by heyvern on Fri Jan 23, 2009 12:23 am, edited 3 times in total.
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

Good idea Vern, that would make the layer scripts much more handy and functional, no more digging around for scripts and moving them.
An open as text or edit and save as function would be cool too. :D
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I just edited the post to include the option to have that text field in the layer options be a working lua entry box. Simple code could be entered directly.

-vern
User avatar
synthsin75
Posts: 10270
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Yeah, I've asked for this before. We definitely need some way to make more of the layer script solutions less mutually exclusive. Many of then shouldn't conflict, or at least the scripters here could let people know which ones may not be compatible (i.e. wanting to operate on the same things).
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I think my solution above is PERFECT if I do say so myself. It's just like the other tools. Layer scripts would behave just like the other scripts do. Reloading the same way instead of having to re-embed the script when you change it.

Think of how incredibly powerful this would be. I could finally easily add my "physics" base code as a single script. Optional additional physics features could just be add on layer scripts loaded separately. They could be much smaller since they can read math functions from the "base" script.

I should add another "feature" to this "feature". the ability to add a GLOBAL "layer script" that runs on ALL layers. It would have to be a script box in the project settings probably. Or maybe a check box on a group layer that adds a layer script to every sub layer.

This concept is very much like how Flash works. You have global scripts that run over the whole thing and individual scripts for sub items (layers in this case).

-vern
Post Reply