Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Open Source Bullet Script

Nizzy Lusch
Registered User
Join date: 14 Mar 2007
Posts: 6
05-18-2007 08:09
Hiya,

I have the common lolSBS gun makers starting package, and have learned alot about the basics of scripting by tinkering with this great set, however... the scripts inside the bullet that comes with the set are No Modify, so I cannot see them and find out how they work. Is there any place I could get a copy of these scripts for viewing, or any other bullet scripts? I love to make my own things and to understand how they work, but when bullet scripts are impossible to find for viewing, they will remain a black art to me. I hope someone here can help, cheers!
Seemok Capalini
Registered User
Join date: 4 May 2007
Posts: 17
Well kept secret
07-05-2007 00:05
I second that. I have been looking for bulletscripts or fullperm bullets, but no result... Who's gonna share one?
Snow Gretzky
Registered User
Join date: 20 Oct 2005
Posts: 23
popgun bullet
07-05-2007 06:25
Um, did you try taking the bullet out of the popgun?

There used to be one in everybody's library.

Similarly, the "cager" bullet is readily available. It looks something like this ";>"
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-05-2007 07:49
Please, if you're learning to make ammo... make ABSOLUTELY SURE that the ammo is always temp-rezzed under every possible condition. "Don't be a litterbug!".. and, it will save your account from a (short) lifetime of Abuse Reports.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
07-05-2007 09:40
Most bullets are very simple: they register a collision and die, that's it.


CODE

state default
{
on_rez(integer num)
{
llSetBuoyancy(1.0);
}

collision_start(integer num)
{
llDie();
}

land_collision_start(vector pos)
{
llDie();
}
}


This is a bullet in it's simplest form: it doesn't fall due to gravity, and it dies as soon as it hits something. Most bullets have some extra things, such as llSetStatus(STATUS_DIE_AT_EDGE,TRUE) so that if the bullet goes off the edge of a sim it gets deleted instead of returned to your lost and found folder. Also, you can use llCollisionSound(custom_sound,1); to replace the default "bump" sound with your custom_sound.

Some other additions to your basic bullet may include a particle effect, rezzing another object on collision such as a phantom sphere to represent an explosion visual effect, and even broadcasting some kind of data. Data broadcasting's most common use is for a combat system where you may want to keep track of some kind of score, who you hit, who hit you, where the bullet was when it hit, etc.


Other munition types, such as avatar seeking rockets are more or less just bullets with a sensor and a way to adjust it's velocity/rotation so that it can home in on an avatar. Caging munitions are an entirely different matter. they are essentially a prim rezzed around an avatar that uses a llSitTarget within the cage to prevent sitting out of the cage, and can be used to greif people in various ways as a non-physical or physical entity.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-05-2007 14:41
Gun and Bullet:

http://rpgstats.com/wiki/index.php?title=ExampleGun
Lupercaleb Walcher
Registered User
Join date: 19 Aug 2006
Posts: 15
07-07-2007 03:16
From: Senuka Harbinger
Most bullets are very simple: they register a collision and die, that's it.


CODE

state default
{
state_entry()
{
llSetBuoyancy(1.0);
}

collision_start(integer num)
{
llDie();
}

collision_land_start(vector pos)
{
llDie();
}
}


This is a bullet in it's simplest form: it doesn't fall due to gravity, and it dies as soon as it hits something. Most bullets have some extra things, such as llSetStatus(STATUS_DIE_AT_EDGE,TRUE) so that if the bullet goes off the edge of a sim it gets deleted instead of returned to your lost and found folder. Also, you can use llCollisionSound(custom_sound,1); to replace the default "bump" sound with your custom_sound.

Some other additions to your basic bullet may include a particle effect, rezzing another object on collision such as a phantom sphere to represent an explosion visual effect, and even broadcasting some kind of data. Data broadcasting's most common use is for a combat system where you may want to keep track of some kind of score, who you hit, who hit you, where the bullet was when it hit, etc.


Other munition types, such as avatar seeking rockets are more or less just bullets with a sensor and a way to adjust it's velocity/rotation so that it can home in on an avatar. Caging munitions are an entirely different matter. they are essentially a prim rezzed around an avatar that uses a llSitTarget within the cage to prevent sitting out of the cage, and can be used to greif people in various ways as a non-physical or physical entity.


the script isn't working, i get a syntax error

i think it's because i'm unable to see it in the php format, it's not in one of those fancy boxes
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
07-07-2007 13:17
From: Lupercaleb Walcher
the script isn't working, i get a syntax error

i think it's because i'm unable to see it in the php format, it's not in one of those fancy boxes


ah, it's because I wrote that script on the fly when I made the post and it had a typo or two. I Edited the post so it should compile now.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Alicia Mounier
Registered User
Join date: 17 Oct 2005
Posts: 78
07-07-2007 13:49
here is what i use, may have to change the way the llDie() works like maybe a sleep before so the round has time to do something special like a noise or particle effect upon impact.

default
{
on_rez(integer start_param)
{
llSetDamage(1);//this is what will kill in combat enabled sims or land the valid integer of 0-100 lol, though why put it in there if you don't want to do dmg, 0.
}
state_entry()
{
llSetBuoyancy(1.0);
llSetStatus(STATUS_DIE_AT_EDGE, TRUE);//this will keep it from flying through a bunch of sims and hitting some poor person relaxing on thier porch.
}

collision_start(integer chargeval)
{
llSetStatus(STATUS_PHYSICS, FALSE);
llSetStatus(STATUS_PHANTOM , TRUE);
llSetAlpha(0, ALL_SIDES);
llDie();//add a sleeper before if you do effects
}
land_collision_start(vector pos)
{
llSetStatus(STATUS_PHYSICS, FALSE);
llSetStatus(STATUS_PHANTOM , TRUE);
llSetAlpha(0, ALL_SIDES);
llDie();//add a sleeper before if you do effects
}
}
Dimentox Travanti
DCS Coder
Join date: 10 Sep 2006
Posts: 228
07-09-2007 07:36
Remember in serious firefights sim start to lag...

The die will take some time..
_____________________
LSL Scripting Database - http://lsl.dimentox.com
Ranya Palmer
*Smoking Ace*
Join date: 21 Apr 2007
Posts: 46
bullet help
02-01-2008 04:07
do anybody know how do i make a bullet move on it own upon rezzing cuz im
using an lolsbs gun script and i see that the bullets are self propelled but they
are not open source like the rest of the script is so how do i make a bullet
move by its self when its rezzed?

thanks in advanced