Script Reference guide for Procedural Modeling.

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Script Reference guide for Procedural Modeling. // Archive: Tech Forum

1  2  3  |  

Post by Johny // Jan 30, 2006, 7:01am

Johny
Total Posts: 672
pic
tS7 manual file have not enough information about ts7 script.

I can not found any script reference quide on there.:(


page 156 wrote: "The best way to get started working with script in trueSpace is to modify an existing script and watch the results."


is it the best to started learn a computer programming language?


I think it's better if we started with knowns some script standard variables. But I can not found it on ts7 manual.


there're also wrote for script bla..bla..bla.. read on DEVELOPER'S GUIDE : CHAPTER bla..bla.. about bla..bla..bla..


Where can I find the link for download the DEVELOPER'S GUIDE ?:rolleyes:

Post by TomG // Jan 30, 2006, 8:34am

TomG
Total Posts: 3397
Hi Johnny,


The Developers Guide is not out yet, but will be soon. As for scripting reference, well there are two sides to that. One is some tS specific items which will be in our documentation.


Mainly though the scripting reference will need to be the reference for the scripting language you choose - if you choose VB script, a VB script guide will be needed; if J script, then you need the j script guide. Good examples and guides are all available online.


It would be too much to include reference for all those in tS ;)


As for tS specifics, then yes we'll have more documentation for that. Meantime I suggest having fun with changing some values inside existing scripts and seeing what happens. For me this is always the best way to learn anyway, much more so than guides and manuals even.


HTH!

Tom

Post by Johny // Jan 30, 2006, 3:46pm

Johny
Total Posts: 672
pic
Thanks TomG :)

Post by noko // Jan 30, 2006, 4:42pm

noko
Total Posts: 684
Johny,


Here is another possibility also to try:


If you want a certain action and not sure how to do in script


Open VBscript or Jscript Macro Recorder

Start recording with VBscript recorder

Do action in TS7 (Player here)

Stop recorder

Open up new Recorded object in LE and look at script you generated

Use that as a guide in your own script



Playing the recorded script will do the same action you did as when you recorded it, it is a very powerful tool.

Post by Alien // Jan 30, 2006, 4:51pm

Alien
Total Posts: 1231
pic
Noko - THANK YOU. I must confess I was feeling somewhat intimidated by the idea of scripts, & thought I would miss out on the ability to do some stuff because of it, but now I now better.

:jumpy:

Thanks also to Caligari for putting this feature in.

Post by mrbones // Jan 30, 2006, 10:06pm

mrbones
Total Posts: 1280
pic
Thanks Noko, Will Try it.



Johny,


Here is another possibility also to try:


If you want a certain action and not sure how to do in script


Open VBscript or Jscript Macro Recorder

Start recording with VBscript recorder

Do action in TS7 (Player here)

Stop recorder

Open up new Recorded object in LE and look at script you generated

Use that as a guide in your own script



Playing the recorded script will do the same action you did as when you recorded it, it is a very powerful tool.

Post by Johny // Jan 30, 2006, 10:59pm

Johny
Total Posts: 672
pic
Thanks Noko :)

Post by SiRender // Jan 30, 2006, 11:19pm

SiRender
Total Posts: 38
Tom,


Could you post a few recommended links for getting started with jScript?

I know I could google (http://www.google.com/search?q=jscript), but it is nice to hear some Caligari recommendations.


thanks

Post by Délé // Jan 30, 2006, 11:36pm

Délé
Total Posts: 1374
pic
Here's one place to look for both jscript and VBscript.


MS Scripting Resource (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp)

Post by TomG // Jan 31, 2006, 3:34am

TomG
Total Posts: 3397
The MS Scripting Resource there is the one I use, so that is my recommendation too :)


BTW the Macro record is handy, like Macros in Photoshop. It records Player-side commands. So, start recording, resize a cube, move it. Stop recording. Select a sphere, hit play on your macro. Watch it scale and move the same as your cube. Handy for repetitive actions! As noted you can then go ahead and view or edit the resulting script to see how to "write a resize command" for instance. Or not bother, and just have a handy macro :)


The aim here has been to expose all the capabilities an uber-programmer would like, yet keep those very same tools useable by someone who wants to do no programming at all. Basically you can dive in to whatever level you feel comfortable at, from just treating it like a regular record actions, to doing some tweaks, to learning from it how to write your own scripts for tS from a blank page. Seems to be working as I've seen several people do just that, go in and use features at different levels, so that's good to see :)


HTH!

Tom

Post by Johny // Jan 31, 2006, 4:59am

Johny
Total Posts: 672
pic
Some little question:

What jscript can do in tS and VBscript can not?

What VBscript can do in tS and jscript can not?

Just want to focus on one script that can access more tS7's feature. (it's hard to learn 2 script on the same time)

Post by Alien // Jan 31, 2006, 5:16am

Alien
Total Posts: 1231
pic
There probably are some differences, but if I had to guess I'd say they included both so as to make it useful for more people, both those already used to VBscript & those used to Jscript.

Post by tomasb // Jan 31, 2006, 6:30am

tomasb
Total Posts: 261
Some little question:


What jscript can do in tS and VBscript can not?


What VBscript can do in tS and jscript can not?


Just want to focus on one script that can access more tS7's feature. (it's hard to learn 2 script on the same time)


There is absolutely no difference. We added both because some people know jscript and some vbscript. they are both semanticaly equal, just syntax is a bit different.

Post by splinters // Jan 31, 2006, 6:45am

splinters
Total Posts: 4148
pic
I tried this but it did not work. Opened VBmacro in player. Pressed Record button then moved and scaled a sphere. Pressed stop on the VBmacro toolbar.

