Spare script sections in Script Menus

Suggest changes and improvements to Algodoo.

Spare script sections in Script Menus

Postby Xray » Thu Dec 06, 2012 5:03 am

I wasn't quite sure how to name this suggestion, and so if the "Subject" title above seems confusing or ambiguous, I'll attempt to clarify it here.

Those of us who make use of Thyme scripting usually have to hijack one or more of the built-in functions or variables that are needed for the physics of the geometry, such as controllerAcc, Friction, or AirFrictionMult, etc. Whenever we want to create a script that runs constantly we have to place our code in the box that contains the value for the particular function, and after we get done adding our code, we have to make certain that the last value is the value that the built-in function or variable needs.

So, rather than having to hijack any of the built-in functions or variables, I suggest that that you (Emil) provide a few (say, 3?) spare script sections where we can stick our own code. For example, you might give us Script1 = {}, Script2 = {}, and Script3 = {}. We can use those script sections for our own scripts. They of course would have to be the type of script sections that execute the code all the time, even when Algodoo is stopped, just like those functions and variables mentioned above currently do.

Maybe instead of Script1, Script2, etc., you can label them User1, User2, etc. OR even maybe UserScript1, UserScript2, etc.

I hope some of you other guys who use a lot of Thyme scripting could chime in and comment about this idea.
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: Spare script sections in Script Menus

Postby Kilinich » Thu Dec 06, 2012 6:30 am

We already have _variables so no problem to store code.
In next version we will have new onCreate/onRun/onDestroy (or similar) events.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Spare script sections in Script Menus

Postby Xray » Thu Dec 06, 2012 8:36 am

Kilinich wrote:We already have _variables so no problem to store code.
In next version we will have new onCreate/onRun/onDestroy (or similar) events.


Not the same thing. Local variables cannot be used as functions. For example, if I put the following code in airfrictionMult, {scene.my.temp = pos;1.0}, scene.my.temp will continuously update. But if I create a local variable (call it _temp) and use the same script: _temp = {scene.my.temp = pos}, then the variable scene.my.temp will NOT be continuously updated. I am asking for areas to place code that will update continuously. "_variables" cannot do that. Is this not correct?
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: Spare script sections in Script Menus

Postby Kilinich » Thu Dec 06, 2012 11:30 am

As I said - will be something like "onRun" event.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Spare script sections in Script Menus

Postby Xray » Thu Dec 06, 2012 5:54 pm

Kilinich wrote:As I said - will be something like "onRun" event.


Where can we read about the features of the new version? I did a search and could find nothing about "onRun" and those other features that you mentioned. How did you find out about them?
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: Spare script sections in Script Menus

Postby Kilinich » Thu Dec 06, 2012 6:06 pm

I can't open my sources :ugeek: :D
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Spare script sections in Script Menus

Postby Xray » Thu Dec 06, 2012 6:35 pm

Kilinich wrote:I can't open my sources :ugeek: :D


I understand. Thanks anyways. ;)
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 10 guests