Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Reading position and rotation from a notecard

Thorne Kaiser
Nice Guy
Join date: 29 Nov 2005
Posts: 132
03-22-2006 05:25
Is it possible to include positioning and rotation in a notecard that will be read by a script?

Notecard:
<0, 0, 2>; <0,0,45>


Script:
CODE


vector myPosition = (get it from the notecard);
vector myRotation = (get it from the notecard);

llRezObject("something", llGetPos() + myPosition, ZERO_VECTOR, myRotation, 42);


I understand how to set up the script using the notecard, but if I want to grab the position and vector from it, how could I do that? Does each x,y, and z have to be done separately? If so, how do I write it out in the code?
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
all you need is casts
03-22-2006 05:38
First, you need to read a strings from the card then typecasting will do the rest for you. The following code has been tested in game:
CODE
default {
touch_start(integer total_number) {
vector v = llGetPos();
string s = (string) v;
llSay(0, "llGetPos = " + s);
vector w = (vector) s;
llSay(0, "cast z component of string vector = " + ((string) w.z));
}
}
Good luck.