|
SeeSor Axon
Registered User
Join date: 6 Nov 2005
Posts: 6
|
02-02-2006 01:33
Hi all,
Could anyone help me please on a question?
with guns how do they cause damage? is it the fact that a prim hits the player or do you need to put a script in the bullet/prim to make the damage when it hits a player?
I know you have to set your land to unsafe, but i dont know if its just the fact that a prim hits you or it needs to be a script.
any help would be great
Thanks
|
|
Bond Harrington
Kills Threads At 500yds
Join date: 15 May 2005
Posts: 198
|
02-02-2006 01:48
You are right about being on Damage-enabled property for weapons to work. A projectile either needs to be scripted using the llSetDamage command or have enough "energy" from mass and velocity that it causes collision damage. On Damage-enabled land, collisions, such as flying at full speed into a brick wall in Rausch, can damage your avatar for a few points. Dropping or throwing a 1 ton weight on an avatar will typically "kill" that avatar.
|
|
Damien Fate
Goofy designer
Join date: 6 Nov 2003
Posts: 634
|
02-02-2006 04:19
Hi SeeSor, I am just moving this thread to Scripting - as it should find more replies there. I also suggest browsing the Scripting Library forum!
_____________________
Mirada.smartHUD - The new way to control your avatar and the world around you - In Mirada, Hairspray (22,63,51) or find me in world!You want me to be Semi Serious? Well that's ok, I'm almost half semi serious 50% of the time.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
02-02-2006 04:30
The simplest version of a bullet or other lethal item is just an object containing something like the following: default { state_entry() { llSetDamage(25); } }
That will produce something that, if you touch it or it touches you in an unsafe area, does 25% damage and then dies. (Damage-causing objects always die after causing damage). In practice a bullet is likely to have more to it than that. My most basic bullet, for instance, is a 95% hollow sphere, 2m x 0.01m x 0.01m, with something like the following in it: default { on_rez(integer p) { if (p > 0) { // Make the whole bullet transparent // otherwise it looks like you're firing spears llSetAlpha(0.0, ALL_SIDES); // Remove the collision sound otherwise it gets a bit irritating // This also removes collision particles llCollisionSound("", 0.0); //--- // A particle effect goes here so you can see it move. // Don't expect me to remember the parameters! //--- // Set the damage to the parameter passed to the bullet on rez llSetDamage(p); } } }
The bullet is so long because objects moving at high speeds have a tendency to pass through other objects otherwise. (The exact size will depend on the speed you fire it at.) It's thin and hollow to save on mass and not use up energy or produce recoil if you're firing a lot of them at the same time. The "if (p > 0)" condition is so that you can rez it on the ground from your inventory without it being invisible.
|
|
SeeSor Axon
Registered User
Join date: 6 Nov 2005
Posts: 6
|
02-02-2006 08:19
thanks for the help everyone
|