Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Why Are My Bullets Firing Backwards!?

Kale Kawabata
Registered User
Join date: 18 Sep 2005
Posts: 41
01-14-2006 10:08
I built a start wars clone LA AT and put scripts in the guns on top. The flight scripts sends a link message to the guns to fire on museclick. But when it does the bulletsa re firing backwards. The axis of the guns on top are all zero. Can anybody help me??
_____________________
Kale Kawabata =P
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-14-2006 10:41
Seeing the code would be handy...?
Kale Kawabata
Registered User
Join date: 18 Sep 2005
Posts: 41
Heres the script i used in the guns
01-14-2006 10:46
vector fwd;
vector pos;
rotation rot;
float power = 1.0;
key holder;
float bulletspeed = 35;
vector centerpos;
string bullet = "blaster bullet";

default
{
state_entry()
{
}
on_rez(integer param)
{
//to deal with stack heap collision on re-rez
llResetScript();

}
link_message(integer part, integer index, string msg, key id)
{
// listen(integer channel, string name, key id, string message) {
list cmd = llParseString2List(msg, [" "], []);
string auth = llList2String(cmd, 0);


if(auth=="fire";) {
rot = llGetRot();
fwd = llRot2Fwd(rot);
pos = llGetPos();
pos = pos + fwd;
//pos.z += 0.75; // Correct to eye point
pos.z += 0.85;
fwd = fwd * bulletspeed;
llTriggerSound("sblaster", 0.7);
llRezObject(bullet, pos, -fwd, rot, 0);
}
}
}
_____________________
Kale Kawabata =P
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
01-14-2006 12:17
It shoudl be

llRezObject(bullet, pos, fwd, rot, 0);

i.e. take out the minus sign.
Phoenix Psaltery
Ninja Wizard
Join date: 25 Feb 2005
Posts: 2,599
01-14-2006 13:14
You're putting the bullets in the gun backwards. Good way to kill yerself.

:D

P2
_____________________
:cool:
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-14-2006 13:16
A Rebel saboteur!
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
01-14-2006 13:18
From: Phoenix Psaltery
You're putting the bullets in the gun backwards. Good way to kill yerself.

:D

P2


Reminds me of those old water guns.. You used to shoot people, tell them they could have a free shot (twist it when they weren't looking) and they ended up shooting themselves :D
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.
---------------
Zapoteth Designs, Temotu (100,50)
---------------
Anjo Mirabeau
Registered User
Join date: 20 Aug 2005
Posts: 266
01-15-2006 09:09
Did you get the gun from Yosimite Sam? :P
Kage Seraph
I Dig Giant Mecha
Join date: 3 Nov 2004
Posts: 513
01-15-2006 09:53
I find your lack of forward vector... disturbing... :p