Scriptlets

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.

Scriptlets // Scriptorium

1  |  

Post by trueBlue // Oct 6, 2006, 5:14pm

trueBlue
Total Posts: 1761
pic
I thought I would share a few scripts here. Hopefully this thread can grow with everybodies contributions.

Post by trueBlue // Oct 6, 2006, 5:18pm

trueBlue
Total Posts: 1761
pic
function Execute(params)
{
//Set my preferences
Node.Value("/Preferences/Link Editor", "Developer Aspect") = "true"
Node.Value("/Preferences/Link Editor", "Lights") = -1
Node.Value("/Preferences/Link Editor", "Cameras") = -1
Node.Value("/Preferences/Desktop", "NetSounds") = 0
Node.Value("/Network/NetProperties", "DefServer") = "tpportal.caligari.com"
UserInterface.OpenPreferencesPanelViewExWithFlag(' ', '','/Preferences/Desktop',3, 1, 0, 4);
LE.DefaultPlacement();
//Remove script
Node.Delete(Space.CurrentScene() + "/Change my Preferences");
//Clear the Commands History
RsApp.ClearHistory();
}

Post by trueBlue // Oct 6, 2006, 5:24pm

trueBlue
Total Posts: 1761
pic
//Date and Time: Friday, October 06, 2006 8:22:45 PM
function Execute(results)
{
var today, string = "";
today = newDate();
string += today.toLocaleString();
results.Param("Date") = (string);
}

Post by trueBlue // Oct 6, 2006, 5:29pm

trueBlue
Total Posts: 1761
pic
//Confirm message Box
function Execute(params)
{
var Yes = System.Question("Would you like to create a jScript Command?");
if (Yes)
{
Library.CreateDelegate("System", "Scripts", "jScript command", Space.CurrentScene());
}
else System.Alert("Okay maybe later then!");
}

Post by trueBlue // Oct 6, 2006, 5:41pm

trueBlue
Total Posts: 1761
pic
// Select the Light or Camera first before running this script.
function Execute(params)
{
sel = Node.Selection();
for (i = 0; i < Node.SelectionLength(sel); i++)
{Node.Select(Node.SelectionGetAt(sel, i)); ApplyMacro(Node.SelectionGetAt(sel, i))};
}
function ApplyMacro(selectedObj_)
{
Node.Select(selectedObj_ + "/Object Render Attributes")
Node.Value(selectedObj_ + "/Object Render Attributes",
"Invisible") = -1
// Disconect Object hider within Camera and or Projector light.
Node.Select(selectedObj_ + "/Object hider")
Node.Disconnect(selectedObj_ + "/Object hider", "Invisible", selectedObj_ + "/Object Render Attributes", "Invisible")
}

Post by stan // Oct 10, 2006, 4:41pm

stan
Total Posts: 1240
pic
// heres one to hide a toolbar, it's path dependent to the toolbar path
this shows two toolbars
function Execute(params)
{
Node.Select("/Project/Windows Manager Space/ RTS Bar_Plug/Plug1Toolbar")
Node.Value("/Project/Windows Manager Space/ RTS Bar_Plug/Plug1Toolbar",
"Hidden") = -1 // 0 to show
Node.Select("/Project/Windows Manager Space/Frame Window, 5/Toolbar")
Node.Value("/Project/Windows Manager Space/Frame Window, 5/Toolbar", "Hidden") = -1
}

Post by trueBlue // Oct 21, 2006, 8:40pm

trueBlue
Total Posts: 1761
pic
//IMPORTANT: Backup your original Toolbars.rsobj file in the following folder:
// c:\trueSpace7\tS\Scripts\preobjects\
// This script assumes that this is where you installed trueSpace7.
// This script will overwrite this file without warning!

function Execute(params)
{
Node.Select("/Toolbar Prototypes Encapsulator");
RsFileIO.SaveObject('c:\\trueSpace7\\tS\\Scripts\\ preobjects\\Toolbars.rsobj', '');
System.Alert("Toolbars have been saved.");
System.Alert("trueSpace7 will now shutdown and restart to save changes.");
RsApp.Reset();
}

Post by Emma // Feb 17, 2007, 11:22am

Emma
Total Posts: 344
pic
Was a time consuming job, but I picked out all (hopefully) CreateDo functions and collected them for a general overview in one list.

Attached is the text file of it which I had to ZIP since only 19.7 KB are allowed for txt files.


So this attached file can be edited with notepad, word or any other text program.


For myself I use opene office (www.openoffice.org) which is free and which "eats" really a lotof different formats and can write (but not read) PDF format.
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