Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

G37 Spec Ops Rifle

Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-13-2006 08:15
From: Kator Bergson
if you know of a better gun that can fire more than one bullet through a dialog system AND is OS (OpenSource) Please Do tell me where I can find it ^_^

*source deleted*
_____________________
Xtreme Overdrive
New Breed Of Hero
Join date: 31 Mar 2006
Posts: 19
11-13-2006 12:58
OMG I haven't seen this original code in awhile.
But believe me when I say I feel your pain.

Looking at this, it should work. you ARE putting the grenade and the cow in the root prim, right?
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-13-2006 13:18
Yeah, I am, they are both in there, AND they both fire. However the sound wont work when I fire the weapon, HOWEVER if you know of a better gun that can fire more than one bullet through a dialog system AND is OS (OpenSource) Please Do tell me where I can find it ^_^
_____________________
Xtreme Overdrive
New Breed Of Hero
Join date: 31 Mar 2006
Posts: 19
11-13-2006 13:24
Here's some leet scripting for ya from my own stuff. Honed after.. um... I learned more stuff.

Put this in the dialog/interface. Yes. it could be cleaned up..
CODE
          /////////////// BULLET SELECTION
if (message == "reload"){llMessageLinked(LINK_ROOT,0,"weapon_RELOAD",NULL_KEY);return;}
// Generics //
if (message == "impact"){
llMessageLinked(LINK_ROOT,7746,"reload|Impact Bullet|250",NULL_KEY);
llMessageLinked(LINK_ROOT,0,"weapon_RELOAD",NULL_KEY); bullet="Impact (safe)"; return;}
if (message == "damage"){
llMessageLinked(LINK_ROOT,7746,"reload|Damage Bullet|250",NULL_KEY);
llMessageLinked(LINK_ROOT,0,"weapon_RELOAD",NULL_KEY); bullet="Damage";return;}



Put this in place of the bullet selection.
In globals... because adjustable velocity rocks.
CODE
integer bullet_vel=250;

And this in the bullet loader code, so you don't have to mix and match...
CODE
        if(num == 7746){// BULLET LOAD ///////////////////
list round = llParseString2List(str, ["|"], []);
// Load Normal Round
if(llList2String(round, 0) == "reload"){
bullet = llList2String(round, 1);
bullet_vel = llList2Integer(round, 2);}
//Load Special Low-Capacity Ordinance
if(llList2String(round, 0) == "ordinance"){
bullet = llList2String(round, 1);
bullet_vel = llList2Integer(round, 2);
integer ord_count = llList2Integer(round, 3);
llSetObjectDesc((string)ord_count);}
}/////////////////////////////////////////////////


Granted. This is just me being lazy and using a list sorter insted of making if conditions for each bullet.
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-13-2006 13:30
From: Xtreme Overdrive
Here's some leet scripting for ya from my own stuff. Honed after.. um... I learned more stuff.

Put this in the dialog/interface. Yes. it could be cleaned up..
CODE
 /////////////// BULLET SELECTION
if (message == "reload"){llMessageLinked(LINK_ROOT,0,"weapon_RELOAD",NULL_KEY);return;}
// Generics //
if (message == "impact"){
llMessageLinked(LINK_ROOT,7746,"reload|Impact Bullet|250",NULL_KEY);
llMessageLinked(LINK_ROOT,0,"weapon_RELOAD",NULL_KEY); bullet="Impact (safe)"; return;}
if (message == "damage"){
llMessageLinked(LINK_ROOT,7746,"reload|Damage Bullet|250",NULL_KEY);
llMessageLinked(LINK_ROOT,0,"weapon_RELOAD",NULL_KEY); bullet="Damage";return;}



Put this in place of the bullet selection.
In globals... because adjustable velocity rocks.
CODE
integer bullet_vel=250;

And this in the bullet loader code, so you don't have to mix and match...
CODE
 if(num == 7746){// BULLET LOAD ///////////////////
list round = llParseString2List(str, ["|"], []);
// Load Normal Round
if(llList2String(round, 0) == "reload"){
bullet = llList2String(round, 1);
bullet_vel = llList2Integer(round, 2);}
//Load Special Low-Capacity Ordinance
if(llList2String(round, 0) == "ordinance"){
bullet = llList2String(round, 1);
bullet_vel = llList2Integer(round, 2);
integer ord_count = llList2Integer(round, 3);
llSetObjectDesc((string)ord_count);}
}/////////////////////////////////////////////////


Granted. This is just me being lazy and using a list sorter insted of making if conditions for each bullet.


