Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Some Scripting help

MasterThief117 Gerstort
whut?
Join date: 22 Dec 2005
Posts: 4
01-05-2006 20:56
I have a mine that I want to make better, so I looked at the script.
The first way I made it better was really inefficient and too long, I just repeated the line that launches you a lot of times.
The very original script is as follows:

CODE

float force_amount = 999999999999999999999999999999.0;

default
{
on_rez(integer start_param)
{
llPreloadSound("Explosion");
}
collision_start(integer total_number)
{
llSetDamage(5000);
if (llDetectedType(0) & AGENT)
llPushObject(llDetectedKey(0), force_amount*llRot2Up(llGetRot()) , ZERO_VECTOR, FALSE);
llTriggerSound("Explosion", 10.0);
llMakeExplosion(20, 1.0, 5, 3.0, 1.0, "Smoke", ZERO_VECTOR);
llMakeExplosion(20, 1.0, 5, 3.0, 1.0, "fire", ZERO_VECTOR);
llDie();
}
}


This was too weak, only sending avatars up about 200m so I tried this:

CODE

float force_amount = 999999999999999999999999999999.0;

default
{
on_rez(integer start_param)
{
llPreloadSound("Explosion");
}
collision_start(integer total_number)
{
llSetDamage(5000);
if (llDetectedType(0) & AGENT)
llPushObject(llDetectedKey(0), force_amount*llRot2Up(llGetRot()) , ZERO_VECTOR, FALSE);
llSetPos(llGetPos()+<0,0,600>);
llTriggerSound("Explosion", 10.0);
llMakeExplosion(20, 1.0, 5, 3.0, 1.0, "Smoke", ZERO_VECTOR);
llMakeExplosion(20, 1.0, 5, 3.0, 1.0, "fire", ZERO_VECTOR);
llDie();
}
}


As you see i am trying to use llSetPos(llGetPos()+<0,0,600>;); to put the avatar up to 600m but I soon realized the script does not work like that, it is trying to send the mine itself up that high.
So if there is a way of fixing this, or giving me another script that launches you really high please post it here or PM me and if possible, tell me how it works so I can understand this language better.
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
01-05-2006 21:29
As the LSL Wiki notes:
llSetPos is limited to moving no more than 10m per call in any direction. If the distance is more than 10m, the object will move in the direction of the specified position, but will stop after 10m.
It also explains to you that llSetPos will affect the mine and not the avatar. It also notes that llMakeExplosion is deprecated which means it can disappear at any future release.

It looks like you are working from some lousy, old scripts without reading the documentation and your llSetDamage call looks like you really want to cause some harm even though values over 100 are nonsensical. There are plenty of destructive weapons out there already. Might I suggest you make flowers instead?
MasterThief117 Gerstort
whut?
Join date: 22 Dec 2005
Posts: 4
01-05-2006 22:53
lol, llSetDamage is high because I like big numbers, and futility is fun.
Anyway is there a way to fix this or should I just get something else?
If so where, what, and how much? If someone can post a good script to do something similar to this, I would appreciate it. Please help the noobs like me that want the best weapons for just because. I never use any of my weapons against someone else unless I am in the weapons testing sandbox, in which I ask for explicit permission first, or if I am in Rausch, where I just go postal, lol.
Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
01-06-2006 02:01
From: MasterThief117 Gerstort
or should I just get something else?


Get something else. Like a copy of Counterstrike.
Zenick Aridian
Registered User
Join date: 1 Nov 2005
Posts: 8
01-06-2006 10:34
Masterthief next time u see me inworld i'll give you some tips on how to make your push bigger.
Just ask.
Dagmar Strauss
Registered User
Join date: 21 Dec 2005
Posts: 17
01-06-2006 11:06
I really think you ought to script something that's not a weapon first. Irresponsibly or just badly scripted weapons can cause all kinds of problems - sim lag, splash damage, kamikaze sensor objects that just go around killing everybody...

Why don't you start with maybe a scripted picture frame or something simple and work your way up?

I'm not mocking you, really, but anyone who thinks that llSetPos is a way to put an avatar up 600m... I just think you ought to read the wikki and start with something simpler. And I think that anybody who helps you with your push when you don't have the scripting abilities to make a safe, controlled push item ought to be smacked silly.

Oh yeah, and I was just on the wikki (yes, I'm new, but I'm not trying to make a landmine either), and thought you should know that llMakeExplosion is a deprecated function.