new obj info type scenario

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.

new obj info type scenario // Scriptorium

1  2  |  

Post by Norm // Nov 10, 2006, 7:18am

Norm
Total Posts: 862
pic
There are tons of nodes above the space, which most likely will have tons of other nodes inside we are unaware of.


Is this where we get really dangerous? :)

Post by trueBlue // Aug 24, 2007, 8:00pm

trueBlue
Total Posts: 1761
pic
variable = inNames.GetSelection()

I never used it but noticed it in the auto-complete when playing with the combo. Have you tried it yet? I wanted to do some filtering as well; populate a dropdown combo with objects that have a matrix connector and such.

Hello Norm:
I was hoping that we could revisit this area when you have the time.
As mentioned I would like to learn how to select and change a value
that is in a Combo Ctrl.
1.) Change a value in a Combo Ctrl to make it active. i.e AA level in the Background panel.
2.) With your project here, change and select a value and do something with it as mentioned previously.
Would be nice to have a Super Workspace Information Panel. One that surpasses tS6.6. Filters, Faces, and Volume.

Please do note that I can record a jScript Macro to change Bridge - On, Off, Auto in Desktop panel. It works fine but I can not do the same for Anti Aliasing in Background panel.

Post by Norm // Aug 25, 2007, 3:52am

Norm
Total Posts: 862
pic
I thought perhaps the matrix info script object would be helpful. It uses radio buttons, but my research at the time for jscripting mentioned that radio or combo were essentially same so same type of mechanizm should work for combo.
In the matrix info script: check the jmatrix object. Inside the script runs through a bunch of if statements to handle what was selected via radio group. Combo would be same where you compare what is selected and come up with an action.
PeterM also pointed me towards the mines game, where a combo is used. Forget exactly where but you may wish to check it out too.

Post by stan // Aug 25, 2007, 4:45am

stan
Total Posts: 1240
pic
I've been trying to get this to work too trueblue..;)
there is a
inNames.GetSelectedString()
but no
inNames.GetSelection()

I haven't got it to work yet..

Post by 3dvisuals dude // Aug 25, 2007, 5:26am

3dvisuals dude
Total Posts: 1703
pic
Don't all variations of MS API combobox selection dropdowns require the setup of a "Select Case" function first to work correctly?

I had that problem once before when programming in Liberty BASIC, but adding that function solved it as I recall.

HTH

- Mark / 3dvisuals dude

Post by Norm // Aug 25, 2007, 6:07am

Norm
Total Posts: 862
pic
Well lets see what you have so far and we can figure it out I am sure.
Could very well be a select case ... been awhile since I looked into it.

note: from what I am searching so far, combos have been created. Problem I am seeing is folks are adding questions about elusive stuff after the fact. To me, creating a basic combo box would be first step. Once we succeed there, we can move on to more sophisticated scenarios. Seems very simple scenarios are being driven too far too fast and it all fails and we end up saying combos can't be created.

So anyone have simple combo contro that works. Nothing fancy, just that works?

Because trueSpace works with the Microsoft Scripting Host, http://msdn2.microsoft.com/en-us/library/ms950396.aspx should be the bible for scripting in trueSpace. Not everything will work but it is great reference area for all to use.

Post by 3dvisuals dude // Aug 25, 2007, 6:31am

3dvisuals dude
Total Posts: 1703
pic
Well, I haven't seen trueBlue's code referred to above but the problem he's encountering there sounds very familiar to me from my Liberty BASIC programming, where I once found the only solution was the setup of the "Select Case" function controlling the combobox dropdown, and that combobox utilized an internal API call, which I suspect is probably the case with TS as well.

Here's some related code that helped me at that time along with related notes:

SELECT CASE var
CASE x
'basic code
'goes here
CASE y
'basic code
'goes here
CASE z
'basic code
'goes here
CASE else
'basic code
'goes here
END SELECT