When I pressed play the sphere moved a bit but nothing else. Subsequent presses of the play button moved the sphere the same distance again but nothin like the action I perfomed...:(

Post by Alien // Jan 31, 2006, 7:52am

Alien
Total Posts: 1231
pic
There is absolutely no difference. We added both because some people know jscript and some vbscript. they are both semanticaly equal, just syntax is a bit different.Well at least I was 1/2 right. :)

Post by Johny // Jan 31, 2006, 4:13pm

Johny
Total Posts: 672
pic
Thanks for the answer. :)

other question: which one faster on tS7(jscript or VBscript)?

Post by peterma // Feb 1, 2006, 4:00am

peterma
Total Posts: 48
I tried this but it did not work. Opened VBmacro in player. Pressed Record button then moved and scaled a sphere. Pressed stop on the VBmacro toolbar.

When I pressed play the sphere moved a bit but nothing else. Subsequent presses of the play button moved the sphere the same distance again but nothin like the action I perfomed...:(


Hm, the scenario works ok here. When you record some move/scale actions and play them back, it will be performed in additional manner. I.e. the sphere will be moved a bit and scaled a bit each time you run the macro. You can apply the macro on different object a see the same actions performed on it.

Even more, you can select several objects at once and playback the recorded action on the whole selection !


You can also start with 2 macro record tutorials, mentioned in AG docs (next to 3D record description).



There are many limitations currently with Macro record tool (e.g. 'apply material' operation playback is not too robust, objects rotations are done using fixed rotation center) etc but still there are many situations where it come handy (see Noko's danceClub scenes). I personaly love the tool.

Post by peterma // Feb 1, 2006, 4:12am

peterma
Total Posts: 48
Thanks for the answer. :)


other question: which one faster on tS7(jscript or VBscript)?


Interesting question. We use standard MS script engines for both of them and wrapper mechanism is the same, so if one of them performs faster it is only the question of internal script engine performance.

Perhaps you can try to write some huge computation sample in both languages, measure times and let us know which one is the winner :) I would say the difference will be minimal, if any.

Post by Johny // Feb 1, 2006, 5:15pm

Johny
Total Posts: 672
pic
I dont understand jscript & vbscript now. plan to learn one of them. so before started I want to know with one better/faster with tS7.

May someone can write code like this in jscript dan vbscript so we can compare it:
1. get current time.
2. make loop from (1 to 1000000). {or write 1000 box}
3. get current time.
4. show (start time - end time)

Post by Johny // Feb 3, 2006, 6:15pm

Johny
Total Posts: 672
pic
Anyone know how to make a script object from nothing :confused:

Post by peterma // Feb 6, 2006, 11:33pm

peterma
Total Posts: 48
I'm attaching one tutorial how to create very simple script command.

I guess you can insert 'heavy computation code' there and measure times

Post by Johny // Feb 7, 2006, 2:58pm

Johny
Total Posts: 672
pic
Peter Malcovsky, thanks for the tutorial file :jumpy:

Post by Johny // Feb 7, 2006, 10:19pm

Johny
Total Posts: 672
pic
I tried to make a simple JScript object, but I got this error message.(I attach my testing object file with this post).:confused:


Can anyone help me? :rolleyes:


Or may be a tutorial about how to make Script object:rolleyes:

Post by peterma // Feb 9, 2006, 12:48am

peterma
Total Posts: 48
Hi Johny


I've fixed 2 small typo bugs there

- data objects specification is case sensitive, so you need to put exact string as a parameter for System.CreateDO ('... Package ...', not '... package ...')

- second CreateDO used 0 (zero) instead of O at the end


and the script works ok now, see atachments (I just replaced mesh generator in the Cone script sample by yours one). So good start, and don't hasitate to please my tired eyes with more ! :D

Post by peterma // Feb 9, 2006, 1:52am

peterma
Total Posts: 48
Or may be a tutorial about how to make Script object:rolleyes:


Here is another one, ripped from the DG manual (just like the previous one).

I sent you script command tutorial first as you can execute it directly using the start button on it and measure computing time required.

Script commands are good to form complex activities, loops etc (green links in LE, e.g. in PacMan, Clock scenes). Script objects are lot of fun as well, you can combine them with others objects in LE to form interesting parametrized renderable objects ,timer-based animations, ....

Post by Norm // Feb 9, 2006, 6:27am

Norm
Total Posts: 862
pic
... don't hasitate to please my tired eyes with more ! :D


Dev guys like being fed the banana smilie too, so feed them dev dudes!


:banana: :banana: :banana:

Post by Johny // Feb 9, 2006, 7:23am

Johny
Total Posts: 672
pic
Peter Malcovsky, thanks again for your help :jumpy:

Post by Johny // Feb 10, 2006, 8:22pm

Johny
Total Posts: 672
pic
Another question: How to make my script object visible by itself without replaced it with ohter object mesh generator :confused:

Post by Johny // Feb 13, 2006, 9:44pm

Johny
Total Posts: 672
pic
...., and don't hasitate to please my tired eyes with more ! :D


As long as you don't hasitate to answer my question. :p

Post by peterma // Feb 15, 2006, 1:12am

peterma
Total Posts: 48
Another question: How to make my script object visible by itself without replaced it with ohter object mesh generator :confused:


Johny, here is an example how to create standalone renderable script object. Also NAV widget recognized it and you can move/rotate/scale the object. You can see in the Attributes tab what (registered) attributes are required for such a goal.


The only problem is with material so the demo is limited to the default white material.


So check this one out, and feel free to ask if something is not clear.


EDIT: still, it is recommended for this class of products to have separate mesh generator injected into the regular object with the Transform node and Material etc (just like the existing script objects like Cone, Gear etc). Putting everything into one script works somehow, but can confuse some tools or the Bridge.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn