Nimrod Cooper
Registered User
Join date: 10 Oct 2004
Posts: 1
|
10-13-2004 05:49
I am currently trying to script a flying castle, that responds to voice commands. So, saying "North" will make it fly north, and so on. However, the vehicle motor (my castle is a balloon) only moves the vehicle along the local coordinates. Is there a way to use the global coordinates instead? If not, does anyone know a script that will automatically orient the castle in the right direction? Also, my castle has an annoying habit of letting me sink through the floor while flying. I suspect this is because vehicles usually expect you to be sitting on them. I would really like to be able to walk around it while it is flying. Is there a way to fix this?
|
Spuds Milk
Registered User
Join date: 28 Sep 2004
Posts: 94
|
10-15-2004 14:19
as a wild guess, your vehicle program may toggle phantom off and on when you enter/exit them, so that vehicle doesn't go falling away when it's rezzed
|
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
|
10-15-2004 15:09
This is the code in my old Hot Air Touring Balloon that figures out the vector pointing towards the destination in global coordinates(borrowed from the Linden Hot Air Balloon)... vector totarget(float globalx, float globaly, float localx, float localy) { vector target; vector dir; vector corner = llGetRegionCorner(); vector pos = llGetPos(); pos.x = pos.x + corner.x; pos.y = pos.y + corner.y; target.x = globalx + localx; target.y = globaly + localy; target.z = pos.z; dir = target - pos; destVals.z = llVecMag(dir); dir = llVecNorm(dir); return dir; }
|