ScriptUO

Scripting Resources & Utilities => ScriptUO Application => General Discussion => Topic started by: goatmaster on July 25, 2008, 04:32:44 AM

Title: single script w/multiple instance idea
Post by: goatmaster on July 25, 2008, 04:32:44 AM
Hi TM,

I have been developing a combat script and was thinking about how I can run healing routines whilst other routines are being ran in this script, (possibly slowing it down, etc) The most efficient way seems to be using separate healing script and you can utilize the namespace features to coordinate with each other.

I thought of a nifty idea that I think would be quite cool, the simplest way to explain is to imagine 2 totally separate scripts within the one "filename.suo" file, and the two scripts are simply wrapped in a tag such as <script>code</script>, and the code in those tags are executed in separate instances in scriptuo as if you have them in separate tabs, except scriptuo coordinates that itself.

This would give me the ability to write a complete script in one simple file yet maintaining the efficiency of multiple instances such as a combat script + a healing script together which is quite common.

Cheers


Title: Re: single script w/multiple instance idea
Post by: TrailMyx on July 25, 2008, 09:47:50 PM
I think you can kinda get that now if I understand your question correctly.  Suppose you want two script to interact with one another.  Under normal circumstances, these scripts will have separate memory spaces and local namespaces.  However, if you make both scripts run out the same global namespace, then they'll be able to interact with one another.  Problem is that I'm not sure the current implementation of namespaces within EasyUO isn't 100% correct since I've been able to crash EasyUO on more than one occasion when I get overly namespace happy.

However, it seems like you are asking to perhaps have one script be able to spawn multiple "threads".  It that more like what you are thinking?
Title: Re: single script w/multiple instance idea
Post by: goatmaster on July 25, 2008, 11:02:07 PM
Yep, multiple threads is exactly what I was thinking. You could continue to use the existing global namespace for communication between the two or there might be some possibilities of enhanced features for communication with this sort of single script 'multi-threading' idea.

I think the big benefits would be allowing writers to write single scripts which are much more advanced yet still run fast, and also other scripts, such as combat and bot which could benefit from multi-threading, such as x-healing and magic casting simultaneously.
Title: Re: single script w/multiple instance idea
Post by: Superslayer on January 24, 2009, 05:37:41 PM
Or running a rail while scanning for character changes?  Such as death, menubutton presses, skill use?
Title: Re: single script w/multiple instance idea
Post by: TrailMyx on January 24, 2009, 05:43:40 PM
Well, that's what my rail engine does when you run it in "SERVER" mode.  :)
Title: Re: single script w/multiple instance idea
Post by: Superslayer on January 24, 2009, 08:17:43 PM
Ahh, the option I have yet to try out.  I dl'd it already (as per a previous post regarding it) and am having a great time with it.  Looks like I have more fun on the horizon  ;D ;).


BTW, any word on the next beta release?
Title: Re: single script w/multiple instance idea
Post by: TrailMyx on January 25, 2009, 02:54:46 AM
Not sure when the next version will be out.  I'm in the middle of re-writing a bit of the data structures.  It's a bit of a mess at the moment.