Turning on/off ground plane from a script & isometric camera question

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.

Turning on/off ground plane from a script & isometric camera question // Scriptorium

1  |  

Post by ProfessorKhaos // Oct 18, 2006, 1:18pm

ProfessorKhaos
Total Posts: 622
pic
Hi all! Does anyone know of a way to turn on or off the player's ground plane from within a script? Haven't figured that one out yet. I want to distrubute a truePlay file that turns off the ground plane.


Also, is there a way to create an isometric camera that can view the scene from any angle and set the user's view to it upon launch of truePlay?


v/r,


P.K.

Post by ProfessorKhaos // Oct 18, 2006, 1:25pm

ProfessorKhaos
Total Posts: 622
pic
Nevermind the camera question. Duh. It's part of the camera's LE object setting.:rolleyes:

Post by Norm // Oct 18, 2006, 1:26pm

Norm
Total Posts: 862
pic
What have you got so far?

Where have you been researching for info so far? I see a D3DGrid scenario in the RsNodeDoc.xml file. You should be able to control the grid node using that info in the doc.

Post by ProfessorKhaos // Oct 18, 2006, 2:06pm

ProfessorKhaos
Total Posts: 622
pic
Hadn't gotten very far Norm. I'll check into your suggestion. Did a quick scan of the developer's guide itself hoping something would leap out at me. One of the problems with looking for an answer is sometimes asking the right question. :)


Convinced the folks at work to buy a copy of trueSpace. I want to set up a few interactive training demos for them but couldn't figure out how to get rid of the ground as part of the .rcd file. So far I have them manually turning it off from the truePlay grid icon.


BTW, everyone at work is pretty amazed at this stuff. Never thought I'd be getting kudos for bringing my hobby to work with me. Kinda a neat feeling putting money back in the bank as a result of using trueSpace. I'm pretty much at the break even point in terms of expense vs income so basically my hobby has now paid for itself. Can't really share the end result since I don't own it but needless to say I'm pretty happy about the whole thing.

Post by trueBlue // Oct 18, 2006, 2:28pm

trueBlue
Total Posts: 1761
pic
function Execute(params)
{
Library.CreateDelegate("DX", "View", "Scene Ground", Space.CurrentScene())
Node.Select(Space.CurrentScene() + "/Scene Ground")
Node.Value(Space.CurrentScene() + "/Scene Ground", "Enable") = -1 // On
Node.Value(Space.CurrentScene() + "/Scene Ground", "Enable") = 0 // Off
}

Don't forget the Macro recorder when you need a quick idea how to script something. Also the Output console has a wealth of information being recorded while you work. You can not copy and paste from there but there is a Rosetta.log in the C:\trueSpace7\tS folder where you can.

Post by ProfessorKhaos // Oct 18, 2006, 2:58pm

ProfessorKhaos
Total Posts: 622
pic
Thanks TrueBlue! :)


Was just playing with the macro recorder before I checked in here again. Mine returned a single but much longer line than yours but I think I can follow it now.


Node.Value(

"/Project/Windows Manager Space/Frame Window/Split Docking Place/Frame Window/Border Docking Place/Frame Window, 2/Border Docking Place/Frame Window, 2/Player - Ground",

"Enable") = -1


The above was for turning on the ground. As you stated assigning a 0 instead of a -1 seems to turn it off. I like your version better as it's more clear what's going on and it's probably more flexible.


Didn't think of the output console. The idea that one can see under the hood so much is something I'm still getting used to but it definately seems to have lots of power.


As always, thanks to both you and Norm for your willingness to help. Some of these questions may seem simple enough to look up and I'm trying to do that where I can but it's a pretty big learning curve to climb sometimes.


v/r,


P.K.

Post by trueBlue // Oct 18, 2006, 3:21pm

trueBlue
Total Posts: 1761
pic
No problem I am learning the hard way myself. Just so you understand what that script does its first loads the Scene Ground from the DX/View library. Then selects it within the current scene and turns on and then off. You could have done this manually by loading the Scene Ground from the DX/View library and unselected the Enable.
I would like to see how Norm would do it, because I suspect he would show us how to create the script from scratch. I would like to understand myself how one could change the colors of the tiles.
Another little trick that I have learned with the macro recorders is sometimes you do not want an object selected before starting the recording. Experiment with this idea to see what I mean. Start one with and one without. The shortcut way I make sure an object is not selected is to select the record button, stop it, select the generated script and then close it. Then start your recorder.

Post by ProfessorKhaos // Oct 18, 2006, 3:56pm

ProfessorKhaos
Total Posts: 622
pic
Ok. That does make some sense now.


Turns out that it's really really easy to ensure that the ground is turned off in truePlay. In fact, a script isn't needed at all though your message allowed me to find a critical component.


Once I knew where to find the scene ground panel (DX view, not the UI libraries) I was able to just drop a copy in my scene, uncheck the enable box, and make the .rcd file from there. I suppose if I wanted to make it nigh impossible for the user to turn on the ground at all I could always tie the scene ground panel object's enable input to a zero so that it couldn't change. Haven't tried that yet but it seems plausible.
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