The first line in a select case statement is "select case" followed by the named variable or the expression selected. On subsequent lines, there are "case" statements, specifying the conditions to evaluate for the selected variable, with code after the "case" statement that is to be executed if that particular case evaluates to TRUE. The "select case" routine must end with the words "end select".

There is no limit to the number of conditions that can be used for evaluation


Of course I'm not sure if the "Select Case" is even the real issue here, it just sounds like it to me. It's also likely that a VBscript approach to "Select Case" utilization is better for our use here than what I placed above here just for reference.

HTH

- Mark / 3dvisuals dude

Post by Norm // Aug 25, 2007, 6:50am

Norm
Total Posts: 862
pic
here is old script i have on select case.

Post by 3dvisuals dude // Aug 25, 2007, 6:54am

3dvisuals dude
Total Posts: 1703
pic
here is old script i have on select case.

Thanks Norm,

Not sure if this is what trueBlue is looking for but it will definitely be handy for me when I do something similar at some point. WHen it comes to all that stuff the more reference code and techiques the better for sure!

Glad you had this, and thanks for resurrecting it for us!

- Mark / 3dvisuals dude

Post by Norm // Aug 25, 2007, 7:05am

Norm
Total Posts: 862
pic
Now back in the Mines game (I attach rar file), you can see how Peter populated the names dropdown list.
See Game Business/Join Game script.

dropdown list exists on mines game center/SharedData main panel.
connectionless scripting is cool.
Join game has several functions to determine some name scenarios
no name entered
name already exists

Post by 3dvisuals dude // Aug 25, 2007, 7:28am

3dvisuals dude
Total Posts: 1703
pic
Now back in the Mines game (I attach rar file), you can see how Peter populated the names dropdown list.
See Game Business/Join Game script.

dropdown list exists on mines game center/SharedData main panel.
connectionless scripting is cool.
Join game has several functions to determine some name scenarios
no name entered
name already exists


I like Peter's style here.:)

Peter uses "Status" and "Select Change Event" handlers to do the same thing I used to do with "Select Case" and an internal "Combobox" API Call in Liberty BASIC Programming.

"Connectionless Scripting" is very cool indeed. Are events detected and redefined by this script Global within TS when this script is active then?

EDIT: What I mean to say there is: If an activity is detected by a script (such as Peter created here) and that detection is then translated by that script into a new definition for that activity, does that definition reside Globally within TS where other additional "Connectionless Scripts" can then access those new definitions as they occur to trigger subsequent actions?

- Mark / 3dvisuals dude

Post by Norm // Aug 25, 2007, 8:08am

Norm
Total Posts: 862
pic
I would say yes to your question. It is imp to remember this game was created pre-array data type. So you can create a script that hosts an array data type or two and populate those arrays with such information. The arrays are then available on a global basis, which to me is quite interesting.

Post by 3dvisuals dude // Aug 25, 2007, 8:27am

3dvisuals dude
Total Posts: 1703
pic
I would say yes to your question. It is imp to remember this game was created pre-array data type. So you can create a script that hosts an array data type or two and populate those arrays with such information. The arrays are then available on a global basis, which to me is quite interesting.

@ Norm:

Oh yes....:D

Lots of potential there for sure!

I have a thing for Globals... they can be used in some very handy ways if you really think about it, I got so used to setting them up in BASIC that I started building snippet library components that saved me many many hours of otherwise tedious repetetive work.

What I like most about Globals though is that they often offer a simple creative solution to otherwise perplexing complexities.

Thanks for that info, that will stick in my mind and save me loads of time in the months ahead I'm sure.

Great stuff Norm, thanks!

@ trueBlue:

I apologize for sort of hijacking this discussion away from the specific answers you were seeking above, hopefully someone here will address those better than I can and more specifically, I was just trying to help as best I could myself.

- Mark / 3dvisuals dude

Post by stan // Aug 25, 2007, 10:21am