first off... Que?
I'm drunk and not understanding all that you put up here... personally its a bit... messy...
_____________________
Xtreme Overdrive
New Breed Of Hero
Join date: 31 Mar 2006
Posts: 19
11-13-2006 13:32
Methinks I'll have to make a new open-source weapon script w/ comments and put that out to the public.
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-13-2006 13:35
yeah cause this one is older than god.... lol
_____________________
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
11-13-2006 15:15
As I understand it, Rickard Roentgen scripted the original G-37 spec ops rifle. Because one of his co-collaborators trusted the wrong person, it was redistributed in fully permissive state.

It was not meant to be distributed open-source.

You might want to check up on that before you continue reposting the code/making derivative works.
_____________________
--
~If you lived here, you would be home by now~
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-13-2006 17:32
From: Francis Chung
As I understand it, Rickard Roentgen scripted the original G-37 spec ops rifle. Because one of his co-collaborators trusted the wrong person, it was redistributed in fully permissive state.

It was not meant to be distributed open-source.

You might want to check up on that before you continue reposting the code/making derivative works.

Francis, technically what right do you have to berate me? I am one out of many diffrent users with this script and it doesnt matter much, I'm trying to learn from it, Not sell it. and besides currently Now It is practically OS because its everywhere in a full permission state, Just like the original Shieldbreaker 101 thats still floating everywhere in the grid. It's just there. I am here to learn, not get berated for something that comes naturally to me. thank you.
In case you haven't noticed I already asked about using a totally diffrent script for this function.
_____________________
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
11-13-2006 19:38
From: Kator Bergson
Francis, technically what right do you have to berate me? I am one out of many diffrent users with this script and it doesnt matter much, I'm trying to learn from it, Not sell it. and besides currently Now It is practically OS because its everywhere in a full permission state, Just like the original Shieldbreaker 101 thats still floating everywhere in the grid. It's just there. I am here to learn, not get berated for something that comes naturally to me. thank you.
In case you haven't noticed I already asked about using a totally diffrent script for this function.
You weren't berated. You were rather kindly told that you may be in viloation of licence by reposting the scripts.

Just becasue a thing was passed around a lot does not mean you or anyone else has a right to it. That object was stolen, it remains a stolen object now, no matter how many people stole it. Also no matter how many had no idea whatever they were receiving stolen items.

Thems just the facts. No beratement.
_____________________
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-13-2006 22:28
Well normally untill I hear from the actual creator of the scripts or item they stay. Because no offical voice has been said on this matter, I am still working with them and its for private use anyway.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-14-2006 08:14
From: Kator Bergson
Well normally untill I hear from the actual creator of the scripts or item they stay. Because no offical voice has been said on this matter, I am still working with them and its for private use anyway.



Both Jillian and Francis where being polite, I'd seriously suggest you at least ask the creator for permission to post them and modify them. Until such time as I have seen an official post to that effect I will not give any help on them.
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-14-2006 16:47
I think EVERYBODY missed me saying this.

From: Kator Bergson
Yeah, I am, they are both in there, AND they both fire. However the sound wont work when I fire the weapon, HOWEVER if you know of a better gun that can fire more than one bullet through a dialog system AND is OS (OpenSource) Please Do tell me where I can find it ^_^


Cause I already had realized the impact that this might have as well as controversy.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-14-2006 22:25
Kator, Thank you. I know it seems like a small thing since the source code is out there, but thank you for understanding that it is still owned.

From: Kator Bergson
I think EVERYBODY missed me saying this.



Cause I already had realized the impact that this might have as well as controversy.



No Kator, didnt miss it at all. I just dont know of any, I rarely play with weapon scripts.
If you find a open source script then adding / changing it to use multiple bullets and / or dialogs shouldn't be that difficult. And I am sure 'we', the collective forum's scripter's we, will be more than happy to help.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
SEMI AUTO Script
11-15-2006 06:46
kator,

I have found a very simple gun script called "semi auto.lsl".
It has no author attributed to it and I have no idea where it originates.
(anyone out there know anything about it please chime in)

Its a reasonably straight forward script but I have no idea if it works or not.
If it does it could be a reasonably good test bed on which to add the multi bullet
dialog stuff you where after.

CODE

//
// Semi Auto Script
//

float SPEED = 75.0;
integer LIFETIME = 10;

float DELAY = 0.2;

vector vel;
vector pos;
rotation rot;

