Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

in place weapon

Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
09-13-2006 08:52
hello all you wonderful scripters i am trying to get a script for a inplace weapon. much like the warhammer 40k imperial guard weapons. Not sure if the turrent script would work or not. any help would be great thanks
Frans Charming
You only need one Frans
Join date: 28 Jan 2005
Posts: 1,847
09-13-2006 09:35
A more specific question would be nice, and I have no idea what the turrent(current, turret) script is.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-13-2006 12:44
Believe it or not some of us have never played Warhammer let alone know anything about its weaponry.
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
09-13-2006 17:28
ok i will try this then




does that help in seeing what i want to do also the turrent code is found here

CODE

key owner;
key toucher;
string toucherS;
float SPEED = 80.0;
integer LIFETIME = 7;
float DELAY = 0.2;
vector vel;
vector pos;
rotation rot;
integer in_use;
integer have_permissions = FALSE;
integer armed = TRUE;

default
{
on_rez(integer startParam)
{
llResetScript();
}
state_entry()
{
owner = llGetOwner();
in_use = FALSE;
llTriggerSound("", 1.0); // Add a rezz sound
llTriggerSound("", 1.0); // Add a Lock Sound
}
touch_start(integer total_number)
{
if(in_use == FALSE)
{
toucher = llDetectedKey(0);
if(toucher == owner)
{
llRequestPermissions(toucher, PERMISSION_TAKE_CONTROLS|PERMISSION_TRIGGER_ANIMATION);
llSetText("Requesting Permissions", <1,1,1>, 1);
llTriggerSound("", 1.0); //Add a question sound
}
}
if(in_use == TRUE)
{
if(llDetectedKey(0) == toucher && llDetectedKey(0) == owner)
{
llReleaseControls();
llSensorRemove();
llSetRot(<-0.00000, -0.00000, 0.70711, 0.70711>);
llSetText("Unit Offline", <1,1,1>, 1);
llTriggerSound("", 1.0); //add beep sound
in_use = FALSE;
}
}
}
sensor(integer sense)
{
rotation k = llDetectedRot(0);
llRotLookAt(k, 1, 1);
}
no_sensor()
{
llReleaseControls();
llSensorRemove();
llSetRot(<-0.00000, -0.00000, 0.70711, 0.70711>);
llSetText("Unit Offline - Connection Lost", <1,1,1>, 1);
llTriggerSound("", 1.0); // add Alert sound
in_use = FALSE;
}
run_time_permissions(integer perm)
{
if(perm)
{
llSetText("", <1,1,1>, 1);
llTakeControls(CONTROL_ML_LBUTTON, TRUE, FALSE);
llSensorRepeat("", toucher, AGENT, 20, TWO_PI, .1);
llSetText("Unit Online", <1,1,1>, 1);
llTriggerSound("beep yes", 1.0); //add beep sound
llTriggerSound("", 1.0); //add lock load sound
in_use = TRUE;
}
else
{
in_use = FALSE;
llSetText("Unit Offline", <1,3,1>, 1);
}
}
control(key name, integer levels, integer edges)
{
if ((levels & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON)
{
llMessageLinked(LINK_THIS, 0, "fire_nonmistakable", NULL_KEY); ///This is the messagelinked that fires the bolt. It may need a short llSleep after the messagelinked to keep it from seeing a continuous mouseclick?
}
}
link_message(integer sender_num, integer num, string fire_nonmistakable, key id)
{
rot = llGetRot();
vel = llRot2Fwd(rot);
pos = llGetPos();
pos = pos + vel;
pos.z += 0.0;
vel = vel * SPEED;
llTriggerSound("", 1.0); ///This is where the lag seems to start
llSleep(2);
llTriggerSound("", 1.0); //add bullet sound
llRezObject("", pos, vel, rot, 1); ///This can be rezzed up to three or four times before the script is back to normal control
}
}
[/QUOTE]
Willford Cunningham
Builder of many things.
Join date: 1 Jul 2004
Posts: 8
09-13-2006 21:42
I believe he meant turret. I have no idea why people feel the need to place an N in the word.

http://www.urbandictionary.com/define.php?term=turrent
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-14-2006 09:58
From: Bizcut Vanbrugh
ok i will try this then




does that help in seeing what i want to do also the turrent code is found here ...



Well I'd hardly call them turrets since they are man(?) portable weapons....

Script is pretty straight forward although its a bit mangled.
From a quick read of it it will allow the owner, and only the owner, to take control of the weapon.

While they are within sensor range (set to 20m) the turret will track their rotation, I'm assuming it was designed to be mouse look operated and a sit target?
Thew weapon is fired by the mouse button but the rezzed object has been removed so its firing blanks.....

What are you expecting it to do?
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
09-17-2006 05:01
just wanting to sit on a big man portable gun and shoot it at people in the cimbat simm i usualy run in
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-17-2006 10:39
From: Bizcut Vanbrugh
just wanting to sit on a big man portable gun and shoot it at people in the cimbat simm i usualy run in



Then Yep it will do the basic's, needs a bullet or other munition type object added.
scubadiver Albert
Registered User
Join date: 8 Oct 2006
Posts: 24
10-11-2006 09:10
your turret idea is good.
i like warhammer 40,000 and i know you mean the heavy bolter turret.
i respect you cos i have no clue on how to build turrets but the script provided on here will do for my thunderhawk gunship(which is under construction)

what is the code you have to add to the munition?

can i change it so it only looks and not fires so it can be used with the CCC system?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
10-12-2006 00:03
Not sure but I think the CCC dev kit is available from Abbots Field.
scubadiver Albert
Registered User
Join date: 8 Oct 2006
Posts: 24
10-12-2006 03:06
i got the ccc kit but does that script fire a shell or do you have to add a firing system yourself?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
10-12-2006 05:14
No idea, never used it :)
probably has a notecard or description to tell you
scubadiver Albert
Registered User
Join date: 8 Oct 2006
Posts: 24
10-15-2006 02:05
no there isn't but i'll search for it. if i find it i will post it on the forum for you guys to copy.