stan
Total Posts: 1240
pic
Norm, will look at your select case object and see if I can get it to do what I want..I can get an object selected with
inNames.GetStringAt(0)
so this script of yours might just be the ticket to change the number..;)
,

Post by trueBlue // Aug 25, 2007, 12:48pm

trueBlue
Total Posts: 1761
pic
First my apologies for hijacking your thread Norm with the Background panel. I have come to the the conclusion 'guessing' that what I want to do with this particular node is not possible because that node is compiled and is missing the commands within to make this possible. As mentioned I can record a jScript Macro, changing the Bridge options that are within it's Combo Ctrl. It is a simple command:
Node.Value("/Preferences/Desktop", "BridgeSync") = "Auto"
So the key here is that this simple command changes one of 3 options within a Combo Ctrl. Most likely 'guessing' because this compiled node is setup proper.
I do wish to put this thread back on track with what you have started in the Information Panel. So maybe using your vbManager we can figure out how to set up a Combo Ctrl proper and access its options and do something with it. :cool: Go Gord!

Post by stan // Aug 25, 2007, 2:41pm

stan
Total Posts: 1240
pic
trueblue, for things like 'auto' it may just be a premade list..you create a combo control with the window designer tools when you right click the titlebar of your node. after creating a combo control you then go into it's panel by right clicking it when it's hilighted with the blue border. on properties tab tou can write your list..like this; [press enter after each list element]
one item
one item
one item

in your script you need a string attribute to link the list to..it's that simple

here is a sample, it's the first LE nav list idea. [before the text toolbars] :rolleyes:

Post by Norm // Aug 25, 2007, 3:22pm

Norm
Total Posts: 862
pic
Norm, will look at your select case object and see if I can get it to do what I want..I can get an object selected with
inNames.GetStringAt(0)
so this script of yours might just be the ticket to change the number..;)
,

Actually it is all Peter's work in the Mines scenario. He does populate an array though so it shows a good best practice to follow.

trueBlue: I see what you are saying. Probably good idea to bring up on other forum.

Post by stan // Aug 26, 2007, 9:53am

stan
Total Posts: 1240
pic
well guys I did it. you can now select objects in a scene [or sub-objects when you enter an object] from the combo list. will post my scene manager [in the garage] when I polish it up abit..:D

trueblue..I tried to get the AA to change in background but no luck..you can read the list via
[code][
num = Node.Value('/Project/Windows Manager Space/Frame Window, 1/Background', 'AntiAliasing')
params.conValue("name") = num
/CODE]
but not write back to it :confused:

Gord :cool:

Post by 3dvisuals dude // Aug 26, 2007, 10:56am

3dvisuals dude
Total Posts: 1703
pic
well guys I did it. you can now select objects in a scene [or sub-objects when you enter an object] from the combo list. will post my scene manager [in the garage] when I polish it up abit..:D

trueblue..I tried to get the AA to change in background but no luck..you can read the list via
[code][
num = Node.Value('/Project/Windows Manager Space/Frame Window, 1/Background', 'AntiAliasing')
params.conValue("name") = num
/CODE]
but not write back to it :confused:

Gord :cool:

AWESOME!!!! Way to go Gord!!!:banana:

Congratulations!!!

This looks like something which will cause everybody here to soon be wondering how they ever got along without it before!!!:D

- Mark / 3dvisuals dude

Post by Norm // Aug 27, 2007, 6:35am

Norm
Total Posts: 862
pic
objects - script objects/Magic Sculpturer object uses array data type in script. It could be useful to understand how this scenario works :)

Post by stan // Aug 28, 2007, 8:00am

stan
Total Posts: 1240
pic
you can find my 'Scene Manager' here http://forums1.caligari.com/truespace/showthread.php?p=45614#post45614

Norm, I ended up going back to Peter's mine game to find the answer.. after a year coding I understood what to look for ..yes grasshopper yes, it may take years but you will learn ;)

Gord :cool:
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