string gHoldAnim = "Ape_Stand09";
string gAimAnim = "GraveM_Stand06";
integer gControls = CONTROL_ML_LBUTTON;
integer gMouselook = FALSE;
integer have_permissions = FALSE;
integer armed = TRUE;
string instruction_not_held =
"Choose 'Acquire->attach->left hand' from my menu to wear and use me.";


fire()
{
if (armed)
{
armed = FALSE;
rot = llGetRot();
vel = llRot2Fwd(rot);
pos = llGetPos();
pos = pos + vel;
pos.z += 0.75;


vel = vel * SPEED;


llTriggerSound("Report", 1.0);
llRezObject("Bullet", pos, vel, rot, LIFETIME);

rot.z = rot.z *-PI ;
llRezObject("Shotgun Shell",pos+<-0.0,-0.0,-0.0>,-llRot2Left(rot),rot,0);


llSetTimerEvent(DELAY);
}
}

default
{
state_entry()

{
if (!have_permissions)
{
llRequestPermissions(llGetOwner(),
PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS);
}
}

on_rez(integer param)
{

llPreloadSound("Report");
}

control(key name, integer levels, integer edges)
{

if ( ((edges & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON)
&&((levels & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON) )
{

fire();
}
}

touch_end(integer num)
{

if (have_permissions)
{
}
else
{
llWhisper(0, instruction_not_held);
}
}

timer()
{

llSetTimerEvent(0.0);
armed = TRUE;
}

attach(key id)
{
if (id == NULL_KEY)
{
llStopAnimation(gHoldAnim);
llStopAnimation(gAimAnim);
llReleaseControls();
llSetTimerEvent(0.0);
}
else if (id == llGetOwner())
{
llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS);
}
}

run_time_permissions(integer perms)
{
llStartAnimation(gHoldAnim);
llSetTimerEvent(0.5);
llTakeControls(gControls, TRUE, FALSE);
}

timer()
{
integer mouselook = llGetAgentInfo(llGetOwner()) & AGENT_MOUSELOOK;
if (mouselook && !gMouselook)
{
// entered mouselook
llStopAnimation(gHoldAnim);
llStartAnimation(gAimAnim);
gMouselook = mouselook;
}
else if (!mouselook && gMouselook)
{
// left mouselook
llStopAnimation(gAimAnim);
llStartAnimation(gHoldAnim);
gMouselook = mouselook;
}
}
}
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-15-2006 23:29
From: Newgate Ludd
kator,

I have found a very simple gun script called "semi auto.lsl".
It has no author attributed to it and I have no idea where it originates.
(anyone out there know anything about it please chime in)

Its a reasonably straight forward script but I have no idea if it works or not.
If it does it could be a reasonably good test bed on which to add the multi bullet
dialog stuff you where after.

CODE

//
// Semi Auto Script
//

float SPEED = 75.0;
integer LIFETIME = 10;

float DELAY = 0.2;

vector vel;
vector pos;
rotation rot;

string gHoldAnim = "Ape_Stand09";
string gAimAnim = "GraveM_Stand06";
integer gControls = CONTROL_ML_LBUTTON;
integer gMouselook = FALSE;
integer have_permissions = FALSE;
integer armed = TRUE;
string instruction_not_held =
"Choose 'Acquire->attach->left hand' from my menu to wear and use me.";


fire()
{
if (armed)
{
armed = FALSE;
rot = llGetRot();
vel = llRot2Fwd(rot);
pos = llGetPos();
pos = pos + vel;
pos.z += 0.75;


vel = vel * SPEED;


llTriggerSound("Report", 1.0);
llRezObject("Bullet", pos, vel, rot, LIFETIME);

rot.z = rot.z *-PI ;
llRezObject("Shotgun Shell",pos+<-0.0,-0.0,-0.0>,-llRot2Left(rot),rot,0);


llSetTimerEvent(DELAY);
}
}

default
{
state_entry()

{
if (!have_permissions)
{
llRequestPermissions(llGetOwner(),
PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS);
}
}

on_rez(integer param)
{

llPreloadSound("Report");
}

control(key name, integer levels, integer edges)
{

if ( ((edges & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON)
&&((levels & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON) )
{

fire();
}
}

touch_end(integer num)
{

if (have_permissions)
{
}
else
{
llWhisper(0, instruction_not_held);
}
}

timer()
{

llSetTimerEvent(0.0);
armed = TRUE;
}

attach(key id)
{
if (id == NULL_KEY)
{
llStopAnimation(gHoldAnim);
llStopAnimation(gAimAnim);
llReleaseControls();
llSetTimerEvent(0.0);
}
else if (id == llGetOwner())
{
llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS);
}
}

run_time_permissions(integer perms)
{
llStartAnimation(gHoldAnim);
llSetTimerEvent(0.5);
llTakeControls(gControls, TRUE, FALSE);
}

timer()
{
integer mouselook = llGetAgentInfo(llGetOwner()) & AGENT_MOUSELOOK;
if (mouselook && !gMouselook)
{
// entered mouselook
llStopAnimation(gHoldAnim);
llStartAnimation(gAimAnim);
gMouselook = mouselook;
}
else if (!mouselook && gMouselook)
{
// left mouselook
llStopAnimation(gAimAnim);
llStartAnimation(gHoldAnim);
gMouselook = mouselook;
}
}
}

This version only fires once though, after that it fails to function at all.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-16-2006 00:58
oh well,
At least it does something, I wasnt even sure it would do that :)
Worth using as the basis for a complete project or not?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
Quick thought
11-16-2006 02:23
Looking at the control event handler,

CODE

control(key name, integer levels, integer edges)
{
if ( ((edges & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON) &&
((levels & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON) )
{
fire();
}
}


which could be rewriten as

CODE

control(key name, integer levels, integer edges)
{
if ( (edges & levels & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON )
{
fire();
}
}


So it would appear to me that it is waiting for both levels and held to return true which i think means click and release each time?
ScriptScavenger Lei
Registered User
Join date: 3 Sep 2006
Posts: 14
thus semi auto
11-16-2006 06:47
um tested the scrit it fires every time u click
but only once
on the up side theres no reload
(dont know why u would want a reload in a virtual weapon but lots of them have it )
think if u loop the rezobject part of the script it wil continue to fire as long as u hold the mouse button down
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-16-2006 07:03
Don't really understand why there wasn't a more enthusiastic response to the script Newgate posted. Jeez it doesn't matter what the script can't do. We are scripters. We can make the script do anything we want it to, and better then the original script posted. It is just easier starting with a skeleton then building from scratch. I also am not interested in weapons so haven't looked at them, but a "cow" launcher sounds fun!!!!! Could even add an option to fire whatever you put into inventory in the weapon. Adding loops to make the weapon full automatic are no problem.

Plenty of the weapons guru's would jump in I imagine also
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Xtreme Overdrive
New Breed Of Hero
Join date: 31 Mar 2006
Posts: 19
11-16-2006 08:06
Thing is, a gun script is a gun script is a gun script.
The G-36 is a full automatic weapon with innovative (for the time) features like updating reload count, custom animation playing, firing mode selection, etc.

Understanding this code is like a rite of passage for some people.

Granted, it could be alot more efficient.
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
11-16-2006 10:44
yeah technically I already have a full bodied weapons script. it can play whatever sound i want for firing, shoot whatever bullet at whatever fire rate or whatever bullet velocity however many times I want or I can set it to reload, its just I wrote it while stoned and theres a bloody mess of code in there that I can't sort through....
_____________________
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-16-2006 10:51
From: Kator Bergson
yeah technically I already have a full bodied weapons script. it can play whatever sound i want for firing, shoot whatever bullet at whatever fire rate or whatever bullet velocity however many times I want or I can set it to reload, its just I wrote it while stoned and theres a bloody mess of code in there that I can't sort through....

LMAO OMG I needed a good laugh today!!!!!!!

Yep I am older but do fondly remember my good ol days. Sounds like you have the same problems I always had. I either couldn't perform a simple task or I did something completely brilliant and then could never understand how I did it afterwards. But now, without any "brain enhancements", I will still script up something that is beyond my present capabilities and then not understand later how I had been able to do it.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Xtreme Overdrive
New Breed Of Hero
Join date: 31 Mar 2006
Posts: 19
11-16-2006 14:12
From: Kator Bergson
yeah technically I already have a full bodied weapons script. it can play whatever sound i want for firing, shoot whatever bullet at whatever fire rate or whatever bullet velocity however many times I want or I can set it to reload, its just I wrote it while stoned and theres a bloody mess of code in there that I can't sort through....


Good Times.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-19-2006 13:18
From: Xtreme Overdrive
Thing is, a gun script is a gun script is a gun script.
The G-36 is a full automatic weapon with innovative (for the time) features like updating reload count, custom animation playing, firing mode selection, etc.

Understanding this code is like a rite of passage for some people.

Granted, it could be alot more efficient.



Indeed its one of the reasons I cant be bothered with weapons in SL, more than enough decent ones already in here.

I posted because I thought Kator wanted a simple script to use as a basis for a fun project.
1 2