Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Turret

Spitzer Paulino
Registered User
Join date: 16 Oct 2008
Posts: 4
04-25-2009 11:23
I am currently building a spaceship which has a couple of turrets.
Each turret is suppose to be controlled by a seat. Currently, it seems that one seat controls ALL of the turrets. Is is possible that only one seat controls one turret? If so, how?
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
04-25-2009 12:21
well i dont know how your doing it but i will ASSume your using link messages
i would set the sitter an ID and have the turret filter for that ID only
_____________________
L$ is the root of all evil
videos work! thanks SL :)
Spitzer Paulino
Registered User
Join date: 16 Oct 2008
Posts: 4
04-25-2009 18:48
Ok thanks, I will give it a shot.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
04-25-2009 20:30
you can also use a name method

name each seat and turret with a number at the end. ie:

Seat 1
Turret 1
Seat 2
Turret 2
etc.

then for sending the link message, extract the number at the end of the name

integer num = (integer)llGetSubString(llGetObjectName,-2,-1);//used 2 in case you have enough sets to use a double digit number.
llMessageLinked(LINK_SET,num, string, id);

and then in the turret it would be

link message(integer sn, integer n, string str, key id)
{
integer num = (integer)llGetSubString(llGetObjectName(),-2,-1);
if(num == n)//compares the numbers to see if it comes from it's controller
{
do your thing;
}


the other thing is, find out the link number for each turret, and script each seat to send a message to only the turret that corrosponds


edit: another alternative to the name method is to simply put the number in the description field, no having to extract it with llGetSubString, it would just be

integer num = (integer)llGetObjectDesc();
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369