Spare script sections in Script Menus
7 posts • Page 1 of 1
Spare script sections in Script Menus
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.
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.
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Spare script sections in Script Menus
We already have _variables so no problem to store code.
In next version we will have new onCreate/onRun/onDestroy (or similar) events.
In next version we will have new onCreate/onRun/onDestroy (or similar) events.
Dream of Algodoo as game development engine...
-
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
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?
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Spare script sections in Script Menus
As I said - will be something like "onRun" event.
Dream of Algodoo as game development engine...
-
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
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?
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Spare script sections in Script Menus
I can't open my sources
Dream of Algodoo as game development engine...
-
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
Kilinich wrote:I can't open my sources
I understand. Thanks anyways.
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests